Delivery Management Backend

Fabio Sarmento Pedro

Backend Engineer
Docker
MongoDB
.NET
Delivery Solution is a .NET 7 application that provides endpoints to manage deliveries. It is following the DDD pattern. It consists therefore of 4 main projects:
DeliveryApi: the API layer that exposes the endpoints.
DeliveryDomain: the business logic layer that contains the domain models and services.
DeliveryInfrastructure: the infrastructure layer that deals with data persistence using MongoDB and message queues using RabbitMQ.
DeliveryBackground: the background task that updates expired deliveries state every hour.
There are also 3 Unit Tests projects:
DeliveryApiTests: tests the Delivery endpoints.
DeliveryDomainTests: tests the business logic.
DeliveryInfrastructureTests: tests the database and message broker operations.

Available Endpoints

To interact with the API endpoints, you can use tools like Postman or cURL.

Users

POST /users/authenticate - Authenticate user.
GET /users - Gets paged users.
GET /users/{userID} - Gets the user by user id.

Deliveries

It uses a Bearer Token.
POST /deliveries/create - Creates a new delivery.
GET /deliveries - Gets paged deliveries.
GET /deliveries/{deliveryId} - Gets the delivery by delivery id.
PUT /deliveries/approve/{deliveryId} - Approves the delivery.
PUT /deliveries/complete/{deliveryId} - Completes the delivery.
PUT /deliveries/cancel/{deliveryId} - Cancels the delivery.
DELETE /deliveries/{deliveryId} - Deletes the delivery by delivery id.

MongoDB

The users and deliveries are stored in MongoDB.

RabbitMQ

The delivery updates (Created, Approved, Completed, Cancelled, and Deleted) will be pushed to the RabbitMQ exchange.
Expiring deliveries are also pushed to RabbitMQ.

Logging

The Delivery Solution logs information to Elasticsearch.

Conclusion

The Delivery Solution is a containerized application that stores deliveries in MongoDB and sends delivery updates to RabbitMQ. It provides a RESTful API to create, get, update, and delete deliveries. The solution also includes unit tests to ensure the business logic is working as expected.
Partner With Fabio
View Services

More Projects by Fabio