A small example microservices-based e-commerce platform. This repository contains multiple independent services that collaborate via HTTP and message queues. Each service is a focused Node.js/TypeScript app with its own responsibilities, configurations, and Dockerfile.
- authentication-server 🔐 — Handles user registration, login, OTP, JWT issuance and basic user management.
- gateway-server 🛡️ — API gateway that exposes endpoints to clients and forwards requests to internal services.
- product-server 📦 — Manages products, product data, reviews and search-related logic.
- order-server 🧾 — Processes orders, validates payloads and communicates with payment/fulfillment (stubbed here).
- notification-server ✉️ — Sends emails/notifications (consumes messages from RabbitMQ to send emails for other services).
Each service lives in its own folder and follows a similar project layout (src/, configs/, routes/, controllers/, services/, utils/, etc.).
- authentication-server/
- gateway-server/
- notification-server/
- order-server/
- product-server/
Open each service folder to see the internal structure. Typical locations for important code:
- src/configs — envs and connection setups (RabbitMQ, DBs, Redis, Firebase, etc.)
- src/routes — route definitions
- src/controllers — request handlers
- src/services — business logic
- src/middleware — auth, validation, error handlers
- Node.js (>= 16 recommended)
- npm or yarn
- Docker & Docker Compose (optional — services include Dockerfiles)
- Local/remote instances of MongoDB, Redis, RabbitMQ and (optional) Firebase, if you want to run everything end-to-end
-
Open a terminal and go to the service folder (e.g. authentication-server):
cd authentication-server
-
Install dependencies:
npm install
-
Configure environment variables. See src/configs/envs.ts in each service for required variables.
-
Run in development mode (most services expose
devorstartscripts):npm run dev
Repeat for each service you want to run locally. Alternatively, build and run the Dockerfile in each service or use your own Docker Compose setup.
Each service includes a Dockerfile. You can build an image for a service and run it with Docker. Example:
docker build -t authentication-server ./authentication-server docker run -e NODE_ENV=production -p 4000:4000 authentication-server
There is no central docker-compose.yml in this repo — you can create one to orchestrate services, MongoDB, RabbitMQ, and Redis for local integration testing.
The services use RabbitMQ for async communication (see src/configs/rabbitmq.ts in services that need it). Notification-server listens to messages from other services to send emails. Product and Order services may publish events like order.created, product.updated, etc.
Run tests inside each service directory. Many services use Jest for unit testing (see authentication-server/tests).
npm test
Each service holds an envs file under src/configs/envs.ts. Inspect those files to find the environment variables required for local runs (ports, DB URLs, RabbitMQ URL, JWT secrets, mail credentials, Firebase creds, etc.).
- Client → Gateway Server (auth, routing, basic validation)
- Gateway forwards requests to Product/Order/Auth services (HTTP)
- Services communicate async via RabbitMQ for decoupled notifications and background processing
- Notification service consumes messages and sends emails
This pattern allows services to scale independently and keeps responsibilities separated.
- Open issues or PRs against the service folder relevant to your change.
- Keep changes scoped to a single service when possible.
- Follow existing code style and patterns (TypeScript + Node + minimal controller-service separation).
This project includes LICENSE files in individual services. Check each service for license specifics.
If you need help running a specific service locally or want a docker-compose example, tell me which services you want to run together and I can provide a configuration or step-by-step guidance.
Happy hacking! ✨