A modern and scalable e-commerce API built with NestJS framework, written in TypeScript, and using PostgreSQL database.
- 🔐 JWT-based authentication and authorization
- 👥 User management (registration, login, profile management)
- 🛍️ Product management (CRUD operations)
- 📦 Order management
- ⭐ Product reviews and ratings
- 📑 Category management
- 📚 Swagger UI API documentation
- 🔄 TypeORM database management
- 🧪 Jest testing infrastructure
- 🔒 Security measures (Helmet, Compression)
- Framework: NestJS
- Programming Language: TypeScript
- Database: PostgreSQL
- ORM: TypeORM
- API Documentation: Swagger UI
- Testing: Jest
- Security: JWT, Bcrypt, Helmet
- Code Quality: ESLint, Prettier
- Node.js (v14 or higher)
- PostgreSQL
- npm or yarn
- Clone the repository:
git clone https://github.com/MeteSayan/nestjs-ecommerce-api.git
cd nestjs-ecommerce-api
- Install dependencies:
npm install
- Configure database settings:
- Update database connection details in
config/default.json
- Run database migrations:
npm run migration:run
# Development mode
npm run start:dev
# Production mode
npm run build
npm run start:prod
Access the API documentation through Swagger UI:
http://localhost:3200/api/docs
# Run unit tests
npm run test
# Generate test coverage report
npm run test:cov
# Run E2E tests
npm run test:e2e
# Generate new migration
npm run migration:generate -- db/migrations/migration-name
# Run migrations
npm run migration:run
# Revert last migration
npm run migration:revert
- JWT-based authentication
- Password hashing (Bcrypt)
- Security headers with Helmet
- Rate limiting
- CORS configuration
src/
├── users/ # User management
├── products/ # Product management
├── orders/ # Order management
├── categories/ # Category management
├── reviews/ # Product reviews
└── utils/ # Utility functions
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'feat: Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Mete Sayan - GitHub
Project Link: https://github.com/MeteSayan/nestjs-ecommerce-api