Dotnet 8 JWT API Boilerplate
Barebones .NET 8 API with JWT auth, MySQL, Swagger, and Serilog
open source.netc#
Overview
A simple barebones API boilerplate with JWT authentication and MySQL database setup. No framework lock-ins, zero abstractions, full control over all the code — only dotnet.
Features
- MySQL Database with Entity Framework Core
- JWT Authentication with refresh tokens
- Role-based Authorization (Admin and User roles)
- Rate Limiting for API protection
- Anti-spam Registration protection
- Swagger UI for API documentation
- Serilog for structured logging
Getting Started
Initial Setup
bash
dotnet ef database updateRun the Project
bash
dotnet runMigrations
bash
# Create new migration
dotnet ef migrations add MigrationName
# Apply migrations
dotnet ef database update
# Remove last migration
dotnet ef migrations removeTech Stack
- .NET 8
- Entity Framework Core
- MySQL
- JWT Bearer Authentication
- Swagger/OpenAPI
- Serilog
License
MIT License