MicroShop is a scalable backend application for e-commerce, built using Node.js, Express, and MongoDB. This project follows a microservices architecture, splitting the system into three distinct services: Product Service, User Service, and Order Service.
- Microservices Architecture: Modular and scalable structure with separate services for products, users, and orders.
- RESTful APIs: CRUD operations for products, user management, and order processing.
- JWT Authentication: Secure user authentication and authorization.
- MongoDB Integration: Persistent data storage with Mongoose ORM.
- Dockerized Services: Simplified deployment with Docker and Docker Compose.
- Unit & Integration Testing: Ensure reliability through automated tests.
The application consists of three microservices, each responsible for different aspects of the e-commerce platform. The services communicate with each other via RESTful APIs (or optionally through message queues).
- Manages product data (CRUD operations)
- Routes:
POST /products
: Create a new productGET /products
: Fetch all productsGET /products/:id
: Fetch a single product by IDPUT /products/:id
: Update a product by IDDELETE /products/:id
: Delete a product by ID
- Handles user registration, authentication, and profile management
- Routes:
POST /register
: Register a new userPOST /login
: Login a user and receive a JWT tokenGET /profile
: Get user profile (JWT protected)
- Manages order creation and retrieval for authenticated users
- Routes:
POST /orders
: Create a new order (JWT protected)GET /orders
: Get all orders for the authenticated user (JWT protected)
- Node.js (version 14.x or higher)
- MongoDB (Local instance or cloud service)
- Docker (optional, for containerization)
- Postman or similar tool for API testing