Application developed for education purposes
As I'm a proponent of Domain Driven Design, I've decided to use some techniques and tools from DDD to develop the API for managing and delivering news content.
The solution follows a clean architecture pattern and consists of the following projects:
Api: The web API layer that handles HTTP requests and responsesCore: Contains the business logic, domain entities, and core interfacesInfrastructure: Implementation of infrastructure concerns (data access, external services)UnitTests: Contains unit tests for the application
Technical requirements:
- .NET 9.0 SDK
- PostgreSQL instance
- Connection string to the DB can be set through user secrets with the standard key _ConnectionString on the
Apiproject
- Connection string to the DB can be set through user secrets with the standard key _ConnectionString on the
After running the migrations from the Infrastructure project (this project also requires a connection string), a user with and ID of 1 should be entered manually in the client.user table.
This API has two endpoints, one of which is public and the other expects a bearer token authentication header. The authentication token can be generated with the following command:
dotnet user-jwts create --name 1
This authentication mechanism is used only for development purposes and for production a proper OAuth2 implementation should be used.