Skip to content

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.

  • .NET 10 SDK (or later)
  • Docker (for PostgreSQL)
  • A code editor (Rider, VS Code, or Visual Studio)

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.

  1. Your First API — Create a module, wire it into Program.cs, define a domain model, and expose your first endpoint.
  2. Adding Persistence — Add EF Core with PostgreSQL, automatic audit fields, and soft delete.
  3. Adding Authentication — Secure endpoints with JWT Bearer tokens and Keycloak.
  4. Project Templates — Use dotnet new templates to scaffold new Granit projects.
  5. Next Steps — Explore advanced modules: notifications, workflows, blob storage, and more.