This repository is a C# skeleton with ASP.NET Core & PostgreSQL designed for quickly getting started developing an API. Check the Getting Started for full details.
Within the Makefile you can handle the entire flow to get everything up & running:
- Install
make
on your computer, if you do not already have it. - Start the application:
make up
- Run the application tests:
make test
As you could see on the Makefile script and the Docker-Compose File, the whole API is containerized with Docker and the API is using the internal DNS to connect to the PostgreSQL instance.
Go to http://localhost:8080/api/health to see that everything is up & running! You can also check the API definition on the Swagger UI page
This skeleton is based on a Clean Architecture approach, so you could find the first basic layers:
You could find here two amazing articles (here and here) explaining the Clean Architecture with Java! (credits to @bertilMuth and @ryanthelin).
Here you will find the different files to interact with the outside. In this folder you there are two different folders:
Controllers
: Here you will have the classes that handle the REST endpoints and the Request/ResponseRepositories
: Here is the persistence layer, which interact with the PostgreSQL database, decoupling the rest of the application
You can use this as a starting point to continue with this architecture, or adapt it to your preferences.
Any of your domain Entities, or Services, that models your business logic. These classes should be completely isolated of any external dependency or framework, but interact with them. This layer should follow the Dependency Inversion principle.
It defines application-specific business rules. They encapsulate and implement all of the approved use cases for the application. The use cases control the flow to and from entities and can call on entities to use their enterprise-scale rules to complete certain user tasks.
If you are having problems or need anything else, please let us know by raising a new issue.
This project is licensed with the MIT license.
Made with ❤️ by Rviewer