How mohammdpc/paylense-backend works
PayLense is an authentication backend. Its main workflow accepts auth requests, then handles signup and contact verification, sign-in with optional two-factor checks, token refresh, and logout. The auth service coordinates identity, persisted account/device/token state, OTP generation and delivery, and card handling. The README gives no further product detail; links below are limited to relationships visible in the excerpts or SOURCE INDEX, so unsampled behavior is not expanded.
Main entry points: AuthService.cs Auth orchestration · DependencyInjection.cs Service registration · AppDbContext.cs Auth data context · OtpService.cs OTP lifecycle
Components 19
API entry
- Auth endpoints
src/PayLense.API/Controllers/AuthController.cs - Exception handling
src/PayLense.API/Middleware/ExceptionMiddleware.cs - API startup
src/PayLense.API/Program.cs
Application contracts
- Auth contract
src/PayLense.Application/Interfaces/IAuthService.cs - Auth requests
src/PayLense.Application/DTOs/Auth/AuthDtos.cs - JWT settings
src/PayLense.Application/Common/JwtSettings.cs - Card validation
src/PayLense.Application/Common/CardValidator.cs
Authentication services
- Auth orchestration
src/PayLense.Infrastructure/Services/AuthService.cs - OTP lifecycle
src/PayLense.Infrastructure/Services/OtpService.cs - OTP delivery
src/PayLense.Infrastructure/Services/ConsoleOtpSender.cs - Token operations
src/PayLense.Infrastructure/Services/TokenService.cs - Card encryption
src/PayLense.Infrastructure/Services/CardEncryptor.cs
Identity and persistence
- Identity user
src/PayLense.Infrastructure/Identity/ApplicationUser.cs - Auth data context
src/PayLense.Infrastructure/Persistence/AppDbContext.cs - Service registration
src/PayLense.Infrastructure/DependencyInjection.cs
Domain models
- Account entities
src/PayLense.Domain/Entities - OTP purposes
src/PayLense.Domain/Enums/OtpPurpose.cs - Application errors
src/PayLense.Domain/Exceptions/AppException.cs
Other components
- API client
Connections 23
- API client → Auth endpoints: sends requests
src/PayLense.API/Controllers/AuthController.cs - Auth endpoints → Auth contract: invokes
src/PayLense.API/Controllers/AuthController.cs - Service registration → Auth orchestration: registers
src/PayLense.Infrastructure/DependencyInjection.cs - Auth orchestration → Auth contract: implements
src/PayLense.Infrastructure/Services/AuthService.cs - Auth orchestration → Auth requests: accepts and returns
src/PayLense.Infrastructure/Services/AuthService.cs - Auth orchestration → Identity user: manages users
src/PayLense.Infrastructure/Services/AuthService.cs - Auth orchestration → Auth data context: reads and writes
src/PayLense.Infrastructure/Services/AuthService.cs - Auth orchestration → OTP lifecycle: generates and verifies
src/PayLense.Infrastructure/Services/AuthService.cs - Auth orchestration → OTP delivery: sends codes
src/PayLense.Infrastructure/Services/AuthService.cs - Auth orchestration → Token operations: creates and hashes
src/PayLense.Infrastructure/Services/AuthService.cs - Auth orchestration → Card encryption: encrypts cards
src/PayLense.Infrastructure/Services/AuthService.cs - Auth orchestration → Card validation: validates cards
src/PayLense.Infrastructure/Services/AuthService.cs - Auth orchestration → JWT settings: uses settings
src/PayLense.Infrastructure/Services/AuthService.cs - OTP lifecycle → Auth data context: reads and writes
src/PayLense.Infrastructure/Services/OtpService.cs - Auth data context → Identity user: maps identity
src/PayLense.Infrastructure/Persistence/AppDbContext.cs - Auth data context → Account entities: maps entities
src/PayLense.Infrastructure/Persistence/AppDbContext.cs - Exception handling → Application errors: handles errors
src/PayLense.API/Middleware/ExceptionMiddleware.cs - API startup → Exception handling: configures
src/PayLense.API/Program.cs - Service registration → Auth data context: configures
src/PayLense.Infrastructure/DependencyInjection.cs - Service registration → Token operations: registers
src/PayLense.Infrastructure/DependencyInjection.cs - Service registration → OTP lifecycle: registers
src/PayLense.Infrastructure/DependencyInjection.cs - Service registration → Card encryption: registers
src/PayLense.Infrastructure/DependencyInjection.cs - Service registration → OTP delivery: registers
src/PayLense.Infrastructure/DependencyInjection.cs