Skip to content

ekin-burak/Sales-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sales Management System

A microservices-based sales management system built with Node.js, Express, and MongoDB.

Features

  • User Management with JWT Authentication
  • Customer Management
  • Sales Tracking with Pipeline
  • API Gateway for Service Communication
  • Swagger Documentation
  • Docker Support
  • Workspace-based Monorepo Structure

Prerequisites

  • Node.js (v18 or higher)
  • MongoDB
  • Docker and Docker Compose (optional)

The system consists of four microservices:

  • API Gateway (Port 3000) - Entry point for all client requests
  • User Service (Port 3001) - Handles authentication and user management
  • Customer Service (Port 3002) - Manages customer data and relationships
  • Sales Service (Port 3003) - Tracks sales pipeline and opportunities

🛠️ Tech Stack

  • Backend: Node.js & Express
  • Database: MongoDB
  • Authentication: JWT
  • Documentation: Swagger
  • Containerization: Docker
  • Project Structure: Monorepo with npm workspaces

Project Structure

.
├── services/
│   ├── user-service/        # User management service
│   ├── customer-service/    # Customer management service
│   ├── sales-service/      # Sales tracking service
│   └── api-gateway/        # API Gateway
├── shared/                 # Shared modules and utilities
├── node_modules/          # Root level dependencies
├── package.json          # Workspace configuration
└── docker-compose.yml    # Docker Compose configuration

Getting Started

Local Development

  1. Clone the repository:
git clone <repository-url>
cd sales-management-system
  1. Install dependencies using workspace-based installation:
npm install
  1. Create .env files in each service directory (see .env.example files)

  2. Start MongoDB:

mongod
  1. Start all services in development mode:
npm run dev

Alternatively, you can start individual services from their respective directories:

cd services/<service-name> && npm run dev

Using Docker

  1. Build and start all services:
docker-compose up --build
  1. Stop all services:
docker-compose down

API Documentation

Each service provides Swagger documentation at:

Testing

Run tests for all services:

npm test

To run tests for a specific service:

cd services/<service-name> && npm test

Environment Variables

Each service requires its own .env file. See the .env.example files in each service directory for required variables.

About

Microservices of Sales Management System

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published