This module is designed to allow real-time visualization of the vehicle's route and the location of passengers. It facilitates route tracking by displaying progress, estimated time, and generating and receiving start and arrival alerts for each trip.
- 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 - Geolocation, Routes and Tracking have a unacoplated hexagonal - clean architecture where looks for isolate the business logic with the other part of the app dividing it in multiple components:
-
π§ Domain (Core): Contains the business logic and principal rules.
-
π― Ports (Interfaces): Are interfaces that define the actions that the domain can do.
-
π Adapters (Infrastructure): Are the implementations of the ports that connect the domain with the specific technologies.
The use of this architecture has the following benefits:
- β Separation of Concerns: Distinct boundaries between logic and infrastructure.
- β Maintainability: Easier to update or replace specific components.
- β Scalability: Components can evolve independently.
- β Testability: The domain can be tested in isolation without a database or server.
π nemesis_travel_management_backend
β£ π src/
β β£ π main/
β β β£ π java/
β β β β π edu/dosw/rideci/
β β β β£ π NemesisTravelManagementBackendApplication.java
β β β β£ π domain/
β β β β β π model/ # π§ Domain models
β β β β£ π application/
β β β β β£ π ports/
β β β β β β£ π input/ # π― Input ports (Exposed use cases)
β β β β β β π output/ # π Output ports (external gateways)
β β β β β π usecases/ # βοΈ Use case implementations
β β β β£ π infrastructure/
β β β β β π adapters/
β β β β β£ π input/
β β β β β β π controller/ # π Input adapters (REST controllers)
β β β β β π output/
β β β β β π persistence/ # ποΈ Output adapters (persistance)
β β β π resources/
β β β π application.properties
β£ π test/
β β£ π java/
β β β π edu/dosw/rideci/NEMESIS_TRAVEL_MANAGEMENT_BACKEND/
β β β π NemesisTravelManagementBackendApplicationTests.java
β£ π docs/
β β£ diagramaClases.jpg
β β£ diagramaDatos.jpg
β β diagramaDespliegue.png
β£ π pom.xml
β£ π mvnw / mvnw.cmd
β π README.md
For detailed documentation refer to our Swagger UI (Running locally at http://localhost:8080/swagger-ui.html).
Data input & output
| Method | URI | Description | Request Body / Params |
|---|---|---|---|
POST |
/api/v1/routes/calculate |
Calculates the best route between two coordinates. | { "origin": { "lat": ..., "lng": ... }, "destination": { ... } } |
GET |
/api/v1/routes/{routeId} |
Retrieves details of a previously calculated route. | routeId (Path Variable) |
GET |
/api/v1/routes/preview |
Returns a lightweight polyline preview for the map. | ?origin=...&dest=... (Query Params) |
Common status codes returned by the API.
| Code | Status | Description |
|---|---|---|
200 |
OK | Request processed successfully. |
201 |
Created | Resource (Route/Tracking) created successfully. |
400 |
Bad Request | Invalid coordinates or missing parameters. |
401 |
Unauthorized | Missing or invalid JWT token. |
404 |
Not Found | Route or Trip ID does not exist. |
500 |
Internal Server Error | Unexpected error (e.g., Google Maps API failure). |
Data information per functionability
This module does not work alone. It interacts with the RideCi Ecosystem via REST APIs and Message Brokers:
- Travel Management Module: Receives information about the travel.
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 continous 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 continous 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.
Text
This diagram visualizes the dependencies between classes for developing the module's logic. It includes the following components:
- Controllers:
- Geolocalization Controller: This controller receives and manages all requests related to geolocation management, routes, and tracking, including references handled via DTOs.
When applying a hexagonal architecture, before developing the use cases, we need adapter components:
-
Adapter:
-
Geolocalization 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:
-
Get Emergency Contacts Use Case: Implementation to allow passengers to share their location with emergency contacts.
-
Get Geolocation Information Use Case: Obtain position information at regular intervals.
-
Generate Automatic Alerts Use Case: Generate automatic alerts at the beginning and end of the trip.
-
-
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 the current location at certain intervals, and all the information about the estimated route, the distance traveled, and so on.
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 presents the complete CRUD workflow for trip geolocation. It includes sequence diagrams for initiating, updating, and ending a trip.
The diagram also details the required validations and potential errors that may occur in each functionality. Finally, it illustrates the components involved in each process, including the Google Maps API and the relationship between them.
This diagram illustrates the cloud deployment architecture and workflow of the geolocation, routes and tracking module.
![]()
This section guides you through setting ip 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 compile.
git clone https://github.com/RIDECI/NEMESIS_ROUTES_AND_TRACKING_BACKEND.gitcd NEMESIS_ROUTES_AND_TRACKING_BACKENDYou can open it on your favorite IDE
Dockerize before compile the project avoid configuration issues and ensure 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 a essential part of the project functionability, this part will show the code coverage and code quality analazing with tools like JaCoCo and SonarQe.