Prerequisites
Install .NET 10 SDK
Install Aspire Workload
Aspire orchestrates Postgres, Redis, and the API with automatic service discovery and OpenTelemetry.
Install Docker
Aspire uses Docker to run Postgres and Redis containers.
- Windows/Mac: Docker Desktop
- Linux: Docker Engine
Run the API (Aspire)
Fromsrc/README.md:27-33:
Start Everything with Aspire
Aspire brings up:
- Postgres container (port 5432) with automatic connection string injection
- Redis container (port 6379) for distributed caching
- Playground.Api (https://localhost:5285) with migrations applied
- Playground.Blazor (https://localhost:7030) - optional UI
- Aspire Dashboard (http://localhost:15888) for observability
Verify API is Running
Open your browser to https://localhost:5285You should see the Scalar API documentation interface.Or use curl:From
src/Playground/Playground.Api/Program.cs:66-68:Explore the API
Access Swagger/Scalar UI
Navigate to https://localhost:5285/scalar/v1 in your browser.FullStackHero uses Scalar instead of Swagger UI for a modern, interactive API documentation experience.
src/Playground/Playground.Api/appsettings.json:89-103:
Configuration
Available Modules
- Identity Module
- Multitenancy Module
- Auditing Module
Endpoints under
/api/v1/identity:POST /api/v1/identity/token/issue- Generate JWT tokensPOST /api/v1/identity/token/refresh- Refresh expired tokensGET /api/v1/identity/users/search- Search users (requires auth)POST /api/v1/identity/users/register- Register new userGET /api/v1/identity/roles- List rolesGET /api/v1/identity/groups- List user groups
src/Modules/Identity/Modules.Identity/Features/v1/Your First API Call
1. Generate a JWT Token
Fromsrc/BuildingBlocks/Shared/Multitenancy/MultitenancyConstants.cs:9 and :14, the default admin credentials are:
src/Modules/Identity/Modules.Identity/Features/v1/Tokens/TokenGeneration/GenerateTokenEndpoint.cs:20-38:
How token generation works
How token generation works
From
src/Modules/Identity/Modules.Identity/Features/v1/Tokens/TokenGeneration/GenerateTokenCommandHandler.cs:60-92:- Validate credentials against ASP.NET Identity
- Audit login attempt (success or failure)
- Issue JWT with user claims (roles, permissions, tenant)
- Store refresh token (hashed) for later use
- Create user session for session management
- Audit token issuance with fingerprint
- Enqueue integration event for downstream systems
GenerateTokenCommandHandler.Handle().2. Call an Authenticated Endpoint
Use theaccessToken from step 1:
src/Modules/Identity/Modules.Identity/Features/v1/Users/SearchUsers/SearchUsersEndpoint.cs:15-23:
How authorization works
Every protected endpoint uses
.RequirePermission() for fine-grained authorization. This is enforced via a custom authorization filter.3. Check API Health
src/BuildingBlocks/Web/Extensions.cs:63:
Health check registration
Understanding the Configuration
Fromsrc/Playground/Playground.Api/appsettings.json:
- Database
- JWT
- Multi-Tenancy
- OpenTelemetry
Line 66-70
src/Playground/FSH.Playground.AppHost/AppHost.cs:4 and :14-15:Run Without Aspire (API Only)
If you want to run just the API without Aspire orchestration:Access Background Jobs Dashboard
Hangfire dashboard is available at https://localhost:5285/jobs Fromsrc/Playground/Playground.Api/appsettings.json:77-81:
Next Steps
Add Your First Feature
Learn the vertical slice pattern: Command → Handler → Validator → Endpoint
Understand Modules
Explore Identity, Multitenancy, and Auditing modules
Configure Multi-Tenancy
Set up tenant isolation and provisioning
Deploy to Production
Deploy to Azure, AWS, or Kubernetes
Common Issues
Port 5432 or 6379 already in use
Port 5432 or 6379 already in use
Stop conflicting containers:Or change ports in
AppHost.cs:Certificate validation errors
Certificate validation errors
Use
-k flag with curl or set DOTNET_SYSTEM_NET_HTTP_SOCKETSHTTPHANDLER_ALLOWALL=1For production, configure proper SSL certificates:Migrations not applied
Migrations not applied
Manually apply migrations:Or set
MultitenancyOptions:RunTenantMigrationsOnStartup: true in appsettings.401 Unauthorized on protected endpoints
401 Unauthorized on protected endpoints
What Just Happened?
Fromsrc/Playground/Playground.Api/Program.cs:30-56, when you ran the API:
Registered Mediator
All command/query handlers from Identity, Multitenancy, and Auditing modules
Line 30-40
Registered Hero Platform
Caching, Mailing, Jobs, OpenTelemetry, Health Checks, Authentication, Authorization, Rate LimitingFrom
Line 49-54
src/BuildingBlocks/Web/Extensions.cs:29-87, this wires 11 building blocks.Registered Modules
Identity, Multitenancy, and Auditing modules with their DbContexts and endpoints
Line 42-56
Ready to Build?
Learn how to add your first feature using the vertical slice pattern
