How analytica-manulife/apigateway works
Project type and purpose
• This is a .NET 9.0 Web API project named “APIGateway.”
• It acts as a centralized HTTP entry point (an API Gateway) that handles authentication/authorization, session management, and request‐proxying for downstream services (Budget, News, StockMarket).
• It also persists user/KYC data in a relational database via Entity Framework Core (AppDbContext).
File structure
• Program.cs & appsettings*.json
– Bootstraps ASP.NET Core middleware, routing, DI containers, EF DbContext, authentication schemes.
• Controller/
– AuthController: user login, registration, token issuance.
– BudgetProxyController, NewsProxyController, StockMarketProxyController: forwards/aggregates requests to external microservices.
• Data/AppDbContext.cs
– EF Core DbContext mapping Models (Account, KycModel, etc.) to database tables.
• Model/
– DTOs and domain entities for authentication and KYC workflows.
• Repositories/AuthRepository.cs
– Data access abstraction over AppDbContext for user credentials.
• Services/
– AuthService: business logic for sign-up, sign-in, token generation.
– SessionService & RequireLoginAttribute: session validation, attribute-based authorization.
• .github/workflows/*.yml
– CI/CD pipelines for building, testing, deploying the API Gateway across multiple environments (Analytica, Manulife, etc.).
Key insights from the README
• The README only contains the title (“APIGateway”).
• All architectural intent must be derived from code structure and file names.