GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — dotnet-api-template/templates/DotnetApiTemplate at main · code4mk/dotnet-api-template

Expand file tree

/

DotnetApiTemplate

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

DotnetApiTemplate

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
.config
.config
 
 
.github/workflows
.github/workflows
 
 
.template.config
.template.config
 
 
deploy/supervisor
deploy/supervisor
 
 
docker
docker
 
 
docs
docs
 
 
scripts
scripts
 
 
src/DotnetApiTemplate.Api
src/DotnetApiTemplate.Api
 
 
tests
tests
 
 
.dockerignore
.dockerignore
 
 
.editorconfig
.editorconfig
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
Directory.Build.props
Directory.Build.props
 
 
Directory.Packages.props
Directory.Packages.props
 
 
DotnetApiTemplate.sln
DotnetApiTemplate.sln
 
 
README.md
README.md
 
 
docker-compose.yml
docker-compose.yml
 
 

README.md

Outline

DotnetApiTemplate

ASP.NET Core Minimal API built on .NET 10.

Quick start

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

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

Solution layout

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

Key decisions

  • 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

Sample features

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.

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.