Getting Started
This tutorial walks you through building a complete REST API with Granit — from an empty project to a production-ready service with persistence, authentication, and observability.
Prerequisites
Section titled “Prerequisites”- .NET 10 SDK (or later)
- Docker (for PostgreSQL)
- A code editor (Rider, VS Code, or Visual Studio)
What you will build
Section titled “What you will build”A Task Management API with:
- CRUD endpoints using Minimal API
- EF Core persistence with automatic audit trails
- JWT authentication via Keycloak
- OpenTelemetry observability (logs, traces, metrics)
Each step builds on the previous one. By the end, you will have a production-ready service that follows Granit conventions.
- Your First API — Create a module, wire it into
Program.cs, define a domain model, and expose your first endpoint. - Adding Persistence — Add EF Core with PostgreSQL, automatic audit fields, and soft delete.
- Adding Authentication — Secure endpoints with JWT Bearer tokens and Keycloak.
- Project Templates — Use
dotnet newtemplates to scaffold new Granit projects. - Next Steps — Explore advanced modules: notifications, workflows, blob storage, and more.