# arthurrodr1gues/corcoiote architecture

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

- Interactive diagram: https://gitdiagram.com/arthurrodr1gues/corcoiote
- Repository: https://github.com/arthurrodr1gues/corcoiote

## Overview

Corcoiote is a small Express API for listing, retrieving, creating, updating, and deleting users. Requests enter through the server and user router, reach controller handlers, and are handled by a service that reads or mutates a shared in-memory array of mock users. The README provides no capability details; this map is based on the sampled runtime source.

Main entry points: [`api/src/server.ts`](https://github.com/arthurrodr1gues/corcoiote/blob/main/api/src/server.ts) (Express server), [`api/src/routes/user.route.ts`](https://github.com/arthurrodr1gues/corcoiote/blob/main/api/src/routes/user.route.ts) (User router), [`api/src/controllers/user.controller.ts`](https://github.com/arthurrodr1gues/corcoiote/blob/main/api/src/controllers/user.controller.ts) (User handlers), [`api/src/services/user.service.ts`](https://github.com/arthurrodr1gues/corcoiote/blob/main/api/src/services/user.service.ts) (User service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["HTTP entry"]
  node_server["Express server<br/>[server.ts]"]
  node_router["User router<br/>[user.route.ts]"]
end

subgraph group_users["User operations"]
  node_controller["User handlers<br/>[user.controller.ts]"]
  node_service["User service<br/>[user.service.ts]"]
end

subgraph group_state["User state"]
  node_users_store[("Mock user array<br/>[user.mock.ts]")]
end

node_client(("HTTP client"))

node_client -->|"sends HTTP"| node_server
node_server -->|"mounts at /users"| node_router
node_router -->|"dispatches routes"| node_controller
node_controller -->|"invokes operations"| node_service
node_service -->|"reads and mutates"| node_users_store

click node_server "https://github.com/arthurrodr1gues/corcoiote/blob/main/api/src/server.ts"
click node_router "https://github.com/arthurrodr1gues/corcoiote/blob/main/api/src/routes/user.route.ts"
click node_controller "https://github.com/arthurrodr1gues/corcoiote/blob/main/api/src/controllers/user.controller.ts"
click node_service "https://github.com/arthurrodr1gues/corcoiote/blob/main/api/src/services/user.service.ts"
click node_users_store "https://github.com/arthurrodr1gues/corcoiote/blob/main/api/src/mocks/user.mock.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_server,node_router,node_client toneBlue
class node_controller,node_service toneAmber
class node_users_store toneMint
```

## Components

### HTTP entry

- [Express server](https://github.com/arthurrodr1gues/corcoiote/blob/main/api/src/server.ts): `api/src/server.ts`
- [User router](https://github.com/arthurrodr1gues/corcoiote/blob/main/api/src/routes/user.route.ts): `api/src/routes/user.route.ts`

### User operations

- [User handlers](https://github.com/arthurrodr1gues/corcoiote/blob/main/api/src/controllers/user.controller.ts): `api/src/controllers/user.controller.ts`
- [User service](https://github.com/arthurrodr1gues/corcoiote/blob/main/api/src/services/user.service.ts): `api/src/services/user.service.ts`

### User state

- [Mock user array](https://github.com/arthurrodr1gues/corcoiote/blob/main/api/src/mocks/user.mock.ts): `api/src/mocks/user.mock.ts`

### Other components

- **HTTP client**

## Connections

- HTTP client → Express server: sends HTTP
- Express server → User router: mounts at /users
- User router → User handlers: dispatches routes
- User handlers → User service: invokes operations
- User service → Mock user array: reads and mutates
