ASP.NET Core Minimal API built on .NET 10.
cp .env.example .env
docker compose up -d db mailpit
dotnet build # restores packages; dotnet ef needs this once
dotnet tool restore
dotnet ef database update --project src/DotnetApiTemplate.Api
dotnet watch --project src/DotnetApiTemplate.Apidotnet watch reloads the API when you save a file.
Then open Swagger UI at http://localhost:5080/swagger, or send the sample requests in
src/DotnetApiTemplate.Api/DotnetApiTemplate.Api.http from your IDE.
Full instructions: docs/development/getting-started.md. All developer guides (configuration, database and migrations, errors, auth, email, CORS, testing, deployment, ...): docs/README.md.
| Path | Contents |
|---|---|
src/DotnetApiTemplate.Api |
The API: features, domain, data, infrastructure, common |
tests/DotnetApiTemplate.UnitTests |
Service tests (EF Core in-memory) |
tests/DotnetApiTemplate.IntegrationTests |
Endpoint tests with WebApplicationFactory |
docker/ |
Dockerfile (production) and Dockerfile.dev (auto reload); docker-compose.yml is at the root |
docs/ |
Developer guides, API conventions, architecture, ADRs; start at docs/README.md |
scripts/ |
Helper scripts (migrations, local setup) |
deploy/supervisor/ |
Supervisor config for running the API and worker on a VM |
.github/workflows/ |
CI build/test and Docker image publishing |
- ADR-0001: Minimal APIs
- ADR-0002: Folder structure
- ADR-0003: Email with Scriban, PreMailer.Net and MailKit
- ADR-0004: Background jobs with Hangfire and PostgreSQL
- API conventions
- Coding guidelines
| Feature | Endpoints | Access |
|---|---|---|
| Auth | POST /api/auth/login |
Public |
| Users | POST /api/users (register) |
Public |
| Users | GET /api/users, GET/PUT /api/users/{id} |
Authenticated |
| Users | DELETE /api/users/{id} |
Admin |
| Products | GET /api/products, GET /api/products/{id} |
Public |
| Products | POST, PUT, DELETE |
Authenticated |
Delete the sample features you don't need, or copy Products to start a new feature.