A robust RESTful API built with TypeScript and Express.js for managing an e-commerce platform. Features include user authentication, product management, shopping cart functionality, and admin controls.
-
Authentication & Authorization
- JWT-based authentication
- Role-based access control (Admin, Seller, User)
- Email verification and password reset
-
User Management
- User registration and profile management
- Seller account creation and verification
- Admin controls for user blocking/unblocking
-
Product Management
- Product CRUD operations
- Category management
- Image upload support
- Product approval workflow
-
Shopping Features
- Shopping cart management
- Order processing
- Transaction history
- Product reviews and ratings
-
Admin Dashboard
- User management
- Product approval system
- Seller verification
- Transaction monitoring
- TypeScript
- Express.js
- Prisma ORM
- PostgreSQL
- JWT Authentication
- Jest for testing
- Railway for deployment
- Clone the repository
git clone https://github.com/yourusername/ecommerce-api.git
- Install dependencies
npm install
- Environment Setup Copy .env.example to .env Configure your database and other environment variables
- Database Setup
npx prisma migrate dev
- Start Development Server
npm run dev
Base URL: https://ecommerce-api-production-5b59.up.railway.app/
- Auth: /api/v1/auth Registration, login, password reset
- Users: /api/v1/users User profile management
- Products: /api/v1/products Product CRUD operations
- Categories: /api/v1/categories Category management
- Cart: /api/v1/carts Shopping cart operations
- Admin: /api/v1/admin Administrative functions
- JWT token authentication
- Request validation using middleware
- Password encryption
- Protected routes
- Input sanitization
npm run test
MIT