Microservice responsible for managing the transport network infrastructure of the Smart Mobility platform for Dakar, Senegal. It handles transport modes, zones, stations, and routes.
# Smart Mobility Network Service
Microservice responsible for managing the transport network infrastructure of the Smart Mobility platform for Dakar, Senegal. It handles transport modes, zones, stations, and routes.
## Prerequisites
The following services and tools must be available before starting this microservice:
| Prerequisite | Default location | Purpose |
|---|---|---|
| Java 17 | – | Runtime |
| Maven 3.6+ (or use `./mvnw`) | – | Build tool |
| MySQL 8+ | `localhost:3306` | Persistence (database: `networkdb`) |
| Spring Cloud Config Server | `
localhost` | Centralised configuration |
| Eureka Service Registry | `
localhost` | Service discovery & registration |
> **MySQL setup**: create a database named `networkdb` and provide a user with full privileges on it. Always set a strong password and supply it via the environment variables `NETWORK_DB_USER` and `NETWORK_DB_PASSWORD` (do not leave the password empty in any environment).
## Technology Stack
- Java 17 / Spring Boot 4.0.3
- Spring Cloud 2025.1.0 (Config Client, Eureka Client)
- Spring Data JPA / MySQL 8
- Lombok, Jakarta Validation
- SpringDoc OpenAPI 2.x (Swagger UI)
- Spring Boot Actuator
## Architecture
```
com.smartmobility.smartmobilitynetworkservice
├── config/ # OpenApiConfig, DataSeeder
├── controller/ # REST controllers
├── domain/ # JPA entities
├── dto/ # Request/Response DTOs
├── exception/ # GlobalExceptionHandler, ResourceNotFoundException, ErrorResponse
├── repository/ # Spring Data JPA repositories
└── service/ # Business logic
```
## Entities
| Entity | Table | Description |
|---------------|------------------|--------------------------------------|
| TransportMode | transport_modes | TER, BRT, BUS, etc. |
| Zone | zones | Fare/geographic zones (A, B, C) |
| Station | stations | Stops belonging to a mode and z …