Metro Backend Application is a microservices backend system for the metro management application, developed by the HCMURS organization. The system is designed with a microservices architecture using Spring Boot and Spring Cloud.
The system is designed with the following microservices:
| Service | Description |
|---|---|
eureka-service |
Service discovery for microservices |
gateway-service |
API Gateway that manages requests from clients |
auth-service |
Authentication and authorization management |
user-service |
User information management |
station-service |
Station and route information management |
ticket-service |
Ticket and booking information management |
order-service |
Order and payment management |
notification-service |
User notification management |
- Java 21: Main programming language
- Spring Boot 3.4.4: Application development framework
- Spring Cloud 2024.0.1: Microservices framework
- Spring Security: Authentication and authorization
- PostgreSQL: Relational database
- Redis: In-memory database and caching
- JWT: Token-based authentication
- Eureka: Service discovery
- OpenFeign: Client-side load balancing and REST client
- SpringDoc OpenAPI: API documentation (Swagger)
- Lombok: Reduces boilerplate code
- MapStruct: Object mapping
- Docker: Application containerization
- Java 21 or higher
- Maven 3.8 or higher
- Docker and Docker Compose (if running containerized)
- PostgreSQL (if running locally)
- Redis (if running locally)
Create an .env file in the root directory and in the /scripts directory (if applicable) with the necessary configurations. Refer to the required environment variables for each service.
mvn clean package
mvn spring-boot:run -pl services/eureka-service
mvn spring-boot:run -pl services/gateway-service
mvn spring-boot:run -pl services/auth-service
# Run other services similarly# Build Docker images for each service
mvn clean package -P docker
# Or build a specific service
mvn clean package -P eureka
mvn clean package -P gateway
mvn clean package -P auth
# etc.
# Use Docker Compose to run the entire system
docker-compose upmvn testAfter running the application, you can access the Swagger UI to view the API documentation at:
http://localhost:8080/swagger-ui.html
metro-be/
├── services/ # Directory containing microservices
│ ├── eureka-service/ # Service discovery
│ ├── gateway-service/ # API Gateway
│ ├── auth-service/ # Authentication & Authorization
│ ├── user-service/ # User management
│ ├── station-service/ # Station management
│ ├── ticket-service/ # Ticket management
│ ├── order-service/ # Order management
│ └── notification-service/ # Notification management
├── scripts/ # Support scripts (if any)
├── .env # Environment configuration file
├── docker-compose.yml # Docker Compose configuration
├── pom.xml # Maven parent configuration
└── README.md # Project documentation
- Fork the project
- Create a new branch for your feature:
git checkout -b feature/your-feature-name - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/your-feature-name - Create a Pull Request
All contributions are welcome. Please create issues or pull requests to improve the project.
Copyright © 2025 HCMURS. All rights reserved.
- Organization: HCMURS
If you have any questions, please contact via https://www.linkedin.com/in/vo-quang-minh-335792343
Created on: 2025-06-17