# digidestinedcode/20262m-prj5-cinema-ingresso-backend architecture

> Architecture diagram of the GitHub repository digidestinedcode/20262m-prj5-cinema-ingresso-backend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend
- Repository: https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend

## Overview

This is a NestJS cinema-ticket microservice, documented as handling ticket sales and seat allocation. The visible seat workflow is HTTP requests to seat routes, then service operations through Prisma to the database. Reservation, seat-reservation, pricing, and ticket modules are registered, but their sampled controllers/services reveal little behavior; they are retained as product capabilities without inferred processing links. Prisma-generated client and model types are grouped as an internal data-access layer. Several edges are limited to explicit module registration or imports because implementation excerpts are sparse.

Main entry points: [`src/app.module.ts`](https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/app.module.ts) (Feature registration), [`src/assento/assento.controller.ts`](https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/assento/assento.controller.ts) (Seat routes), [`src/prisma/prisma.service.ts`](https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/prisma/prisma.service.ts) (Prisma connection), [`src/assento/assento.service.ts`](https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/assento/assento.service.ts) (Seat operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and runtime"]
  node_app["Nest application<br/>[main.ts]"]
  node_appmodule["Feature registration<br/>[app.module.ts]"]
  node_health["Health check"]
end

subgraph group_seats["Seat allocation"]
  node_seatapi["Seat routes"]
  node_seatservice["Seat operations<br/>[assento.service.ts]"]
  node_createdto["Create seat input"]
  node_updatedto["Update seat input"]
  node_seatreservation["Seat reservations"]
end

subgraph group_sales["Ticketing domain"]
  node_reservation["Reservations"]
  node_pricing["Pricing"]
  node_tickets["Tickets"]
end

subgraph group_persistence["Persistence"]
  node_prismaservice["Prisma connection<br/>[prisma.service.ts]"]
  node_prismaclient["Generated Prisma client<br/>[client.ts]"]
  node_prismatypes["Generated model types"]
end

node_client(("HTTP client"))
node_database[("MariaDB database")]

node_client -->|"sends requests"| node_seatapi
node_seatapi -->|"delegates operations"| node_seatservice
node_seatapi -->|"accepts input"| node_createdto
node_seatapi -->|"accepts input"| node_updatedto
node_seatservice -->|"queries data"| node_prismaservice
node_prismaservice -->|"extends client"| node_prismaclient
node_prismaclient -->|"uses model types"| node_prismatypes
node_prismaservice -->|"connects to"| node_database
node_app -->|"loads module"| node_appmodule
node_appmodule -->|"registers feature"| node_health
node_appmodule -->|"registers feature"| node_seatapi
node_appmodule -->|"registers feature"| node_seatreservation
node_appmodule -->|"registers feature"| node_reservation
node_appmodule -->|"registers feature"| node_pricing
node_appmodule -->|"registers feature"| node_tickets

click node_app "https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/main.ts"
click node_appmodule "https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/app.module.ts"
click node_health "https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/health/health.controller.ts"
click node_seatapi "https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/assento/assento.controller.ts"
click node_seatservice "https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/assento/assento.service.ts"
click node_createdto "https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/assento/dto/create-assento.dto.ts"
click node_updatedto "https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/assento/dto/update-assento.dto.ts"
click node_seatreservation "https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/tree/main/src/assento_reserva"
click node_reservation "https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/tree/main/src/reserva"
click node_pricing "https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/tree/main/src/preco"
click node_tickets "https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/tree/main/src/ticket"
click node_prismaservice "https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/prisma/prisma.service.ts"
click node_prismaclient "https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/prisma/prisma/client.ts"
click node_prismatypes "https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/tree/main/src/prisma/prisma"

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_app,node_appmodule,node_health,node_client toneBlue
class node_seatapi,node_seatservice,node_createdto,node_updatedto,node_seatreservation,node_database toneAmber
class node_reservation,node_pricing,node_tickets toneMint
class node_prismaservice,node_prismaclient,node_prismatypes toneRose
```

## Components

### API and runtime

- [Nest application](https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/main.ts): `src/main.ts`
- [Feature registration](https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/app.module.ts): `src/app.module.ts`
- [Health check](https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/health/health.controller.ts): `src/health/health.controller.ts`

### Seat allocation

- [Seat routes](https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/assento/assento.controller.ts): `src/assento/assento.controller.ts`
- [Seat operations](https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/assento/assento.service.ts): `src/assento/assento.service.ts`
- [Create seat input](https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/assento/dto/create-assento.dto.ts): `src/assento/dto/create-assento.dto.ts`
- [Update seat input](https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/assento/dto/update-assento.dto.ts): `src/assento/dto/update-assento.dto.ts`
- [Seat reservations](https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/tree/main/src/assento_reserva): `src/assento_reserva`

### Ticketing domain

- [Reservations](https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/tree/main/src/reserva): `src/reserva`
- [Pricing](https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/tree/main/src/preco): `src/preco`
- [Tickets](https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/tree/main/src/ticket): `src/ticket`

### Persistence

- [Prisma connection](https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/prisma/prisma.service.ts): `src/prisma/prisma.service.ts`
- [Generated Prisma client](https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/blob/main/src/prisma/prisma/client.ts): `src/prisma/prisma/client.ts`
- [Generated model types](https://github.com/digidestinedcode/20262m-prj5-cinema-ingresso-backend/tree/main/src/prisma/prisma): `src/prisma/prisma`

### Other components

- **HTTP client**
- **MariaDB database**

## Connections

- HTTP client → Seat routes: sends requests (evidence: `src/assento/assento.controller.ts`)
- Seat routes → Seat operations: delegates operations (evidence: `src/assento/assento.controller.ts`)
- Seat routes → Create seat input: accepts input (evidence: `src/assento/assento.controller.ts`)
- Seat routes → Update seat input: accepts input (evidence: `src/assento/assento.controller.ts`)
- Seat operations → Prisma connection: queries data (evidence: `src/assento/assento.service.ts`)
- Prisma connection → Generated Prisma client: extends client (evidence: `src/prisma/prisma.service.ts`)
- Generated Prisma client → Generated model types: uses model types (evidence: `src/prisma/prisma/client.ts`)
- Prisma connection → MariaDB database: connects to (evidence: `src/prisma/prisma.service.ts`)
- Nest application → Feature registration: loads module (evidence: `src/main.ts`)
- Feature registration → Health check: registers feature (evidence: `src/app.module.ts`)
- Feature registration → Seat routes: registers feature (evidence: `src/app.module.ts`)
- Feature registration → Seat reservations: registers feature (evidence: `src/app.module.ts`)
- Feature registration → Reservations: registers feature (evidence: `src/app.module.ts`)
- Feature registration → Pricing: registers feature (evidence: `src/app.module.ts`)
- Feature registration → Tickets: registers feature (evidence: `src/app.module.ts`)
