How guifeh/discagram-api works
Purpose and Entry Point
This is a small .NET application centered on user authentication and password handling. The runtime starts in Program.cs, which is responsible for application bootstrapping, dependency registration, configuration loading, and HTTP pipeline setup.
Domain Model
The core business entity is the user model at Domain/Entities/User.cs. Domain-level password abstraction is separated through Domain/Interfaces/IPasswordHash.cs, allowing authentication code to depend on a contract rather than a concrete hashing implementation.
Authentication Service Boundary
Services/Auth/AuthService.cs contains the primary authentication use-case flow: accepting credentials or user data, coordinating password verification/hash generation, and interacting with persistence. It is the application-service boundary between HTTP-facing startup code and domain/infrastructure concerns.
Password Security
Security/Criptography.cs provides the concrete cryptographic/password-hashing implementation behind IPasswordHash. Authentication should consume the interface from Domain/Interfaces/IPasswordHash.cs; this isolates security algorithm choices from the service and domain layers.
Persistence
Entity Framework Core persistence is represented by Infraestructure/Context/AppDbContext.cs. This context maps Domain/Entities/User.cs to the configured database and is the principal infrastructure boundary for durable user/account state.
Runtime Configuration and Delivery
Application settings are supplied through appsettings.json and environment-specific overrides in appsettings.Development.json. Container-orchestrated deployment infrastructure is defined under k8s/, including database/cluster configuration in k8s/cluster-cnpg.yaml, ingress/proxy deployment in k8s/nginx-deployment.yaml, and environment Helm-style values in k8s/values-dev.yaml and k8s/values-prd.yaml.
Primary Flow
Startup in Program.cs composes the dependency graph: database context, authentication service, and password hashing implementation. Requests enter the application pipeline, invoke Services/Auth/AuthService.cs, validate or create Domain/Entities/User.cs state via the password abstraction, then read/write through Infraestructure/Context/AppDbContext.cs. Kubernetes manifests provide the operational boundary around the running service, reverse proxy, resource quotas, and CloudNativePG-oriented database setup.
Main entry points: Program.cs Application bootstrap · AuthService.cs Authentication service · AppDbContext.cs Application DB context · nginx-deployment.yaml Ingress proxy
Components 12
Application runtime
- Application bootstrap · Composes services, configuration, and HTTP pipeline.
Program.cs - Application settings
appsettings.json - Development overrides
appsettings.Development.json
Domain & authentication
- Authentication service · Coordinates credential handling and user persistence.
Services/Auth/AuthService.cs - User
Domain/Entities/User.cs - Password hash contract
Domain/Interfaces/IPasswordHash.cs
Infrastructure
- Password cryptography
Security/Criptography.cs - Application DB context · Maps users to durable account state.
Infraestructure/Context/AppDbContext.cs
Kubernetes delivery
- CloudNativePG database
k8s/cluster-cnpg.yaml - Ingress proxy
k8s/nginx-deployment.yaml - Development values
k8s/values-dev.yaml - Production values
k8s/values-prd.yaml
Connections 16
- Application settings → Application bootstrap: loads
- Development overrides → Application bootstrap: overrides
- Application bootstrap → Authentication service: registers and invokes
- Application bootstrap → Application DB context: registers
- Application bootstrap → Password cryptography: registers
- Authentication service → User: validates or creates
- Authentication service → Password hash contract: hashes and verifies through
- Password cryptography → Password hash contract: implements
- Authentication service → Application DB context: reads and writes
- Application DB context → User: maps
- Ingress proxy → Application bootstrap: routes requests to
- Application DB context → CloudNativePG database: connects to
- Development values → Ingress proxy: configures development
- Production values → Ingress proxy: configures production
- Development values → CloudNativePG database: configures development
- Production values → CloudNativePG database: configures production