How sleepyash13/forge works
Forge is a React and ASP.NET Core authentication system. The principal workflow is browser login or registration through credentialed, CSRF-protected API calls, followed by JWT-cookie authentication and protected profile access. Backend application services validate credentials and profiles, while repositories persist users in SQL Server. The sampled code clearly supports cookie authentication, anti-forgery validation, protected routes, and profile/password management; the README mentions RBAC, but no role-specific implementation was sampled.
Components 17
Frontend Experience
- React Application
frontend/src/App.tsx - Authentication State
frontend/src/contexts/AuthContext.tsx - Protected Routing
frontend/src/routes/AppRoutes.tsx - Auth Client
frontend/src/services/authService.ts - User Client
frontend/src/services/userService.ts
API Security
- Credentialed API Client
frontend/src/services/apiClient.ts - Auth Controller
backend/Forge.Api/Controllers/AuthController.cs - User Controller
backend/Forge.Api/Controllers/UserController.cs - Security Pipeline
backend/Forge.Api/Program.cs - Anti-Forgery Protection
backend/Forge.Api/Program.cs
Application Services
- Authentication Service
backend/Forge.Application/Services/Auth/AuthServices.cs - User Profile Service
backend/Forge.Application/Services/Auth/UserService.cs - JWT Token Service
backend/Forge.Infrastructure/Authentication/JwtTokenService.cs
Identity Persistence
- User Repository
backend/Forge.Infrastructure/Repositories/UserRepository.cs - User Entity
backend/Forge.Domain/Entities/User.cs - Forge SQL Database
backend/Forge.Infrastructure/Persistence/ForgeDbContext.cs
Other components
- Browser User
Connections 22
- Browser User → React Application: uses
- React Application → Authentication State: hosts
- Authentication State → Auth Client: loads identity
- Authentication State → Protected Routing: provides auth
- Auth Client → Credentialed API Client: invokes
- User Client → Credentialed API Client: invokes
- Credentialed API Client → Auth Controller: sends auth requests
- Credentialed API Client → User Controller: sends user requests
- Credentialed API Client → Anti-Forgery Protection: sends CSRF header
- Auth Controller → Anti-Forgery Protection: validates tokens
- Security Pipeline → Anti-Forgery Protection: configures
- Security Pipeline → Auth Controller: maps endpoints
- Security Pipeline → User Controller: maps endpoints
- Auth Controller → Authentication Service: dispatches auth
- Auth Controller → User Profile Service: changes password
- User Controller → User Profile Service: dispatches profiles
- Authentication Service → User Repository: reads and writes
- Authentication Service → JWT Token Service: generates token
- User Profile Service → User Repository: reads and writes
- User Repository → Forge SQL Database: queries users
- User Entity → Forge SQL Database: maps identity
- Security Pipeline → JWT Token Service: configures validation