This project is a solution for the test assignment. Implement API for simple parcel delivery service.
- API docs
- Start services locally
./gradlew :composeUp
- Navigate to playground at http://localhost:18080
- Use
docker-composeto interact with services
The app is a distributed system that provides simple REST API for parcel delivery service. The main purpose of this project is to demonstrate a modern approach to the development process. The app is developed using a full CI cycle using the following components:
- Github Actions for CI
- Sonarcloud for Code Quality
- Spring infrastructure for microservice development
- PostgresSQL for data persistence
- Testcontainers for near-production test environment
- Docker for easy deployment of the solution
The main tool to explore the solution is the main page of the project which is available at http://localhost:18080 after deployment. It's a Swagger-like page that provides the ability to authorize and interact with an API.
For demo purposes, special_key is set as default and gives ability to access any API. Also, there are three users are
created by default:
- User:
john@doe.com - Admin:
jane@doe.com - Courier:
jack@doe.com
The default password is password123. Use it
to sign in and then use retrieved
JWT accessToken for access to other resources
of the app.
The Solution is deployable via docker-compose. Each microservice has its own Dockerfile which is used in the main
docker-compose
file. Health checks are implemented for each service. By default, only one service exposes a port for an interaction,
dependent services are hidden behind the docker network.
For development purposes solution provides additional compose files that override default behavior:
docker-compose.dev.yml- exposes service ports for local developmentdocker-compose.ci.yml- contains CI-specific properties which are used during deploy test in CI
- Java 17
- Spring Boot 3
- Spring Cloud Gateway
- Spring Cloud Streams
- Docker
- Springdoc
- Testcontainers
- PostgreSQL
- Liquibase
- Spring Data JPA
- Kafka
- Sonar
- Github actions
Each user story has a corresponding API endpoint which is specified in the table:
| User | Admin | Courier |
|---|---|---|
| Can create an user account and log in | Can change the status of a parcel delivery order | Can log in |
| Can create a parcel delivery order | Can view all parcel delivery orders | Can view all parcel delivery orders that assigned to him |
| Can change the destination of a parcel delivery order** | Can assign parcel delivery order to courier | Can change the status of a parcel delivery order |
| Can cancel a parcel delivery order | Can log in and create a courier account | Can see the details of a delivery order |
| Can see the details of a delivery | Can track the delivery order by coordinates | |
| Can see all parcel delivery orders that he/she created | Can see list of couriers with their statuses |
