# felipeeduardooliveira/gestaocliente-service architecture

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

- Interactive diagram: https://gitdiagram.com/felipeeduardooliveira/gestaocliente-service
- Repository: https://github.com/felipeeduardooliveira/gestaocliente-service

## Overview

This is a NestJS client-management API, despite the generic starter README. Its visible workflow accepts client create, list, and update requests; validates input; invokes client services; and persists or retrieves client records in PostgreSQL. A separate root route returns an API health message. Shared response formatting and exception handling are part of the HTTP layer. The tree and sampled source support these paths; the interceptor and decorator are represented from their paths and wiring, but their implementations were not sampled.

Main entry points: [`src/client/client.controller.ts`](https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/client/client.controller.ts) (Client routes), [`src/client/client.module.ts`](https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/client/client.module.ts) (Client module), [`src/main.ts`](https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/main.ts) (Bootstrap), [`src/app.module.ts`](https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/app.module.ts) (Root module)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP runtime"]
  node_bootstrap["Bootstrap<br/>[main.ts]"]
  node_root_module["Root module<br/>[app.module.ts]"]
  node_health_controller["Health route<br/>[app.controller.ts]"]
  node_health_service["Health service<br/>[app.service.ts]"]
end

subgraph group_clients["Client management"]
  node_client_controller["Client routes"]
  node_client_service["Client service<br/>[client.service.ts]"]
  node_create_dto["Create DTO"]
  node_update_dto["Update DTO"]
  node_client_status["Client status<br/>[status.enum.ts]"]
  node_client_module["Client module<br/>[client.module.ts]"]
end

subgraph group_shared["Shared HTTP handling"]
  node_response_interceptor["Response interceptor"]
  node_response_decorator["Response message"]
  node_exception_filter["Exception filter"]
end

subgraph group_persistence["Persistence"]
  node_client_entity["Client entity<br/>[client.entity.ts]"]
  node_postgres[("PostgreSQL")]
end

node_caller(("API caller"))

node_caller -->|"requests"| node_health_controller
node_health_controller -->|"calls"| node_health_service
node_caller -->|"client requests"| node_client_controller
node_client_controller -->|"calls"| node_client_service
node_client_controller -->|"accepts create"| node_create_dto
node_client_controller -->|"accepts update"| node_update_dto
node_bootstrap -->|"starts"| node_root_module
node_bootstrap -->|"validates input"| node_create_dto
node_bootstrap -->|"registers"| node_exception_filter
node_root_module -->|"imports"| node_client_module
node_root_module -->|"registers globally"| node_response_interceptor
node_client_module -->|"provides"| node_client_service
node_client_module -->|"registers"| node_client_controller
node_client_module -->|"registers repository"| node_client_entity
node_client_service -->|"reads and writes"| node_postgres
node_client_entity -->|"maps records"| node_postgres
node_create_dto -->|"uses"| node_client_status
node_update_dto -->|"uses"| node_client_status
node_client_controller -->|"sets messages"| node_response_decorator
node_response_interceptor -->|"reads metadata"| node_response_decorator

click node_bootstrap "https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/main.ts"
click node_root_module "https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/app.module.ts"
click node_health_controller "https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/app.controller.ts"
click node_health_service "https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/app.service.ts"
click node_client_controller "https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/client/client.controller.ts"
click node_client_service "https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/client/client.service.ts"
click node_create_dto "https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/client/dto/create-client.dto.ts"
click node_update_dto "https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/client/dto/update-client.dto.ts"
click node_client_status "https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/client/enums/status.enum.ts"
click node_client_entity "https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/client/entities/client.entity.ts"
click node_client_module "https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/client/client.module.ts"
click node_response_interceptor "https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/common/interceptors/response.interceptor.ts"
click node_response_decorator "https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/common/decorator/response-message.decorator.ts"
click node_exception_filter "https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/common/filters/http-exception.filter.ts"

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_bootstrap,node_root_module,node_health_controller,node_health_service toneBlue
class node_client_controller,node_client_service,node_create_dto,node_update_dto,node_client_status,node_client_module toneAmber
class node_response_interceptor,node_response_decorator,node_exception_filter,node_caller toneMint
class node_client_entity,node_postgres toneRose
```

## Components

### HTTP runtime

- [Bootstrap](https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/main.ts): `src/main.ts`
- [Root module](https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/app.module.ts): `src/app.module.ts`
- [Health route](https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/app.controller.ts): `src/app.controller.ts`
- [Health service](https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/app.service.ts): `src/app.service.ts`

### Client management

- [Client routes](https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/client/client.controller.ts): `src/client/client.controller.ts`
- [Client service](https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/client/client.service.ts): `src/client/client.service.ts`
- [Create DTO](https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/client/dto/create-client.dto.ts): `src/client/dto/create-client.dto.ts`
- [Update DTO](https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/client/dto/update-client.dto.ts): `src/client/dto/update-client.dto.ts`
- [Client status](https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/client/enums/status.enum.ts): `src/client/enums/status.enum.ts`
- [Client module](https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/client/client.module.ts): `src/client/client.module.ts`

### Shared HTTP handling

- [Response interceptor](https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/common/interceptors/response.interceptor.ts): `src/common/interceptors/response.interceptor.ts`
- [Response message](https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/common/decorator/response-message.decorator.ts): `src/common/decorator/response-message.decorator.ts`
- [Exception filter](https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/common/filters/http-exception.filter.ts): `src/common/filters/http-exception.filter.ts`

### Persistence

- [Client entity](https://github.com/felipeeduardooliveira/gestaocliente-service/blob/main/src/client/entities/client.entity.ts): `src/client/entities/client.entity.ts`
- **PostgreSQL**

### Other components

- **API caller**

## Connections

- API caller → Health route: requests
- Health route → Health service: calls
- API caller → Client routes: client requests
- Client routes → Client service: calls
- Client routes → Create DTO: accepts create
- Client routes → Update DTO: accepts update
- Bootstrap → Root module: starts
- Bootstrap → Create DTO: validates input
- Bootstrap → Exception filter: registers
- Root module → Client module: imports
- Root module → Response interceptor: registers globally
- Client module → Client service: provides
- Client module → Client routes: registers
- Client module → Client entity: registers repository
- Client service → PostgreSQL: reads and writes
- Client entity → PostgreSQL: maps records
- Create DTO → Client status: uses
- Update DTO → Client status: uses
- Client routes → Response message: sets messages
- Response interceptor → Response message: reads metadata
