A template repository for a ToDo app API with .NET8 and PostgreSQL. REPR (FastEndpoints), CQRS (MediatR) and partially Clean Architecture patterns are used. The API is easily extensible and can be used as a starting point for a new project.
Functionality:
- Create, read, update and delete ToDos
- User registration, login, option to reset user's password. Accounts are stored in the database, authentication is done using JWT.
- Email templates and sending emails via Smtp or SendGrid is supported. Email templates are written in Liquid templating language.
- .NET 8
- PostgreSQL
- Dotnet ef
- Optional: Docker and Docker Compose
- Optional: An active SendGrid account with generated API key or a SMTP server for sending email
The database migrations are located in the ToDoAppTemplate.Data
project. The following commands can be run from the solution root directory:
# Create a new migration
dotnet ef migrations add MigrationName --project ./ToDoAppTemplate.Data --startup-project ./ToDoAppTemplate.Api
# Apply a migration
dotnet ef database update --project ./ToDoAppTemplate.Data --startup-project ./ToDoAppTemplate.Api
Either run the API by running docker-compose up
from the root of the solution. This will start the API and a PostgreSQL database in Docker containers.
Or run the API from Visual Studio or the command line. The connection string to the database can be configured in the appsettings.json
file.