# thomas-gosnet/libheros-test architecture

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

- Interactive diagram: https://gitdiagram.com/thomas-gosnet/libheros-test
- Repository: https://github.com/thomas-gosnet/libheros-test

## Overview

This is a task-management application with a Nuxt browser client and a NestJS modular-monolith API backed by PostgreSQL. The main workflow is: a user registers or signs in, restores an authenticated session, manages owned lists and their tasks, and receives socket updates reflected in shared client state. The graph keeps list and task operations distinct and includes authentication, persistence, and realtime delivery. Some subsystem links are based on README statements because their implementation files were not excerpted.

Main entry points: [`apps/api/src/realtime/realtime.gateway.ts`](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/realtime/realtime.gateway.ts) (Socket gateway), [`apps/api/src/app.module.ts`](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/app.module.ts) (Nest application), [`apps/web/app/pages/index.vue`](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/web/app/pages/index.vue) (App pages), [`apps/web/app/composables/useApi.ts`](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/web/app/composables/useApi.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Browser application"]
  node_webpages["App pages<br/>[index.vue]"]
  node_webguards["Route guards<br/>[auth.ts]"]
  node_webui["Task UI<br/>[TaskCard.vue]"]
  node_webstores["Pinia stores<br/>[tasks.ts]"]
  node_webapi["API client<br/>[useApi.ts]"]
  node_websocket["Socket client<br/>[socket.client.ts]"]
end

subgraph group_api["API boundaries"]
  node_apiroot["Nest application<br/>[app.module.ts]"]
  node_authhttp["Auth endpoints<br/>[auth.controller.ts]"]
  node_listhttp["List endpoints"]
  node_taskhttp["Task endpoints"]
  node_listtaskhttp["List task endpoints"]
end

subgraph group_identity["Identity and users"]
  node_authlogic["Session service<br/>[auth.service.ts]"]
  node_userdata["User records"]
  node_refreshdata["Refresh sessions"]
end

subgraph group_work["Lists and tasks"]
  node_listlogic["List service<br/>[lists.service.ts]"]
  node_listdata["List records"]
  node_tasklogic["Task service<br/>[tasks.service.ts]"]
  node_taskdata["Task records"]
  node_database[("PostgreSQL")]
end

subgraph group_live["Realtime updates"]
  node_gateway["Socket gateway"]
  node_listbroadcast["List broadcaster"]
  node_taskbroadcast["Task broadcaster"]
end

node_person(("User"))

node_person -->|"uses"| node_webpages
node_webpages -->|"guards routes"| node_webguards
node_webpages -->|"renders"| node_webui
node_webui -->|"updates state"| node_webstores
node_webpages -.->|"requests data"| node_webapi
node_websocket -->|"applies events"| node_webstores
node_websocket -->|"exchanges events"| node_gateway
node_webapi -.->|"calls API"| node_authhttp
node_webapi -.->|"calls API"| node_listhttp
node_webapi -.->|"calls API"| node_taskhttp
node_apiroot -->|"registers"| node_authhttp
node_apiroot -->|"registers"| node_listhttp
node_apiroot -->|"registers"| node_taskhttp
node_apiroot -->|"registers"| node_gateway
node_authhttp -->|"delegates"| node_authlogic
node_authlogic -->|"reads and writes"| node_userdata
node_authlogic -->|"rotates tokens"| node_refreshdata
node_listhttp -->|"delegates"| node_listlogic
node_listlogic -->|"reads and writes"| node_listdata
node_listtaskhttp -->|"delegates"| node_tasklogic
node_taskhttp -->|"delegates"| node_tasklogic
node_tasklogic -->|"reads and writes"| node_taskdata
node_listdata -->|"persists"| node_database
node_taskdata -->|"persists"| node_database
node_userdata -->|"persists"| node_database
node_refreshdata -->|"persists"| node_database
node_listlogic -->|"emits changes"| node_listbroadcast
node_tasklogic -->|"emits changes"| node_taskbroadcast
node_gateway -->|"checks ownership"| node_listdata
node_gateway -->|"authenticates socket"| node_person
node_listbroadcast -.->|"broadcasts"| node_gateway
node_taskbroadcast -.->|"broadcasts"| node_gateway

click node_webpages "https://github.com/thomas-gosnet/libheros-test/blob/main/apps/web/app/pages/index.vue"
click node_webguards "https://github.com/thomas-gosnet/libheros-test/blob/main/apps/web/app/middleware/auth.ts"
click node_webui "https://github.com/thomas-gosnet/libheros-test/blob/main/apps/web/app/components/TaskCard.vue"
click node_webstores "https://github.com/thomas-gosnet/libheros-test/blob/main/apps/web/app/stores/tasks.ts"
click node_webapi "https://github.com/thomas-gosnet/libheros-test/blob/main/apps/web/app/composables/useApi.ts"
click node_websocket "https://github.com/thomas-gosnet/libheros-test/blob/main/apps/web/app/plugins/socket.client.ts"
click node_apiroot "https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/app.module.ts"
click node_authhttp "https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/auth/auth.controller.ts"
click node_listhttp "https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/lists/lists.controller.ts"
click node_taskhttp "https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/tasks/tasks.controller.ts"
click node_listtaskhttp "https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/tasks/list-tasks.controller.ts"
click node_authlogic "https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/auth/auth.service.ts"
click node_userdata "https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/users/infrastructure/prisma-user.repository.ts"
click node_refreshdata "https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/auth/infrastructure/prisma-refresh-token.repository.ts"
click node_listlogic "https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/lists/lists.service.ts"
click node_listdata "https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/lists/infrastructure/prisma-list.repository.ts"
click node_tasklogic "https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/tasks/tasks.service.ts"
click node_taskdata "https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/tasks/infrastructure/prisma-task.repository.ts"
click node_gateway "https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/realtime/realtime.gateway.ts"
click node_listbroadcast "https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/realtime/domain/list-broadcaster.ts"
click node_taskbroadcast "https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/realtime/domain/task-broadcaster.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_webpages,node_webguards,node_webui,node_webstores,node_webapi,node_websocket,node_person toneBlue
class node_apiroot,node_authhttp,node_listhttp,node_taskhttp,node_listtaskhttp toneAmber
class node_authlogic,node_userdata,node_refreshdata toneMint
class node_listlogic,node_listdata,node_tasklogic,node_taskdata,node_database toneRose
class node_gateway,node_listbroadcast,node_taskbroadcast toneIndigo
```

## Components

### Browser application

- [App pages](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/web/app/pages/index.vue): `apps/web/app/pages/index.vue`
- [Route guards](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/web/app/middleware/auth.ts): `apps/web/app/middleware/auth.ts`
- [Task UI](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/web/app/components/TaskCard.vue): `apps/web/app/components/TaskCard.vue`
- [Pinia stores](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/web/app/stores/tasks.ts): `apps/web/app/stores/tasks.ts`
- [API client](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/web/app/composables/useApi.ts): `apps/web/app/composables/useApi.ts`
- [Socket client](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/web/app/plugins/socket.client.ts): `apps/web/app/plugins/socket.client.ts`

### API boundaries

- [Nest application](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/app.module.ts): `apps/api/src/app.module.ts`
- [Auth endpoints](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/auth/auth.controller.ts): `apps/api/src/auth/auth.controller.ts`
- [List endpoints](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/lists/lists.controller.ts): `apps/api/src/lists/lists.controller.ts`
- [Task endpoints](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/tasks/tasks.controller.ts): `apps/api/src/tasks/tasks.controller.ts`
- [List task endpoints](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/tasks/list-tasks.controller.ts): `apps/api/src/tasks/list-tasks.controller.ts`

### Identity and users

- [Session service](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/auth/auth.service.ts): `apps/api/src/auth/auth.service.ts`
- [User records](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/users/infrastructure/prisma-user.repository.ts): `apps/api/src/users/infrastructure/prisma-user.repository.ts`
- [Refresh sessions](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/auth/infrastructure/prisma-refresh-token.repository.ts): `apps/api/src/auth/infrastructure/prisma-refresh-token.repository.ts`

### Lists and tasks

- [List service](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/lists/lists.service.ts): `apps/api/src/lists/lists.service.ts`
- [List records](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/lists/infrastructure/prisma-list.repository.ts): `apps/api/src/lists/infrastructure/prisma-list.repository.ts`
- [Task service](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/tasks/tasks.service.ts): `apps/api/src/tasks/tasks.service.ts`
- [Task records](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/tasks/infrastructure/prisma-task.repository.ts): `apps/api/src/tasks/infrastructure/prisma-task.repository.ts`
- **PostgreSQL**

### Realtime updates

- [Socket gateway](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/realtime/realtime.gateway.ts): `apps/api/src/realtime/realtime.gateway.ts`
- [List broadcaster](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/realtime/domain/list-broadcaster.ts): `apps/api/src/realtime/domain/list-broadcaster.ts`
- [Task broadcaster](https://github.com/thomas-gosnet/libheros-test/blob/main/apps/api/src/realtime/domain/task-broadcaster.ts): `apps/api/src/realtime/domain/task-broadcaster.ts`

### Other components

- **User**

## Connections

- User → App pages: uses (evidence: `README.md`)
- App pages → Route guards: guards routes (evidence: `README.md`)
- App pages → Task UI: renders (evidence: `README.md`)
- Task UI → Pinia stores: updates state (evidence: `README.md`)
- App pages → API client: requests data
- Socket client → Pinia stores: applies events (evidence: `README.md`)
- Socket client → Socket gateway: exchanges events (evidence: `README.md`)
- API client → Auth endpoints: calls API
- API client → List endpoints: calls API
- API client → Task endpoints: calls API
- Nest application → Auth endpoints: registers (evidence: `apps/api/src/app.module.ts`)
- Nest application → List endpoints: registers (evidence: `apps/api/src/app.module.ts`)
- Nest application → Task endpoints: registers (evidence: `apps/api/src/app.module.ts`)
- Nest application → Socket gateway: registers (evidence: `apps/api/src/app.module.ts`)
- Auth endpoints → Session service: delegates (evidence: `apps/api/src/auth/auth.controller.ts`)
- Session service → User records: reads and writes (evidence: `apps/api/src/auth/auth.service.ts`)
- Session service → Refresh sessions: rotates tokens (evidence: `apps/api/src/auth/auth.service.ts`)
- List endpoints → List service: delegates (evidence: `apps/api/src/lists/lists.controller.ts`)
- List service → List records: reads and writes (evidence: `apps/api/src/lists/lists.service.ts`)
- List task endpoints → Task service: delegates (evidence: `apps/api/src/tasks/list-tasks.controller.ts`)
- Task endpoints → Task service: delegates (evidence: `apps/api/src/tasks/tasks.controller.ts`)
- Task service → Task records: reads and writes (evidence: `apps/api/src/tasks/tasks.service.ts`)
- List records → PostgreSQL: persists (evidence: `README.md`)
- Task records → PostgreSQL: persists (evidence: `README.md`)
- User records → PostgreSQL: persists (evidence: `README.md`)
- Refresh sessions → PostgreSQL: persists (evidence: `README.md`)
- List service → List broadcaster: emits changes (evidence: `README.md`)
- Task service → Task broadcaster: emits changes (evidence: `README.md`)
- Socket gateway → List records: checks ownership (evidence: `README.md`)
- Socket gateway → User: authenticates socket (evidence: `README.md`)
- List broadcaster → Socket gateway: broadcasts
- Task broadcaster → Socket gateway: broadcasts
