This module is designed to manage travels within the RideCi ecosystem: it creates, updates, lists and deletes trips, handles their status (e.g. CREATED, IN_PROGRESS, COMPLETED, CANCELED) and exposes this information to other microservices.
- Santiago Carmona Pineda
- Tulio RiaΓ±o Sanchez
- Daniel PatiΓ±o Mejia
- Juan Felipe Rangel Rodriguez
- Project Architecture
- API Documentation
- Input & Output Data
- Microservices Integration
- Technologies
- Branch Strategy
- System Architecture & Design
- Getting Started
- Testing
The Nemesis - Travel Management backend follows a decoupled hexagonal / clean architecture that isolates the business logic from infrastructure and external services by splitting the code into multiple components:
-
π§ Domain (Core): Contains the travel entities, value objects, enums (
Status,TravelType) and the core business rules. -
π― Ports (Interfaces): Interfaces that define which operations the domain can perform (use cases exposed as input ports and required external interactions as output ports).
-
π Adapters (Infrastructure): Implementations of the ports that connect the domain with technologies such as HTTP controllers, MongoDB persistence and RabbitMQ.
Main benefits of this architecture:
- β Separation of Concerns: Clear limits between business logic and infrastructure.
- β Maintainability: Easier to modify or replace specific components.
- β Scalability: Components can evolve and scale independently.
- β Testability: The domain can be tested in isolation without database or web server.
π nemesis_travel_management_backend
β£ π src/
β β£ π main/
β β β£ π java/
β β β β π edu/dosw/rideci/
β β β β£ π NemesisTravelManagementBackendApplication.java
β β β β£ π domain/
β β β β β π model/ # π§ Domain models (Travel, Location, enums)
β β β β£ π application/
β β β β β£ π events/ # π‘ Domain events (TravelCreatedEvent, TravelCompletedEvent)
β β β β β£ π mapper/ # π Mappers between domain and infrastructure DTOs
β β β β β£ π port/
β β β β β β π in/ # π― Input ports (use case interfaces)
β β β β β π service/ # βοΈ Use case implementations (TravelService)
β β β β£ π exceptions/ # β Custom domain/infrastructure exceptions
β β β β£ π infrastructure/
β β β β β£ π config/ # βοΈ Spring / Infra configuration (OpenAPI, RabbitMQ)
β β β β β£ π controller/
β β β β β β£ π TravelController.java # π REST controllers
β β β β β β π dto/ # π¨ Request / Response DTOs
β β β β β β£ π Request/
β β β β β β π Response/
β β β β β π persistance/
β β β β β£ π Entity/ # ποΈ MongoDB documents (TravelDocument, LocationDocument)
β β β β β£ π Repository/ # π§° Spring Data repositories & adapters
β β β β β β£ π TravelRepository.java
β β β β β β£ π TravelRepostoryAdapter.java
β β β β β β π RabbitEventPublisher.java
β β β π resources/
β β β π application.properties
β£ π test/
β β£ π java/
β β β π edu/dosw/rideci/
β β β£ π NemesisTravelManagementBackendApplicationTests.java
β β β£ π Adapter/
β β β β π TravelRepositoryAdapterTest.java
β β β π Controller/
β β β π TravelControllerTest.java
β£ π docs/
β β£ diagramaCasosUso.png
β β£ diagramaClases.jpg
β β£ diagramaComponentes.png
β β£ diagramaContexto.png
β β£ diagramaDatos.jpg
β β diagramaDespliegue.png
β£ π pom.xml
β£ π mvnw / mvnw.cmd
β π README.md
For detailed documentation refer to Swagger UI (running locally at http://localhost:8080/swagger-ui.html).
Below is a summary of the main REST endpoints exposed by TravelController (base path may vary, e.g. /api/v1/travels).
Note: Adjust the exact URIs if your controller mapping differs.
| Method | URI | Description | Request Body / Params |
|---|---|---|---|
POST |
/api/v1/travels |
Creates a new travel | TravelRequest (JSON) |
GET |
/api/v1/travels |
Retrieves all travels | β |
GET |
/api/v1/travels/{id} |
Retrieves a travel by ID | id (Path Variable) |
PUT |
/api/v1/travels/{id} |
Modifies an existing travel | id + TravelRequest (JSON) |
PATCH |
/api/v1/travels/{id}/status |
Changes the status of a travel | id + new status (e.g. query/body) |
GET |
/api/v1/travels/{id}/passengers |
Gets passenger list for a travel | id (Path Variable) |
DELETE |
/api/v1/travels/{id} |
Deletes a travel by ID | id (Path Variable) |
Common status codes returned by the API.
| Code | Status | Description |
|---|---|---|
200 |
OK | Request processed successfully. |
201 |
Created | Travel created successfully. |
204 |
No Content | Travel deleted successfully. |
400 |
Bad Request | Invalid data or missing parameters. |
404 |
Not Found | Travel ID does not exist. |
500 |
Internal Server Error | Unexpected error on server side. |
Data information per functionality (simplified overview):
-
TravelRequest (Input)
origin(LocationRequest)destination(LocationRequest)travelType(e.g. ONE_WAY, ROUND_TRIP)departureTime- Optional passenger info depending on design
-
TravelResponse (Output)
idorigin/destination(LocationResponse)status(fromStatusenum)travelTypecreatedAt/updatedAt- Additional travel details
-
LocationRequest / LocationResponse
- Coordinates or semantic location data used by travels.
You can inspect LocationRequest, LocationResponse, TravelRequest and TravelResponse classes under infrastructure/controller/dto for full details.
This module is part of the RideCi ecosystem and typically interacts with other services via REST and message broker (RabbitMQ):
- Routes & Tracking Module: May consume travel events (
TravelCreatedEvent,TravelCompletedEvent) to start or stop geolocation tracking. - Profiles / Passengers Module: Provides passenger data associated with a travel.
- Notifications Module: Sends alerts related to travel state changes (start, completion, cancellation, etc.).
The following technologies were used to build and deploy this module:
This module follows a strict branching strategy based on Gitflow to ensure the ordered versioning, code quality and continuous integration.
| Branch | Purpose | Receive of | Sent to | Notes |
|---|---|---|---|---|
main |
π Stable code for preproduction or Production | release/*, hotfix/* |
π Production | π Protected with PR y successful CI |
develop |
π§ͺ Main developing branch | feature/* |
release/* |
π Base to continuous deployment |
feature/* |
β¨ New functions or refactors to be implemented | develop |
develop |
π§Ή Are deleted after merge to develop |
release/* |
π¦ Release preparation & final polish. | develop |
main y develop |
π§ͺ Includes final QA. No new features added here. |
bugfix/* o hotfix/* |
π οΈ Critical fixes for production | main |
main y develop |
β‘ Urgent patches. Highest priority |
Used for new features or non-critical improvements.
Format:
feature/[shortDescription]
Examples:
feature/authenticationModulefeature/securityService
Rules:
- π§© Case: strictly camelCase (lowercase with hyphens).
- βοΈ Descriptive: Short and meaningful description.
Used for preparing a new production release. Follows Semantic Versioning.
Format:
release/v[major].[minor].[patch]
Examples:
release/v1.0.0release/v1.1.0-beta
Used for urgent fixes in the production environment.
Format:
hotfix/[shortDescription]
Examples:
hotfix/fixTokenExpirationhotfix/securityPatch
We follow the Conventional Commits specification.
<type>(<scope>): <short description>
This section provides a visual representation of the module's architecture ilustrating the base diagrams to show the application structure and components flow.
This diagram visualizes the dependencies between classes for developing the module's logic. It includes the following components:
- Controllers:
- Travel Management Controller: This controller receives and manages all requests related to travels, including references handled via DTOs.
When applying a hexagonal architecture, before developing the use cases, we need adapter components:
-
Adapter:
-
Travel Adapter: Contracts (interfaces) are defined based on the input received from the controllers.
-
Mapper Adapter: This adapter transforms data types from one object to another for use in the respective use cases.
-
-
Use Cases:
-
Create Travel Use Case: Implementation to create new travels.
-
Modify Travel Use Case: Update data for an existing travel.
-
Change State Travel Use Case: Change the travel status during its lifecycle.
-
Get Travel Use Case: Retrieve information about a specific travel.
-
Get All Travel Use Case: Retrieve a list of all travels.
-
Get Passenger List Use Case: Retrieve the passenger list for a travel.
-
Delete Travel Use Case: Delete a travel.
-
-
Ports: The following interfaces were defined as the data we will receive from the outside:
-
Port Notifications
-
Port Profiles
-
Port Travel Information
-
This diagram presents the main functionalities defined by each actor. This facilitates a better understanding when implementing the module's multiple functions, as well as identifying and separating each actor's roles when using the application.
Based on the Specific Components diagram, we created the class diagram, where we defined an Observer design pattern that will notify all passengers already registered on the trip, allowing them to view information related to the travel.
This diagram represents how the data is stored, where we will find the multiple documents, and the data that will be stored in an embedded or referenced manner.
This diagram illustrates the cloud deployment architecture and workflow of the travel management module.

This section guides you through setting up the project locally. This project requires Java 17. If you have a different version, you can change it or we recommend using Docker to ensure compatibility before compiling.
git clone https://github.com/RIDECI/NEMESIS_TRAVEL_MANAGEMENT_BACKEND.gitcd NEMESIS_TRAVEL_MANAGEMENT_BACKENDYou can open it in your favorite IDE.
Dockerizing before compiling the project avoids configuration issues and ensures environment consistency.
docker compose up -dDownload dependencies and compile the source code.
mvn clean installmvn clean compileStart the Spring Boot server
mvn spring-boot:runTesting is an essential part of the project functionality; this section will show the code coverage and code quality analyzed with tools like JaCoCo and Sonar.






