CallApp is a backend system developed in Java with Spring Boot and MongoDB, designed for managing transportation routes (airplane, train, bus), reservations, and secure JWT-based user authentication. The system allows complex routing, access control via roles and privileges, and reservation validation.
To set up the project locally, follow these steps:
git clone https://github.com/AMihneaa/callapp.git
cd callapp
./mvnw clean install
./mvnw spring-boot:rundocker build -t callapp .
docker run -p 8080:8080 callapp- Abstract Transport (parent class)
- Airplane
- Train
- Bus
- Route: references transportId and contains StopPoints
- StopPoint: includes location, arrivalTime, departureTime
- Reservation: links users to routes and StopPoints
- User → Role → Privilege (Security Layer)
Transport → Routes → StopPoints → Reservations
Implemented in RouteRepositoryImpl:
findByDepartureAndArrivalLocation(String departureLocation, String arrivalLocation)Steps:
- Queries all routes containing both locations.
- Filters routes where
departureappears beforearrival. - Excludes reversed or mismatched routes.
- Avoids already-used route IDs.
- Applies regex filters to StopPoints.
- Enables recursive chaining for indirect routes.
- Example:
Bucharest → Vienna → Frankfurt → Paris.
- Register/Login via
/auth/registeror/auth/login. - Receive a JWT token.
- Use
Authorization: Bearer <token>in requests. - Verified by a custom
JwtFilter.
- Each User → has a Role → has a list of Privileges.
- Controllers use annotations for fine-grained access.
- Passwords are encrypted using BCrypt.
| Endpoint | Required Access |
|---|---|
/api/airplane (GET) |
USER, ADMIN |
/api/airplane (POST) |
ADMIN |
/api/reservation |
Authenticated |
/auth/register |
Public |
curl -X POST http://localhost:8080/auth/register -H "Content-Type: application/json" -d '{"username":"testuser", "password":"password123"}'curl -X POST http://localhost:8080/auth/login -H "Content-Type: application/json" -d '{"username":"testuser", "password":"password123"}'curl -X GET http://localhost:8080/api/routes -H "Authorization: Bearer <your_jwt_token>"| Endpoint | Method | Description |
|---|---|---|
/auth/register |
POST | Register a new user |
/auth/login |
POST | Login and receive JWT |
/api/routes/{departureLocation}/to/{arrivalLocation} |
GET | Get available routes |
/api/routes/reserveticket/{ticketId} |
POST | Create a reservation |
- Swagger/OpenAPI documentation
- React frontend with route visualizer
- Automatic graph-based pathfinding
- Analytics for route popularity and behavior
Mihnea Aniculesei
GitHub: https://github.com/AMihneaa
This project is licensed under the MIT License.