nestjs-ecommerce-backend

Enterprise modular E-Commerce REST API built with NestJS, TypeScript, JWT authen

E-commerce Backend with NestJS

This is a NestJS-based e-commerce backend application with authentication, user management, dashboard, and seller features.

Prerequisites

Installation

  1. Clone the repository
  2. Install dependencies:
npm install
  1. Configure environment variables:
    • Copy .env.example to .env
    • Update the MongoDB connection URI and JWT settings

Database Setup

  1. Make sure MongoDB is running on your system
  2. The application will automatically create the database when it first connects

Running the Application

# development with nodemon (recommended for development)
npm run dev

# standard start
npm run start

# production mode
npm run start:prod

Project Structure

src/
├── Auth/           # Authentication module
├── common/         # Shared resources
├── Dashboard/      # Admin dashboard
│   └── Category/  # Category management
├── DB/            # Database configuration
│   └── Models/    # Mongoose schemas and models
├── Seller/        # Seller module
└── User/          # User module

Features

API Documentation

The API documentation will be available at /api when the application is running (coming soon).

Testing

# unit tests
npm run test

# e2e tests
npm run test:e2e

# test coverage
npm run test:cov