# dantoulis/assetflow architecture

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

- Interactive diagram: https://gitdiagram.com/dantoulis/assetflow
- Repository: https://github.com/dantoulis/assetflow

## Overview

AssetFlow is an internal asset-management application: employees authenticate, view assigned equipment, submit requests, and track support tickets; administrators manage users, inventory, requests, and ticket workflows. The Nuxt frontend uses a NestJS API backed by PostgreSQL/Prisma. Password recovery uses email, social sign-in is optional, and dashboard briefs can use Gemini. The README also documents asset-management capabilities whose implementation is absent from the supplied tree. Relationships below are limited to sampled calls and README statements; some frontend and unsampled feature wiring is not shown.

Main entry points: [`apps/web/app/pages/admin`](https://github.com/dantoulis/assetflow/tree/main/apps/web/app/pages/admin) (Admin workspace), [`apps/api/src/auth/auth.service.ts`](https://github.com/dantoulis/assetflow/blob/main/apps/api/src/auth/auth.service.ts) (Authentication), [`apps/api/src/prisma/prisma.service.ts`](https://github.com/dantoulis/assetflow/blob/main/apps/api/src/prisma/prisma.service.ts) (PostgreSQL), [`apps/web/app/pages/app`](https://github.com/dantoulis/assetflow/tree/main/apps/web/app/pages/app) (Employee workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_webapp["Nuxt application<br/>[app.vue]"]
  node_authclient["Auth client<br/>[useAuth.ts]"]
  node_apiclient["API client<br/>[useAssetFlowApi.ts]"]
  node_employeeui["Employee workspace"]
  node_adminui["Admin workspace"]
  node_assetstate["Asset state<br/>[assets.ts]"]
  node_requeststate["Request state<br/>[assetRequests.ts]"]
  node_ticketstate["Ticket state<br/>[tickets.ts]"]
  node_aistate["Brief state"]
end

subgraph group_identity["Identity and accounts"]
  node_authapi["Auth endpoints<br/>[auth.controller.ts]"]
  node_authlogic["Authentication<br/>[auth.service.ts]"]
  node_usersapi["User endpoints"]
  node_userslogic["User management<br/>[users.service.ts]"]
end

subgraph group_operations["Asset and support operations"]
  node_assetrequests["Asset requests"]
  node_tickets["Ticket workflows<br/>[tickets.service.ts]"]
  node_ticketmessages["Ticket messages"]
  node_inventory["Inventory management"]
  node_ai["Dashboard briefs<br/>[ai.service.ts]"]
end

subgraph group_platform["API and persistence"]
  node_database[("PostgreSQL<br/>[prisma.service.ts]")]
end

subgraph group_integrations["External integrations"]
  node_mailer["Mail service<br/>[mail.service.ts]"]
  node_gemini["Gemini API"]
  node_oauth["Google / GitHub"]
end

node_employee(("Employee"))
node_admin(("Administrator"))

node_employee -->|"uses"| node_webapp
node_admin -->|"uses"| node_webapp
node_webapp -.->|"serves"| node_employeeui
node_webapp -.->|"serves"| node_adminui
node_authclient -->|"requests auth"| node_authapi
node_authapi -->|"delegates to"| node_authlogic
node_authlogic -->|"looks up users"| node_userslogic
node_authlogic -->|"sends reset email"| node_mailer
node_authlogic -.->|"accepts provider profile"| node_oauth
node_usersapi -->|"delegates to"| node_userslogic
node_assetrequests -->|"reads and writes"| node_database
node_tickets -->|"reads and writes"| node_database
node_ticketmessages -.->|"reads and writes"| node_database
node_userslogic -->|"reads and writes"| node_database
node_authlogic -.->|"via user service"| node_database
node_ai -->|"generates briefs"| node_gemini
node_aistate -->|"sends dashboard snapshot"| node_ai
node_employeeui -.->|"browses assets"| node_assetstate
node_employeeui -.->|"submits requests"| node_requeststate
node_employeeui -.->|"opens tickets"| node_ticketstate
node_adminui -.->|"manages inventory"| node_inventory
node_adminui -.->|"manages users"| node_usersapi
node_adminui -.->|"reviews requests"| node_assetrequests
node_adminui -.->|"manages tickets"| node_tickets
node_apiclient -.->|"calls API"| node_assetrequests
node_apiclient -.->|"calls API"| node_tickets

click node_webapp "https://github.com/dantoulis/assetflow/blob/main/apps/web/app/app.vue"
click node_authclient "https://github.com/dantoulis/assetflow/blob/main/apps/web/app/composables/useAuth.ts"
click node_apiclient "https://github.com/dantoulis/assetflow/blob/main/apps/web/app/composables/useAssetFlowApi.ts"
click node_employeeui "https://github.com/dantoulis/assetflow/tree/main/apps/web/app/pages/app"
click node_adminui "https://github.com/dantoulis/assetflow/tree/main/apps/web/app/pages/admin"
click node_assetstate "https://github.com/dantoulis/assetflow/blob/main/apps/web/app/stores/assets.ts"
click node_requeststate "https://github.com/dantoulis/assetflow/blob/main/apps/web/app/stores/assetRequests.ts"
click node_ticketstate "https://github.com/dantoulis/assetflow/blob/main/apps/web/app/stores/tickets.ts"
click node_aistate "https://github.com/dantoulis/assetflow/blob/main/apps/web/app/stores/aiDashboardBrief.ts"
click node_authapi "https://github.com/dantoulis/assetflow/blob/main/apps/api/src/auth/auth.controller.ts"
click node_authlogic "https://github.com/dantoulis/assetflow/blob/main/apps/api/src/auth/auth.service.ts"
click node_usersapi "https://github.com/dantoulis/assetflow/blob/main/apps/api/src/users/users.controller.ts"
click node_userslogic "https://github.com/dantoulis/assetflow/blob/main/apps/api/src/users/users.service.ts"
click node_assetrequests "https://github.com/dantoulis/assetflow/blob/main/apps/api/src/asset-requests/asset-requests.service.ts"
click node_tickets "https://github.com/dantoulis/assetflow/blob/main/apps/api/src/tickets/tickets.service.ts"
click node_ticketmessages "https://github.com/dantoulis/assetflow/blob/main/apps/api/src/tickets/ticket-messages.service.ts"
click node_inventory "https://github.com/dantoulis/assetflow/tree/main/apps/api/src"
click node_ai "https://github.com/dantoulis/assetflow/blob/main/apps/api/src/ai/ai.service.ts"
click node_database "https://github.com/dantoulis/assetflow/blob/main/apps/api/src/prisma/prisma.service.ts"
click node_mailer "https://github.com/dantoulis/assetflow/blob/main/apps/api/src/mail/mail.service.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_webapp,node_authclient,node_apiclient,node_employeeui,node_adminui,node_assetstate,node_requeststate,node_ticketstate,node_aistate toneBlue
class node_authapi,node_authlogic,node_usersapi,node_userslogic toneAmber
class node_assetrequests,node_tickets,node_ticketmessages,node_inventory,node_ai toneMint
class node_database toneRose
class node_mailer,node_gemini,node_oauth,node_employee,node_admin toneIndigo
```

## Components

### Web application

- [Nuxt application](https://github.com/dantoulis/assetflow/blob/main/apps/web/app/app.vue): `apps/web/app/app.vue`
- [Auth client](https://github.com/dantoulis/assetflow/blob/main/apps/web/app/composables/useAuth.ts): `apps/web/app/composables/useAuth.ts`
- [API client](https://github.com/dantoulis/assetflow/blob/main/apps/web/app/composables/useAssetFlowApi.ts): `apps/web/app/composables/useAssetFlowApi.ts`
- [Employee workspace](https://github.com/dantoulis/assetflow/tree/main/apps/web/app/pages/app): `apps/web/app/pages/app`
- [Admin workspace](https://github.com/dantoulis/assetflow/tree/main/apps/web/app/pages/admin): `apps/web/app/pages/admin`
- [Asset state](https://github.com/dantoulis/assetflow/blob/main/apps/web/app/stores/assets.ts): `apps/web/app/stores/assets.ts`
- [Request state](https://github.com/dantoulis/assetflow/blob/main/apps/web/app/stores/assetRequests.ts): `apps/web/app/stores/assetRequests.ts`
- [Ticket state](https://github.com/dantoulis/assetflow/blob/main/apps/web/app/stores/tickets.ts): `apps/web/app/stores/tickets.ts`
- [Brief state](https://github.com/dantoulis/assetflow/blob/main/apps/web/app/stores/aiDashboardBrief.ts): `apps/web/app/stores/aiDashboardBrief.ts`

### Identity and accounts

- [Auth endpoints](https://github.com/dantoulis/assetflow/blob/main/apps/api/src/auth/auth.controller.ts): `apps/api/src/auth/auth.controller.ts`
- [Authentication](https://github.com/dantoulis/assetflow/blob/main/apps/api/src/auth/auth.service.ts): `apps/api/src/auth/auth.service.ts`
- [User endpoints](https://github.com/dantoulis/assetflow/blob/main/apps/api/src/users/users.controller.ts): `apps/api/src/users/users.controller.ts`
- [User management](https://github.com/dantoulis/assetflow/blob/main/apps/api/src/users/users.service.ts): `apps/api/src/users/users.service.ts`

### Asset and support operations

- [Asset requests](https://github.com/dantoulis/assetflow/blob/main/apps/api/src/asset-requests/asset-requests.service.ts): `apps/api/src/asset-requests/asset-requests.service.ts`
- [Ticket workflows](https://github.com/dantoulis/assetflow/blob/main/apps/api/src/tickets/tickets.service.ts): `apps/api/src/tickets/tickets.service.ts`
- [Ticket messages](https://github.com/dantoulis/assetflow/blob/main/apps/api/src/tickets/ticket-messages.service.ts): `apps/api/src/tickets/ticket-messages.service.ts`
- [Inventory management](https://github.com/dantoulis/assetflow/tree/main/apps/api/src): `apps/api/src`
- [Dashboard briefs](https://github.com/dantoulis/assetflow/blob/main/apps/api/src/ai/ai.service.ts): `apps/api/src/ai/ai.service.ts`

### API and persistence

- [PostgreSQL](https://github.com/dantoulis/assetflow/blob/main/apps/api/src/prisma/prisma.service.ts): `apps/api/src/prisma/prisma.service.ts`

### External integrations

- [Mail service](https://github.com/dantoulis/assetflow/blob/main/apps/api/src/mail/mail.service.ts): `apps/api/src/mail/mail.service.ts`
- **Gemini API**
- **Google / GitHub**

### Other components

- **Employee**
- **Administrator**

## Connections

- Employee → Nuxt application: uses (evidence: `README.md`)
- Administrator → Nuxt application: uses (evidence: `README.md`)
- Nuxt application → Employee workspace: serves
- Nuxt application → Admin workspace: serves
- Auth client → Auth endpoints: requests auth (evidence: `apps/web/app/composables/useAuth.ts`)
- Auth endpoints → Authentication: delegates to (evidence: `apps/api/src/auth/auth.controller.ts`)
- Authentication → User management: looks up users (evidence: `apps/api/src/auth/auth.service.ts`)
- Authentication → Mail service: sends reset email (evidence: `apps/api/src/auth/auth.service.ts`)
- Authentication → Google / GitHub: accepts provider profile (evidence: `README.md`)
- User endpoints → User management: delegates to (evidence: `apps/api/src/users/users.controller.ts`)
- Asset requests → PostgreSQL: reads and writes (evidence: `apps/api/src/asset-requests/asset-requests.service.ts`)
- Ticket workflows → PostgreSQL: reads and writes (evidence: `apps/api/src/tickets/tickets.service.ts`)
- Ticket messages → PostgreSQL: reads and writes
- User management → PostgreSQL: reads and writes (evidence: `apps/api/src/users/users.service.ts`)
- Authentication → PostgreSQL: via user service
- Dashboard briefs → Gemini API: generates briefs (evidence: `README.md`)
- Brief state → Dashboard briefs: sends dashboard snapshot (evidence: `README.md`)
- Employee workspace → Asset state: browses assets
- Employee workspace → Request state: submits requests
- Employee workspace → Ticket state: opens tickets
- Admin workspace → Inventory management: manages inventory (evidence: `README.md`)
- Admin workspace → User endpoints: manages users (evidence: `README.md`)
- Admin workspace → Asset requests: reviews requests (evidence: `README.md`)
- Admin workspace → Ticket workflows: manages tickets (evidence: `README.md`)
- API client → Asset requests: calls API
- API client → Ticket workflows: calls API
