# finnprivategit/experimentmanager architecture

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

- Interactive diagram: https://gitdiagram.com/finnprivategit/experimentmanager
- Repository: https://github.com/finnprivategit/experimentmanager

## Overview

NAWI-DB is a web platform for managing science-teaching materials, chemicals, experiments, collections, and storage locations. Users search and maintain records, associate resources and safety information, then organize or print/export them. The graph preserves the README’s major capabilities; most domain handlers are represented by their exact API directories because their source was not sampled. Dashed, uncited edges mark likely runtime links not verified in the excerpts.

Main entry points: [`server/db.ts`](https://github.com/finnprivategit/experimentmanager/blob/main/server/db.ts) (PostgreSQL), [`app/web/app/app.vue`](https://github.com/finnprivategit/experimentmanager/blob/main/app/web/app/app.vue) (Nuxt interface), [`app/web/app/pages/materials/index.vue`](https://github.com/finnprivategit/experimentmanager/blob/main/app/web/app/pages/materials/index.vue) (Record pages), [`app/web/app/pages/dashboard/index.vue`](https://github.com/finnprivategit/experimentmanager/blob/main/app/web/app/pages/dashboard/index.vue) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_web["Nuxt interface<br/>[app.vue]"]
  node_record_pages["Record pages<br/>[index.vue]"]
  node_experiment_pages["Experiment pages<br/>[index.vue]"]
  node_dashboard["Dashboard<br/>[index.vue]"]
  node_label_ui["Label designer<br/>[label-print.vue]"]
end

subgraph group_domain["Records and discovery"]
  node_materials_api["Materials and chemicals"]
  node_locations_api["Locations and rooms"]
  node_experiments_api["Experiments and collections"]
  node_codes_api["Codes and tags"]
  node_search_api["Global search<br/>[global.get.ts]"]
  node_import_api["Material import<br/>[import.post.ts]"]
  node_sds_api["Safety data parsing<br/>[parse.post.ts]"]
end

subgraph group_output["Files and output"]
  node_attachments_api["Attachment endpoints<br/>[upload.post.ts]"]
  node_labels_api["Labels and sharing<br/>[labels.get.ts]"]
  node_pdf_api["PDF generation"]
  node_attachment_store["Attachment storage<br/>[storage.ts]"]
end

subgraph group_server["Server services"]
  node_edit_lock["Edit locking<br/>[editLocks.ts]"]
  node_rate_limit["API rate limiting<br/>[rate-limit.ts]"]
  node_cleanup["Daily cleanup<br/>[daily-cleanup.ts]"]
end

subgraph group_state["Persistence and integrations"]
  node_db[("PostgreSQL<br/>[db.ts]")]
  node_file_service[("Local or SMB files")]
  node_microsoft["Microsoft identity"]
end

node_user(("School user"))

node_user -->|"uses"| node_web
node_web -.->|"navigates"| node_record_pages
node_web -.->|"navigates"| node_experiment_pages
node_web -.->|"opens"| node_dashboard
node_user -->|"designs labels"| node_label_ui
node_record_pages -.->|"manages records"| node_materials_api
node_record_pages -.->|"assigns inventory"| node_locations_api
node_experiment_pages -.->|"manages experiments"| node_experiments_api
node_dashboard -.->|"searches"| node_search_api
node_dashboard -.->|"loads favorites"| node_materials_api
node_user -->|"imports materials"| node_import_api
node_user -->|"parses safety sheets"| node_sds_api
node_user -->|"maintains safety codes"| node_codes_api
node_label_ui -.->|"manages layouts"| node_labels_api
node_labels_api -.->|"requests PDF"| node_pdf_api
node_attachments_api -.->|"stores files"| node_attachment_store
node_attachment_store -->|"reads and writes"| node_file_service
node_materials_api -.->|"reads and writes"| node_db
node_locations_api -.->|"reads and writes"| node_db
node_experiments_api -.->|"reads and writes"| node_db
node_codes_api -.->|"reads and writes"| node_db
node_search_api -.->|"searches records"| node_db
node_import_api -.->|"imports records"| node_db
node_sds_api -.->|"stores parsed data"| node_db
node_pdf_api -.->|"returns PDF"| node_user
node_edit_lock -->|"reads and writes locks"| node_db
node_rate_limit -.->|"—"| node_db
node_cleanup -.->|"cleans expired data"| node_db
node_microsoft -.->|"authenticates users"| node_web

click node_web "https://github.com/finnprivategit/experimentmanager/blob/main/app/web/app/app.vue"
click node_record_pages "https://github.com/finnprivategit/experimentmanager/blob/main/app/web/app/pages/materials/index.vue"
click node_experiment_pages "https://github.com/finnprivategit/experimentmanager/blob/main/app/web/app/pages/experiments/index.vue"
click node_dashboard "https://github.com/finnprivategit/experimentmanager/blob/main/app/web/app/pages/dashboard/index.vue"
click node_label_ui "https://github.com/finnprivategit/experimentmanager/blob/main/app/web/app/pages/label-print.vue"
click node_materials_api "https://github.com/finnprivategit/experimentmanager/tree/main/server/api/materials"
click node_locations_api "https://github.com/finnprivategit/experimentmanager/tree/main/server/api/locations"
click node_experiments_api "https://github.com/finnprivategit/experimentmanager/tree/main/server/api/experiments"
click node_codes_api "https://github.com/finnprivategit/experimentmanager/tree/main/server/api/ghs-codes"
click node_search_api "https://github.com/finnprivategit/experimentmanager/blob/main/server/api/search/global.get.ts"
click node_import_api "https://github.com/finnprivategit/experimentmanager/blob/main/server/api/material-import/import.post.ts"
click node_sds_api "https://github.com/finnprivategit/experimentmanager/blob/main/server/api/safety-data-sheets/parse.post.ts"
click node_attachments_api "https://github.com/finnprivategit/experimentmanager/blob/main/server/api/attachments/upload.post.ts"
click node_labels_api "https://github.com/finnprivategit/experimentmanager/blob/main/server/api/labels/labels.get.ts"
click node_pdf_api "https://github.com/finnprivategit/experimentmanager/blob/main/server/utils/pdf/createPdfFromHtml.ts"
click node_attachment_store "https://github.com/finnprivategit/experimentmanager/blob/main/server/utils/attachments/storage.ts"
click node_edit_lock "https://github.com/finnprivategit/experimentmanager/blob/main/server/utils/editLocks.ts"
click node_rate_limit "https://github.com/finnprivategit/experimentmanager/blob/main/server/utils/rate-limit.ts"
click node_cleanup "https://github.com/finnprivategit/experimentmanager/blob/main/server/utils/daily-cleanup.ts"
click node_db "https://github.com/finnprivategit/experimentmanager/blob/main/server/db.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_web,node_record_pages,node_experiment_pages,node_dashboard,node_label_ui,node_user toneBlue
class node_materials_api,node_locations_api,node_experiments_api,node_codes_api,node_search_api,node_import_api,node_sds_api toneAmber
class node_attachments_api,node_labels_api,node_pdf_api,node_attachment_store toneMint
class node_edit_lock,node_rate_limit,node_cleanup toneRose
class node_db,node_file_service,node_microsoft toneIndigo
```

## Components

### Web application

- [Nuxt interface](https://github.com/finnprivategit/experimentmanager/blob/main/app/web/app/app.vue): `app/web/app/app.vue`
- [Record pages](https://github.com/finnprivategit/experimentmanager/blob/main/app/web/app/pages/materials/index.vue): `app/web/app/pages/materials/index.vue`
- [Experiment pages](https://github.com/finnprivategit/experimentmanager/blob/main/app/web/app/pages/experiments/index.vue): `app/web/app/pages/experiments/index.vue`
- [Dashboard](https://github.com/finnprivategit/experimentmanager/blob/main/app/web/app/pages/dashboard/index.vue): `app/web/app/pages/dashboard/index.vue`
- [Label designer](https://github.com/finnprivategit/experimentmanager/blob/main/app/web/app/pages/label-print.vue): `app/web/app/pages/label-print.vue`

### Records and discovery

- [Materials and chemicals](https://github.com/finnprivategit/experimentmanager/tree/main/server/api/materials): `server/api/materials`
- [Locations and rooms](https://github.com/finnprivategit/experimentmanager/tree/main/server/api/locations): `server/api/locations`
- [Experiments and collections](https://github.com/finnprivategit/experimentmanager/tree/main/server/api/experiments): `server/api/experiments`
- [Codes and tags](https://github.com/finnprivategit/experimentmanager/tree/main/server/api/ghs-codes): `server/api/ghs-codes`
- [Global search](https://github.com/finnprivategit/experimentmanager/blob/main/server/api/search/global.get.ts): `server/api/search/global.get.ts`
- [Material import](https://github.com/finnprivategit/experimentmanager/blob/main/server/api/material-import/import.post.ts): `server/api/material-import/import.post.ts`
- [Safety data parsing](https://github.com/finnprivategit/experimentmanager/blob/main/server/api/safety-data-sheets/parse.post.ts): `server/api/safety-data-sheets/parse.post.ts`

### Files and output

- [Attachment endpoints](https://github.com/finnprivategit/experimentmanager/blob/main/server/api/attachments/upload.post.ts): `server/api/attachments/upload.post.ts`
- [Labels and sharing](https://github.com/finnprivategit/experimentmanager/blob/main/server/api/labels/labels.get.ts): `server/api/labels/labels.get.ts`
- [PDF generation](https://github.com/finnprivategit/experimentmanager/blob/main/server/utils/pdf/createPdfFromHtml.ts): `server/utils/pdf/createPdfFromHtml.ts`
- [Attachment storage](https://github.com/finnprivategit/experimentmanager/blob/main/server/utils/attachments/storage.ts): `server/utils/attachments/storage.ts`

### Server services

- [Edit locking](https://github.com/finnprivategit/experimentmanager/blob/main/server/utils/editLocks.ts): `server/utils/editLocks.ts`
- [API rate limiting](https://github.com/finnprivategit/experimentmanager/blob/main/server/utils/rate-limit.ts): `server/utils/rate-limit.ts`
- [Daily cleanup](https://github.com/finnprivategit/experimentmanager/blob/main/server/utils/daily-cleanup.ts): `server/utils/daily-cleanup.ts`

### Persistence and integrations

- [PostgreSQL](https://github.com/finnprivategit/experimentmanager/blob/main/server/db.ts): `server/db.ts`
- **Local or SMB files**
- **Microsoft identity**

### Other components

- **School user**

## Connections

- School user → Nuxt interface: uses (evidence: `README.md`)
- Nuxt interface → Record pages: navigates
- Nuxt interface → Experiment pages: navigates
- Nuxt interface → Dashboard: opens
- School user → Label designer: designs labels (evidence: `README.md`)
- Record pages → Materials and chemicals: manages records
- Record pages → Locations and rooms: assigns inventory
- Experiment pages → Experiments and collections: manages experiments
- Dashboard → Global search: searches
- Dashboard → Materials and chemicals: loads favorites
- School user → Material import: imports materials (evidence: `README.md`)
- School user → Safety data parsing: parses safety sheets (evidence: `README.md`)
- School user → Codes and tags: maintains safety codes (evidence: `README.md`)
- Label designer → Labels and sharing: manages layouts
- Labels and sharing → PDF generation: requests PDF
- Attachment endpoints → Attachment storage: stores files
- Attachment storage → Local or SMB files: reads and writes (evidence: `README.md`)
- Materials and chemicals → PostgreSQL: reads and writes
- Locations and rooms → PostgreSQL: reads and writes
- Experiments and collections → PostgreSQL: reads and writes
- Codes and tags → PostgreSQL: reads and writes
- Global search → PostgreSQL: searches records
- Material import → PostgreSQL: imports records
- Safety data parsing → PostgreSQL: stores parsed data
- PDF generation → School user: returns PDF
- Edit locking → PostgreSQL: reads and writes locks (evidence: `server/utils/editLocks.ts`)
- API rate limiting → PostgreSQL: —
- Daily cleanup → PostgreSQL: cleans expired data
- Microsoft identity → Nuxt interface: authenticates users
