Skip to content

jonathanfavorite/Station5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

Station5

This repo is a .NET 8 Web API template. The primary way to use it is to run the PowerShell generator that copies the template into your own folder and replaces APITemplate with your project name.

Quick start (recommended)

  1. Install the .NET 8 SDK.
  2. Install PowerShell 7 (for macOS/Linux use pwsh).
  3. Run the generator from the repo root:
pwsh -File ./New-ApiProjectFromTemplate.ps1

Follow the prompts for project name and destination path. The script will not create a subfolder; it copies directly into the destination folder.


A clean .NET 8 Web API template using MediatR, FluentValidation, and a Dapper-based infrastructure layer. The structure emphasizes a thin controller layer, a request/handler service layer, and a repository/DTO infrastructure layer. Model new endpoints after the existing Health flow.

Getting started (extremely simple)

  1. Install the .NET 8 SDK.
  2. Run the API:
dotnet run --project APITemplate.Application.API

The default health endpoint is GET /api/health.

Solution layout

  • APITemplate.Application.API - Web API entrypoint (controllers, middleware).
  • APITemplate.Application.CLI - CLI entrypoint.
  • APITemplate.Core.Application - composition root (wires settings, services, infrastructure).
  • APITemplate.Services - MediatR requests/handlers/response models.
  • APITemplate.Infrastructure - repositories and DTOs (Dapper/Dapper.Contrib).
  • APITemplate.Application.Settings - configuration models and appsettings.
  • APITemplate.Core.Services / APITemplate.Core.Infrastructure - shared core utilities.
  • APITemplate.Domain - domain entities (minimal by default).
image

Key packages

  • .NET 8
  • MediatR (request/handler pattern)
  • FluentValidation (input validation)
  • Dapper and Dapper.Contrib (data access)
  • Swashbuckle (OpenAPI/Swagger)

Pattern overview

Controller -> MediatR Request -> RequestHandler -> Repository -> DTOs

Refer to AGENT.md for the precise folder structure and examples when adding new controllers, endpoints, services, or repositories.

About

.NET 8 Web API template with MediatR + Dapper, a generator script, and AGENT.md so future AI agents can add controllers, services, repositories, and endpoints consistently.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors