Skip to content

Rviewer-Challenges/skeleton-asp-net-api

Repository files navigation

Rviewer skeleton: C#, ASP.NET Core & PostgreSQL

Twitter

Rviewer Discord


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.

Technologies

Getting Started

Within the Makefile you can handle the entire flow to get everything up & running:

  1. Install make on your computer, if you do not already have it.
  2. Start the application: make up
  3. 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

Overview

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).

Infrastructure

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/Response
  • Repositories: 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.

Domain

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.

Application

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.

Support

If you are having problems or need anything else, please let us know by raising a new issue.

License

This project is licensed with the MIT license.


Made with ❤️ by Rviewer