A distributed backend system that simulates a modern logistics tracking platform similar to DHL, UPS, or FedEx.
This project demonstrates how to design and build a scalable microservices architecture using NestJS, RabbitMQ, and gRPC. The system allows users to create shipments, track delivery status in real-time, and receive notifications when shipment events occur.
The platform follows an event-driven microservices architecture where services communicate asynchronously using RabbitMQ and synchronously using gRPC.
API Gateway
|
---------------------------------------
| | | |
Auth User Shipment Tracking
| | | |
----------- RabbitMQ Event Bus --------
|
Notification Service
|
Firebase FCM
Handles authentication and authorization.
Features:
- User registration
- Login with JWT
- Token validation
- Role management
Manages user accounts.
Features:
- User profile management
- Address management
- Account preferences
Responsible for creating and managing shipments.
Features:
- Create shipment
- Assign tracking number
- Update shipment information
- Shipment status management
Example statuses:
- CREATED
- PICKED_UP
- IN_TRANSIT
- ARRIVED_AT_WAREHOUSE
- OUT_FOR_DELIVERY
- DELIVERED
Maintains the shipment tracking timeline.
Features:
- Track shipment history
- Record location updates
- Store shipment event timeline
Example tracking event:
{
"trackingNumber": "PKG123456",
"status": "IN_TRANSIT",
"location": "Algiers Sorting Center",
"timestamp": "2026-04-06T12:00:00Z"
}
Sends real-time notifications when shipment status changes.
Supports:
- Push notifications via Firebase Cloud Messaging
- Email notifications
- SMS notifications (future extension)
Example notifications:
📦 Your package has been picked up
🚚 Your package is out for delivery
✅ Your package has been delivered
RabbitMQ is used as the message broker for inter-service communication.
Example events:
shipment.created
shipment.picked_up
shipment.in_transit
shipment.out_for_delivery
shipment.delivered
Example flow:
- User creates shipment
- Shipment Service publishes
shipment.created - Tracking Service records the event
- Notification Service sends push notification
Backend
- NestJS
- TypeScript
- RabbitMQ
- gRPC
- PostgreSQL / MongoDB
Messaging
- RabbitMQ
Notifications
- Firebase Cloud Messaging (FCM)
Containerization
- Docker
- Docker Compose
- User creates a shipment.
- A unique tracking number is generated.
- Each delivery step produces a tracking event.
- Events are published to RabbitMQ.
- Tracking and Notification services consume events.
- Users receive real-time updates on shipment status.
- Demonstrate event-driven microservices architecture
- Implement asynchronous communication with RabbitMQ
- Explore scalable backend design patterns
- Simulate real-world logistics infrastructure
- Practice NestJS microservice development
- Real-time map tracking
- Delivery driver mobile app integration
- Warehouse management module
- Analytics dashboard
- Rate calculation and billing
- Multi-region deployment
By building this project you will gain practical experience with:
- Distributed systems architecture
- Message-driven communication
- Microservices orchestration
- Scalable backend design
- Event-driven patterns
- Notification infrastructure