A production-grade, secure, and scalable Courier Management System built with Spring Boot, MongoDB, and Kafka. This project is designed to handle complex logistics operations including package tracking, dynamic pricing, role-based access control, and real-time notifications.
- JWT Authentication & Authorization: Secure login and registration with stateless token-based authentication.
- Role-Based Access Control (RBAC): Distinct permissions for Admin, Courier, and Customer.
- Input Validation: Strict request validation using Jakarta Validation API.
- Full CRUD Support: Complete lifecycle management of courier packages.
- Dynamic Pricing Engine: Automatic price calculation based on weight and service type (Normal, Speed, Express, Overnight).
- Secure OTP Delivery: 6-digit OTP verification required for successful delivery completion.
- Real-time Tracking: Detailed event logging for every package movement.
- Complex Queries: Advanced package search with multi-criteria filtering (Status, Weight range, User ID).
- Pagination & Sorting: High-performance data retrieval for all list APIs.
- Rate Limiting: Integrated
Bucket4jfor protecting APIs against brute-force and DDoS attacks. - Caching: Optimized performance with Spring Cache abstractions for analytics and frequently accessed data.
- File Upload: Support for uploading package-related documents or images.
- Global Exception Handling: Standardized error responses across the entire system.
- Kafka Event-Driven Architecture: Decoupled notification service and package event tracking using Apache Kafka.
- Email Integration: Automated SMTP-based email notifications for booking confirmation and OTPs.
- Swagger/OpenAPI: Fully documented RESTful APIs for easy frontend integration.
- Dockerized: Simplified deployment with Docker and Docker Compose.
| Component | Technology |
|---|---|
| Backend Framework | Spring Boot 3.2.2 |
| Database | MongoDB (NoSQL) |
| Messaging/Event Bus | Apache Kafka |
| Security | Spring Security + JWT |
| Documentation | Swagger / OpenAPI 3 |
| Build Tool | Maven |
| Containerization | Docker & Docker Compose |
The project follows a modular and industry-standard MVC Architecture:
src/main/java/com/courier/org/
├── config/ # Security, Caching, Rate Limiting & Filter configs
├── controller/ # REST Controllers (No business logic)
├── service/ # Business logic implementation
├── repository/ # Data access layer (MongoDB)
├── model/ # Domain entities/models
├── dto/ # Data Transfer Objects for API requests/responses
├── exception/ # Custom exceptions & Global Exception Handler
└── util/ # Helper classes and static utilities
- Java 17+
- Docker & Docker Compose
- Maven (optional, if running locally)
# Clone the repository
git clone <repository-url>
# Navigate to project root
cd CourierManagement
# Start all services (App, MongoDB, Kafka, Zookeeper)
docker-compose up -d- Configure your
.envor updateapplication.yamlwith your MongoDB and Mail credentials. - Run the application:
mvn spring-boot:run
Once the application is running, you can access the interactive Swagger documentation at: 🔗 http://localhost:8080/swagger-ui.html
- Kafka-based Notifications: Even if the mail server is slow, the application remains responsive as emails are processed asynchronously.
- OTP-Secured Deliveries: Prevents fraudulent deliveries by requiring a system-generated OTP verified at the point of delivery.
- Actuator Health Monitoring: Integrated Spring Boot Actuator for real-time health checks and performance monitoring.
- Dynamic Dashboard: Real-time analytics for admins to track system-wide logistics performance.
- Ritesh Prajapati
Developed as a Final Term Project for Backend Engineering with Spring Boot.