# marinspedro/fiap architecture

> Architecture diagram of the GitHub repository marinspedro/fiap, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/marinspedro/fiap
- Repository: https://github.com/marinspedro/fiap

## Overview

FIAP Cloud Games is an ASP.NET Core modular-monolith API for user identity and authentication, game catalog management, promotions, and users’ game libraries. A typical acquisition request enters through the Library API, checks the current user and game through module contracts, obtains a promotional quote, and records the acquisition. The README documents separate module boundaries and a shared physical PostgreSQL database. Source excerpts confirm the API host and key controller/service calls; unsampled internals are represented only where the README supports them.

Main entry points: [`src/Api/FiapCloudGames.Api/Program.cs`](https://github.com/marinspedro/fiap/blob/develop/src/Api/FiapCloudGames.Api/Program.cs) (API host), [`src/Modules/Library/FiapCloudGames.Library.Application/Features/UserLibrary/AcquireGame/AcquireGameService.cs`](https://github.com/marinspedro/fiap/blob/develop/src/Modules/Library/FiapCloudGames.Library.Application/Features/UserLibrary/AcquireGame/AcquireGameService.cs) (Game acquisition), [`src/Modules/Identity/FiapCloudGames.Identity.Application/Features/Authentication/Login/LoginService.cs`](https://github.com/marinspedro/fiap/blob/develop/src/Modules/Identity/FiapCloudGames.Identity.Application/Features/Authentication/Login/LoginService.cs) (Identity services), [`src/Modules/Catalog/FiapCloudGames.Catalog.Application/Features/Games/CreateGame/CreateGameService.cs`](https://github.com/marinspedro/fiap/blob/develop/src/Modules/Catalog/FiapCloudGames.Catalog.Application/Features/Games/CreateGame/CreateGameService.cs) (Catalog services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_host["API host<br/>[Program.cs]"]
end

subgraph group_identity["Identity"]
  node_identity_http["Identity endpoints<br/>[UsersController.cs]"]
  node_login["Login endpoint"]
  node_identity_app["Identity services<br/>[LoginService.cs]"]
end

subgraph group_catalog["Catalog"]
  node_catalog_http["Game endpoints<br/>[GamesController.cs]"]
  node_catalog_app["Catalog services"]
end

subgraph group_commerce["Promotions and Library"]
  node_promotion_http["Promotion endpoints"]
  node_promotion_app["Promotion services"]
  node_library_http["Library endpoints"]
  node_acquisition["Game acquisition"]
end

subgraph group_data["Persistence"]
  node_identity_store["Identity persistence"]
  node_catalog_store["Catalog persistence"]
  node_promotion_store["Promotion persistence"]
  node_library_store["Library persistence"]
  node_postgres[("PostgreSQL")]
end

node_caller(("API client"))

node_caller -->|"sends HTTP"| node_host
node_host -->|"hosts endpoints"| node_identity_http
node_host -->|"hosts endpoints"| node_catalog_http
node_host -->|"hosts endpoints"| node_promotion_http
node_host -->|"hosts endpoints"| node_library_http
node_login -->|"calls"| node_identity_app
node_identity_http -->|"calls"| node_identity_app
node_catalog_http -->|"calls"| node_catalog_app
node_promotion_http -->|"calls"| node_promotion_app
node_library_http -->|"calls"| node_acquisition
node_acquisition -->|"checks user"| node_identity_app
node_acquisition -->|"checks game"| node_catalog_app
node_acquisition -->|"gets quote"| node_promotion_app
node_identity_app -.->|"uses persistence"| node_identity_store
node_catalog_app -.->|"uses persistence"| node_catalog_store
node_promotion_app -.->|"uses persistence"| node_promotion_store
node_acquisition -.->|"saves acquisition"| node_library_store
node_identity_store -->|"shares database"| node_postgres
node_catalog_store -->|"shares database"| node_postgres
node_promotion_store -->|"shares database"| node_postgres
node_library_store -->|"shares database"| node_postgres

click node_host "https://github.com/marinspedro/fiap/blob/develop/src/Api/FiapCloudGames.Api/Program.cs"
click node_identity_http "https://github.com/marinspedro/fiap/blob/develop/src/Modules/Identity/FiapCloudGames.Identity.Presentation/Features/Users/UsersController.cs"
click node_login "https://github.com/marinspedro/fiap/blob/develop/src/Modules/Identity/FiapCloudGames.Identity.Presentation/Features/Authentication/Login/AuthenticationController.cs"
click node_identity_app "https://github.com/marinspedro/fiap/blob/develop/src/Modules/Identity/FiapCloudGames.Identity.Application/Features/Authentication/Login/LoginService.cs"
click node_identity_store "https://github.com/marinspedro/fiap/blob/develop/src/Modules/Identity/FiapCloudGames.Identity.Infrastructure/Persistence/IdentityDbContext.cs"
click node_catalog_http "https://github.com/marinspedro/fiap/blob/develop/src/Modules/Catalog/FiapCloudGames.Catalog.Presentation/Features/Games/GamesController.cs"
click node_catalog_app "https://github.com/marinspedro/fiap/blob/develop/src/Modules/Catalog/FiapCloudGames.Catalog.Application/Features/Games/CreateGame/CreateGameService.cs"
click node_catalog_store "https://github.com/marinspedro/fiap/blob/develop/src/Modules/Catalog/FiapCloudGames.Catalog.Infrastructure/Persistence/CatalogDbContext.cs"
click node_promotion_http "https://github.com/marinspedro/fiap/blob/develop/src/Modules/Promotions/FiapCloudGames.Promotions.Presentation/Features/Promotions/PromotionsController.cs"
click node_promotion_app "https://github.com/marinspedro/fiap/blob/develop/src/Modules/Promotions/FiapCloudGames.Promotions.Application/Features/Pricing/GetPromotionalPrice/GetPromotionalPriceService.cs"
click node_promotion_store "https://github.com/marinspedro/fiap/blob/develop/src/Modules/Promotions/FiapCloudGames.Promotions.Infrastructure/Persistence/PromotionsDbContext.cs"
click node_library_http "https://github.com/marinspedro/fiap/blob/develop/src/Modules/Library/FiapCloudGames.Library.Presentation/Features/UserLibrary/LibraryController.cs"
click node_acquisition "https://github.com/marinspedro/fiap/blob/develop/src/Modules/Library/FiapCloudGames.Library.Application/Features/UserLibrary/AcquireGame/AcquireGameService.cs"
click node_library_store "https://github.com/marinspedro/fiap/blob/develop/src/Modules/Library/FiapCloudGames.Library.Infrastructure/Persistence/LibraryDbContext.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_host,node_caller toneBlue
class node_identity_http,node_login,node_identity_app toneAmber
class node_catalog_http,node_catalog_app toneMint
class node_promotion_http,node_promotion_app,node_library_http,node_acquisition toneRose
class node_identity_store,node_catalog_store,node_promotion_store,node_library_store,node_postgres toneIndigo
```

## Components

### HTTP API

- [API host](https://github.com/marinspedro/fiap/blob/develop/src/Api/FiapCloudGames.Api/Program.cs): `src/Api/FiapCloudGames.Api/Program.cs`

### Identity

- [Identity endpoints](https://github.com/marinspedro/fiap/blob/develop/src/Modules/Identity/FiapCloudGames.Identity.Presentation/Features/Users/UsersController.cs): `src/Modules/Identity/FiapCloudGames.Identity.Presentation/Features/Users/UsersController.cs`
- [Login endpoint](https://github.com/marinspedro/fiap/blob/develop/src/Modules/Identity/FiapCloudGames.Identity.Presentation/Features/Authentication/Login/AuthenticationController.cs): `src/Modules/Identity/FiapCloudGames.Identity.Presentation/Features/Authentication/Login/AuthenticationController.cs`
- [Identity services](https://github.com/marinspedro/fiap/blob/develop/src/Modules/Identity/FiapCloudGames.Identity.Application/Features/Authentication/Login/LoginService.cs): `src/Modules/Identity/FiapCloudGames.Identity.Application/Features/Authentication/Login/LoginService.cs`

### Catalog

- [Game endpoints](https://github.com/marinspedro/fiap/blob/develop/src/Modules/Catalog/FiapCloudGames.Catalog.Presentation/Features/Games/GamesController.cs): `src/Modules/Catalog/FiapCloudGames.Catalog.Presentation/Features/Games/GamesController.cs`
- [Catalog services](https://github.com/marinspedro/fiap/blob/develop/src/Modules/Catalog/FiapCloudGames.Catalog.Application/Features/Games/CreateGame/CreateGameService.cs): `src/Modules/Catalog/FiapCloudGames.Catalog.Application/Features/Games/CreateGame/CreateGameService.cs`

### Promotions and Library

- [Promotion endpoints](https://github.com/marinspedro/fiap/blob/develop/src/Modules/Promotions/FiapCloudGames.Promotions.Presentation/Features/Promotions/PromotionsController.cs): `src/Modules/Promotions/FiapCloudGames.Promotions.Presentation/Features/Promotions/PromotionsController.cs`
- [Promotion services](https://github.com/marinspedro/fiap/blob/develop/src/Modules/Promotions/FiapCloudGames.Promotions.Application/Features/Pricing/GetPromotionalPrice/GetPromotionalPriceService.cs): `src/Modules/Promotions/FiapCloudGames.Promotions.Application/Features/Pricing/GetPromotionalPrice/GetPromotionalPriceService.cs`
- [Library endpoints](https://github.com/marinspedro/fiap/blob/develop/src/Modules/Library/FiapCloudGames.Library.Presentation/Features/UserLibrary/LibraryController.cs): `src/Modules/Library/FiapCloudGames.Library.Presentation/Features/UserLibrary/LibraryController.cs`
- [Game acquisition](https://github.com/marinspedro/fiap/blob/develop/src/Modules/Library/FiapCloudGames.Library.Application/Features/UserLibrary/AcquireGame/AcquireGameService.cs): `src/Modules/Library/FiapCloudGames.Library.Application/Features/UserLibrary/AcquireGame/AcquireGameService.cs`

### Persistence

- [Identity persistence](https://github.com/marinspedro/fiap/blob/develop/src/Modules/Identity/FiapCloudGames.Identity.Infrastructure/Persistence/IdentityDbContext.cs): `src/Modules/Identity/FiapCloudGames.Identity.Infrastructure/Persistence/IdentityDbContext.cs`
- [Catalog persistence](https://github.com/marinspedro/fiap/blob/develop/src/Modules/Catalog/FiapCloudGames.Catalog.Infrastructure/Persistence/CatalogDbContext.cs): `src/Modules/Catalog/FiapCloudGames.Catalog.Infrastructure/Persistence/CatalogDbContext.cs`
- [Promotion persistence](https://github.com/marinspedro/fiap/blob/develop/src/Modules/Promotions/FiapCloudGames.Promotions.Infrastructure/Persistence/PromotionsDbContext.cs): `src/Modules/Promotions/FiapCloudGames.Promotions.Infrastructure/Persistence/PromotionsDbContext.cs`
- [Library persistence](https://github.com/marinspedro/fiap/blob/develop/src/Modules/Library/FiapCloudGames.Library.Infrastructure/Persistence/LibraryDbContext.cs): `src/Modules/Library/FiapCloudGames.Library.Infrastructure/Persistence/LibraryDbContext.cs`
- **PostgreSQL**

### Other components

- **API client**

## Connections

- API client → API host: sends HTTP (evidence: `README.md`)
- API host → Identity endpoints: hosts endpoints (evidence: `src/Api/FiapCloudGames.Api/Program.cs`)
- API host → Game endpoints: hosts endpoints (evidence: `src/Api/FiapCloudGames.Api/Program.cs`)
- API host → Promotion endpoints: hosts endpoints (evidence: `src/Api/FiapCloudGames.Api/Program.cs`)
- API host → Library endpoints: hosts endpoints (evidence: `src/Api/FiapCloudGames.Api/Program.cs`)
- Login endpoint → Identity services: calls (evidence: `src/Modules/Identity/FiapCloudGames.Identity.Presentation/Features/Authentication/Login/AuthenticationController.cs`)
- Identity endpoints → Identity services: calls (evidence: `src/Modules/Identity/FiapCloudGames.Identity.Presentation/Features/Users/UsersController.cs`)
- Game endpoints → Catalog services: calls (evidence: `src/Modules/Catalog/FiapCloudGames.Catalog.Presentation/Features/Games/GamesController.cs`)
- Promotion endpoints → Promotion services: calls (evidence: `src/Modules/Promotions/FiapCloudGames.Promotions.Presentation/Features/Promotions/PromotionsController.cs`)
- Library endpoints → Game acquisition: calls (evidence: `src/Modules/Library/FiapCloudGames.Library.Presentation/Features/UserLibrary/LibraryController.cs`)
- Game acquisition → Identity services: checks user (evidence: `src/Modules/Library/FiapCloudGames.Library.Application/Features/UserLibrary/AcquireGame/AcquireGameService.cs`)
- Game acquisition → Catalog services: checks game (evidence: `src/Modules/Library/FiapCloudGames.Library.Application/Features/UserLibrary/AcquireGame/AcquireGameService.cs`)
- Game acquisition → Promotion services: gets quote (evidence: `src/Modules/Library/FiapCloudGames.Library.Application/Features/UserLibrary/AcquireGame/AcquireGameService.cs`)
- Identity services → Identity persistence: uses persistence
- Catalog services → Catalog persistence: uses persistence
- Promotion services → Promotion persistence: uses persistence
- Game acquisition → Library persistence: saves acquisition
- Identity persistence → PostgreSQL: shares database (evidence: `README.md`)
- Catalog persistence → PostgreSQL: shares database (evidence: `README.md`)
- Promotion persistence → PostgreSQL: shares database (evidence: `README.md`)
- Library persistence → PostgreSQL: shares database (evidence: `README.md`)
