# mchomem/fiap architecture

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

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

## Overview

FIAP Cloud Games is an ASP.NET Core modular-monolith API for user identity/authentication, game catalog, promotions, and acquired-game libraries. The principal purchase-like workflow is authenticated library acquisition: the library service checks identity and catalog, obtains a promotional price, then saves the acquired item; there is no cart or payment stage. Each module separates presentation, application, domain, contracts, and infrastructure, while modules share a physical PostgreSQL database. Arrows are limited to controller/service calls shown in excerpts, acquisition calls shown in its excerpt, and architecture explicitly documented in the README; other internals are represented without inferred call chains.

Main entry points: [`src/Api/FiapCloudGames.Api/Program.cs`](https://github.com/mchomem/fiap/blob/develop/src/Api/FiapCloudGames.Api/Program.cs) (API host), [`src/Modules/Library/FiapCloudGames.Library.Application/Features/UserLibrary`](https://github.com/mchomem/fiap/tree/develop/src/Modules/Library/FiapCloudGames.Library.Application/Features/UserLibrary) (Acquisition and queries), [`src/Modules/Identity/FiapCloudGames.Identity.Application/Features`](https://github.com/mchomem/fiap/tree/develop/src/Modules/Identity/FiapCloudGames.Identity.Application/Features) (Identity services), [`src/Modules/Identity/FiapCloudGames.Identity.Presentation/Features/Users/UsersController.cs`](https://github.com/mchomem/fiap/blob/develop/src/Modules/Identity/FiapCloudGames.Identity.Presentation/Features/Users/UsersController.cs) (Identity endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

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

subgraph group_identity["Identity"]
  node_ident_http["Identity endpoints<br/>[UsersController.cs]"]
  node_login_http["Login endpoint"]
  node_identity_app["Identity services<br/>[Features]"]
  node_identity_domain["Users and roles<br/>[User.cs]"]
  node_identity_store[("Identity persistence")]
  node_identity_contract["Identity contract<br/>[IIdentityModule.cs]"]
end

subgraph group_catalog["Catalog"]
  node_catalog_http["Game endpoints<br/>[GamesController.cs]"]
  node_catalog_app["Catalog services<br/>[Games]"]
  node_catalog_domain["Game model<br/>[Game.cs]"]
  node_catalog_store[("Catalog persistence")]
  node_catalog_contract["Catalog contract<br/>[ICatalogModule.cs]"]
end

subgraph group_promotions["Promotions"]
  node_promo_http["Promotion endpoints"]
  node_promo_app["Promotion and pricing<br/>[Features]"]
  node_promo_domain["Promotion model<br/>[Promotion.cs]"]
  node_promo_store[("Promotion persistence")]
  node_promo_contract["Pricing contract"]
end

subgraph group_library["Library"]
  node_library_http["Library endpoints"]
  node_library_app["Acquisition and queries<br/>[UserLibrary]"]
  node_library_domain["Owned games<br/>[GameLibrary.cs]"]
  node_library_store[("Library persistence")]
end

node_client(("API client"))
node_shared_db[("PostgreSQL")]

node_client -->|"sends HTTP"| node_host
node_host -->|"hosts routes"| node_ident_http
node_host -->|"hosts routes"| node_catalog_http
node_host -->|"hosts routes"| node_promo_http
node_host -->|"hosts routes"| node_library_http
node_ident_http -->|"invokes services"| node_identity_app
node_login_http -->|"invokes login"| node_identity_app
node_catalog_http -->|"invokes services"| node_catalog_app
node_promo_http -->|"invokes services"| node_promo_app
node_library_http -->|"invokes services"| node_library_app
node_library_app -->|"checks user"| node_identity_contract
node_library_app -->|"checks game"| node_catalog_contract
node_library_app -->|"requests quote"| node_promo_contract
node_catalog_contract -->|"module contract"| node_catalog_app
node_promo_contract -->|"module contract"| node_promo_app
node_identity_contract -->|"module contract"| node_identity_app
node_host -->|"shares database"| node_shared_db
node_identity_store -->|"uses PostgreSQL"| node_shared_db
node_catalog_store -->|"uses PostgreSQL"| node_shared_db
node_promo_store -->|"uses PostgreSQL"| node_shared_db
node_library_store -->|"uses PostgreSQL"| node_shared_db

click node_host "https://github.com/mchomem/fiap/blob/develop/src/Api/FiapCloudGames.Api/Program.cs"
click node_ident_http "https://github.com/mchomem/fiap/blob/develop/src/Modules/Identity/FiapCloudGames.Identity.Presentation/Features/Users/UsersController.cs"
click node_login_http "https://github.com/mchomem/fiap/blob/develop/src/Modules/Identity/FiapCloudGames.Identity.Presentation/Features/Authentication/Login/AuthenticationController.cs"
click node_identity_app "https://github.com/mchomem/fiap/tree/develop/src/Modules/Identity/FiapCloudGames.Identity.Application/Features"
click node_identity_domain "https://github.com/mchomem/fiap/blob/develop/src/Modules/Identity/FiapCloudGames.Identity.Domain/Entities/User.cs"
click node_identity_store "https://github.com/mchomem/fiap/blob/develop/src/Modules/Identity/FiapCloudGames.Identity.Infrastructure/Persistence/IdentityDbContext.cs"
click node_identity_contract "https://github.com/mchomem/fiap/blob/develop/src/Modules/Identity/FiapCloudGames.Identity.Contracts/IIdentityModule.cs"
click node_catalog_http "https://github.com/mchomem/fiap/blob/develop/src/Modules/Catalog/FiapCloudGames.Catalog.Presentation/Features/Games/GamesController.cs"
click node_catalog_app "https://github.com/mchomem/fiap/tree/develop/src/Modules/Catalog/FiapCloudGames.Catalog.Application/Features/Games"
click node_catalog_domain "https://github.com/mchomem/fiap/blob/develop/src/Modules/Catalog/FiapCloudGames.Catalog.Domain/Entities/Game.cs"
click node_catalog_store "https://github.com/mchomem/fiap/blob/develop/src/Modules/Catalog/FiapCloudGames.Catalog.Infrastructure/Persistence/CatalogDbContext.cs"
click node_catalog_contract "https://github.com/mchomem/fiap/blob/develop/src/Modules/Catalog/FiapCloudGames.Catalog.Contracts/ICatalogModule.cs"
click node_promo_http "https://github.com/mchomem/fiap/blob/develop/src/Modules/Promotions/FiapCloudGames.Promotions.Presentation/Features/Promotions/PromotionsController.cs"
click node_promo_app "https://github.com/mchomem/fiap/tree/develop/src/Modules/Promotions/FiapCloudGames.Promotions.Application/Features"
click node_promo_domain "https://github.com/mchomem/fiap/blob/develop/src/Modules/Promotions/FiapCloudGames.Promotions.Domain/Entities/Promotion.cs"
click node_promo_store "https://github.com/mchomem/fiap/blob/develop/src/Modules/Promotions/FiapCloudGames.Promotions.Infrastructure/Persistence/PromotionsDbContext.cs"
click node_promo_contract "https://github.com/mchomem/fiap/blob/develop/src/Modules/Promotions/FiapCloudGames.Promotions.Contracts/IPromotionsModule.cs"
click node_library_http "https://github.com/mchomem/fiap/blob/develop/src/Modules/Library/FiapCloudGames.Library.Presentation/Features/UserLibrary/LibraryController.cs"
click node_library_app "https://github.com/mchomem/fiap/tree/develop/src/Modules/Library/FiapCloudGames.Library.Application/Features/UserLibrary"
click node_library_domain "https://github.com/mchomem/fiap/blob/develop/src/Modules/Library/FiapCloudGames.Library.Domain/Entities/GameLibrary.cs"
click node_library_store "https://github.com/mchomem/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_client toneBlue
class node_ident_http,node_login_http,node_identity_app,node_identity_domain,node_identity_store,node_identity_contract,node_shared_db toneAmber
class node_catalog_http,node_catalog_app,node_catalog_domain,node_catalog_store,node_catalog_contract toneMint
class node_promo_http,node_promo_app,node_promo_domain,node_promo_store,node_promo_contract toneRose
class node_library_http,node_library_app,node_library_domain,node_library_store toneIndigo
```

## Components

### HTTP API

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

### Identity

- [Identity endpoints](https://github.com/mchomem/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/mchomem/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/mchomem/fiap/tree/develop/src/Modules/Identity/FiapCloudGames.Identity.Application/Features): `src/Modules/Identity/FiapCloudGames.Identity.Application/Features`
- [Users and roles](https://github.com/mchomem/fiap/blob/develop/src/Modules/Identity/FiapCloudGames.Identity.Domain/Entities/User.cs): `src/Modules/Identity/FiapCloudGames.Identity.Domain/Entities/User.cs`
- [Identity persistence](https://github.com/mchomem/fiap/blob/develop/src/Modules/Identity/FiapCloudGames.Identity.Infrastructure/Persistence/IdentityDbContext.cs): `src/Modules/Identity/FiapCloudGames.Identity.Infrastructure/Persistence/IdentityDbContext.cs`
- [Identity contract](https://github.com/mchomem/fiap/blob/develop/src/Modules/Identity/FiapCloudGames.Identity.Contracts/IIdentityModule.cs): `src/Modules/Identity/FiapCloudGames.Identity.Contracts/IIdentityModule.cs`

### Catalog

- [Game endpoints](https://github.com/mchomem/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/mchomem/fiap/tree/develop/src/Modules/Catalog/FiapCloudGames.Catalog.Application/Features/Games): `src/Modules/Catalog/FiapCloudGames.Catalog.Application/Features/Games`
- [Game model](https://github.com/mchomem/fiap/blob/develop/src/Modules/Catalog/FiapCloudGames.Catalog.Domain/Entities/Game.cs): `src/Modules/Catalog/FiapCloudGames.Catalog.Domain/Entities/Game.cs`
- [Catalog persistence](https://github.com/mchomem/fiap/blob/develop/src/Modules/Catalog/FiapCloudGames.Catalog.Infrastructure/Persistence/CatalogDbContext.cs): `src/Modules/Catalog/FiapCloudGames.Catalog.Infrastructure/Persistence/CatalogDbContext.cs`
- [Catalog contract](https://github.com/mchomem/fiap/blob/develop/src/Modules/Catalog/FiapCloudGames.Catalog.Contracts/ICatalogModule.cs): `src/Modules/Catalog/FiapCloudGames.Catalog.Contracts/ICatalogModule.cs`

### Promotions

- [Promotion endpoints](https://github.com/mchomem/fiap/blob/develop/src/Modules/Promotions/FiapCloudGames.Promotions.Presentation/Features/Promotions/PromotionsController.cs): `src/Modules/Promotions/FiapCloudGames.Promotions.Presentation/Features/Promotions/PromotionsController.cs`
- [Promotion and pricing](https://github.com/mchomem/fiap/tree/develop/src/Modules/Promotions/FiapCloudGames.Promotions.Application/Features): `src/Modules/Promotions/FiapCloudGames.Promotions.Application/Features`
- [Promotion model](https://github.com/mchomem/fiap/blob/develop/src/Modules/Promotions/FiapCloudGames.Promotions.Domain/Entities/Promotion.cs): `src/Modules/Promotions/FiapCloudGames.Promotions.Domain/Entities/Promotion.cs`
- [Promotion persistence](https://github.com/mchomem/fiap/blob/develop/src/Modules/Promotions/FiapCloudGames.Promotions.Infrastructure/Persistence/PromotionsDbContext.cs): `src/Modules/Promotions/FiapCloudGames.Promotions.Infrastructure/Persistence/PromotionsDbContext.cs`
- [Pricing contract](https://github.com/mchomem/fiap/blob/develop/src/Modules/Promotions/FiapCloudGames.Promotions.Contracts/IPromotionsModule.cs): `src/Modules/Promotions/FiapCloudGames.Promotions.Contracts/IPromotionsModule.cs`

### Library

- [Library endpoints](https://github.com/mchomem/fiap/blob/develop/src/Modules/Library/FiapCloudGames.Library.Presentation/Features/UserLibrary/LibraryController.cs): `src/Modules/Library/FiapCloudGames.Library.Presentation/Features/UserLibrary/LibraryController.cs`
- [Acquisition and queries](https://github.com/mchomem/fiap/tree/develop/src/Modules/Library/FiapCloudGames.Library.Application/Features/UserLibrary): `src/Modules/Library/FiapCloudGames.Library.Application/Features/UserLibrary`
- [Owned games](https://github.com/mchomem/fiap/blob/develop/src/Modules/Library/FiapCloudGames.Library.Domain/Entities/GameLibrary.cs): `src/Modules/Library/FiapCloudGames.Library.Domain/Entities/GameLibrary.cs`
- [Library persistence](https://github.com/mchomem/fiap/blob/develop/src/Modules/Library/FiapCloudGames.Library.Infrastructure/Persistence/LibraryDbContext.cs): `src/Modules/Library/FiapCloudGames.Library.Infrastructure/Persistence/LibraryDbContext.cs`

### Other components

- **API client**
- **PostgreSQL**

## Connections

- API client → API host: sends HTTP (evidence: `README.md`)
- API host → Identity endpoints: hosts routes (evidence: `src/Api/FiapCloudGames.Api/Program.cs`)
- API host → Game endpoints: hosts routes (evidence: `src/Api/FiapCloudGames.Api/Program.cs`)
- API host → Promotion endpoints: hosts routes (evidence: `src/Api/FiapCloudGames.Api/Program.cs`)
- API host → Library endpoints: hosts routes (evidence: `src/Api/FiapCloudGames.Api/Program.cs`)
- Identity endpoints → Identity services: invokes services (evidence: `src/Modules/Identity/FiapCloudGames.Identity.Presentation/Features/Users/UsersController.cs`)
- Login endpoint → Identity services: invokes login (evidence: `src/Modules/Identity/FiapCloudGames.Identity.Presentation/Features/Authentication/Login/AuthenticationController.cs`)
- Game endpoints → Catalog services: invokes services (evidence: `src/Modules/Catalog/FiapCloudGames.Catalog.Presentation/Features/Games/GamesController.cs`)
- Promotion endpoints → Promotion and pricing: invokes services (evidence: `src/Modules/Promotions/FiapCloudGames.Promotions.Presentation/Features/Promotions/PromotionsController.cs`)
- Library endpoints → Acquisition and queries: invokes services (evidence: `src/Modules/Library/FiapCloudGames.Library.Presentation/Features/UserLibrary/LibraryController.cs`)
- Acquisition and queries → Identity contract: checks user (evidence: `src/Modules/Library/FiapCloudGames.Library.Application/Features/UserLibrary/AcquireGame/AcquireGameService.cs`)
- Acquisition and queries → Catalog contract: checks game (evidence: `src/Modules/Library/FiapCloudGames.Library.Application/Features/UserLibrary/AcquireGame/AcquireGameService.cs`)
- Acquisition and queries → Pricing contract: requests quote (evidence: `src/Modules/Library/FiapCloudGames.Library.Application/Features/UserLibrary/AcquireGame/AcquireGameService.cs`)
- Catalog contract → Catalog services: module contract (evidence: `README.md`)
- Pricing contract → Promotion and pricing: module contract (evidence: `README.md`)
- Identity contract → Identity services: module contract (evidence: `README.md`)
- API host → PostgreSQL: shares database (evidence: `README.md`)
- Identity persistence → PostgreSQL: uses PostgreSQL
- Catalog persistence → PostgreSQL: uses PostgreSQL
- Promotion persistence → PostgreSQL: uses PostgreSQL
- Library persistence → PostgreSQL: uses PostgreSQL
