Identity Platform Architecture
Layered architecture with CQRS, domain-driven design, and comprehensive security patterns.
System Overview
Next.js 16
React 19
.NET 10 API
ASP.NET Core
Endpoints
MediatR
Domain
SQL Server
EF Core 10
Backend Architecture
Endpoints Layer
RESTful API endpoints organized by feature. Versioned routes (/api/v1.0/) with Swagger documentation.
CQRS Handlers
MediatR command and query handlers. Pipeline behaviors for logging, validation, and exception handling.
Domain Layer
Entity models with business logic. IAuditable and ISoftDeletable interfaces for cross-cutting concerns.
Persistence Layer
Entity Framework Core with ApplicationDbContext. Automatic audit field population and query filters.
Background Services
RefreshTokenCleanupService for expired token removal. WebhookDeliveryService for async event delivery.
Security Pipeline
Dual JWT signing (HS256/RS256) with JWKS endpoint, rate limiting, security headers, and Data Protection API.
Project Structure
# Rdn.Identity solution structure
rdn-identity/
src/
Rdn.Identity.Api/
Program.cs # Application entry point
Server/Startup.cs # Service configuration
Endpoints/ # Feature-based endpoints
appsettings.json # Configuration
Rdn.Identity.Domain/
Entities/ # User, Customer, Role, etc.
Core/Persistence/ # ApplicationDbContext
Events/ # Domain events
Rdn.Identity.Api.Tests/
Integration/ # Full flow tests
Handlers/ # Unit tests
Rdn.Identity.Domain.Tests/
Entities/ # Entity behavior tests
rdn-identity-web/
app/ # Next.js App Router
components/ # React components
lib/ # API client, types
Frontend Architecture
(auth)
Public Routes
- /login - User login
- /register - Registration
(workspace)
Protected
- /dashboard - User home
- /profile - User profile
(admin)
Role-Protected
- /admin/users - User mgmt
- /admin/customers
API Client
lib/api.ts
- JWT injection
- HTTP-only cookies
Technology Stack
Backend
Frontend
Quick Start
Clone Repo
git clone github.com/...Configure
Edit appsettings.jsonRun API
dotnet runRun Web
npm run dev