# shaheem-codes/lost-and-found-dbms- architecture

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

- Interactive diagram: https://gitdiagram.com/shaheem-codes/lost-and-found-dbms-
- Repository: https://github.com/shaheem-codes/lost-and-found-dbms-

## Overview

This is a lost-and-found management frontend backed by an Express API and PostgreSQL. The main workflow is a user browsing or editing records in the UI: app.js uses the API wrapper for CRUD, the server dispatches API requests to entity handlers, and handlers query the database. The dashboard refreshes records into statistics, charts, announcements, and notifications. README documents all 16 entity areas. The tree places handlers at its root, while server.js requires them under ./routes; that mismatch limits confidence in the dispatch links. Frontend config and several named modules were not sampled.

Main entry points: [`server.js`](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/server.js) (Express server), [`db.js`](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/db.js) (Postgres pool), [`app.js`](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/app.js) (UI and dashboard), [`api.js`](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/api.js) (Fetch wrapper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Frontend"]
  node_app["UI and dashboard<br/>[app.js]"]
  node_api_client["Fetch wrapper<br/>[api.js]"]
  node_charts["Dashboard charts<br/>[charts.js]"]
end

subgraph group_api["API service"]
  node_server["Express server<br/>[server.js]"]
  node_pool["Postgres pool<br/>[db.js]"]
end

subgraph group_records["Record domains"]
  node_items["Items<br/>[items.js]"]
  node_lost["Lost reports<br/>[lost_reports.js]"]
  node_found["Found reports<br/>[found_reports.js]"]
  node_claims["Claims<br/>[claims.js]"]
  node_users["Users<br/>[users.js]"]
  node_roles["Roles<br/>[roles.js]"]
  node_departments["Departments<br/>[departments.js]"]
  node_categories["Categories<br/>[categories.js]"]
  node_locations["Locations<br/>[locations.js]"]
  node_status["Item status<br/>[status.js]"]
  node_conditions["Item conditions<br/>[item_condition.js]"]
  node_admins["Admins<br/>[admins.js]"]
  node_audit["Audit logs<br/>[audit_logs.js]"]
end

subgraph group_engagement["Engagement"]
  node_notifications["Notifications<br/>[notifications.js]"]
  node_announcements["Announcements<br/>[announcements.js]"]
  node_feedback["Feedback<br/>[feedback.js]"]
end

node_person(("User"))
node_postgres[("PostgreSQL")]

node_person -->|"uses"| node_app
node_app -->|"requests CRUD"| node_api_client
node_api_client -->|"HTTP requests"| node_server
node_server -.->|"mounts items*"| node_items
node_server -.->|"mounts reports*"| node_lost
node_server -.->|"mounts reports*"| node_found
node_server -.->|"mounts claims*"| node_claims
node_server -.->|"mounts users*"| node_users
node_server -.->|"mounts roles*"| node_roles
node_server -.->|"mounts departments*"| node_departments
node_server -.->|"mounts categories*"| node_categories
node_server -.->|"mounts locations*"| node_locations
node_server -.->|"mounts status*"| node_status
node_server -.->|"mounts conditions*"| node_conditions
node_server -.->|"mounts admins*"| node_admins
node_server -.->|"mounts audit*"| node_audit
node_server -.->|"mounts notifications*"| node_notifications
node_server -.->|"mounts announcements*"| node_announcements
node_server -.->|"mounts feedback*"| node_feedback
node_items -->|"queries"| node_pool
node_found -->|"queries"| node_pool
node_users -->|"queries"| node_pool
node_admins -->|"queries"| node_pool
node_audit -->|"queries"| node_pool
node_announcements -->|"queries"| node_pool
node_feedback -->|"queries"| node_pool
node_pool -->|"reads/writes"| node_postgres
node_app -->|"renders dashboard"| node_charts

click node_app "https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/app.js"
click node_api_client "https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/api.js"
click node_charts "https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/charts.js"
click node_server "https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/server.js"
click node_pool "https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/db.js"
click node_items "https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/items.js"
click node_lost "https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/lost_reports.js"
click node_found "https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/found_reports.js"
click node_claims "https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/claims.js"
click node_users "https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/users.js"
click node_roles "https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/roles.js"
click node_departments "https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/departments.js"
click node_categories "https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/categories.js"
click node_locations "https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/locations.js"
click node_status "https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/status.js"
click node_conditions "https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/item_condition.js"
click node_admins "https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/admins.js"
click node_audit "https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/audit_logs.js"
click node_notifications "https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/notifications.js"
click node_announcements "https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/announcements.js"
click node_feedback "https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/feedback.js"

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_app,node_api_client,node_charts,node_person toneBlue
class node_server,node_pool,node_postgres toneAmber
class node_items,node_lost,node_found,node_claims,node_users,node_roles,node_departments,node_categories,node_locations,node_status,node_conditions,node_admins,node_audit toneMint
class node_notifications,node_announcements,node_feedback toneRose
```

## Components

### Frontend

- [UI and dashboard](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/app.js): `app.js`
- [Fetch wrapper](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/api.js): `api.js`
- [Dashboard charts](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/charts.js): `charts.js`

### API service

- [Express server](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/server.js): `server.js`
- [Postgres pool](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/db.js): `db.js`

### Record domains

- [Items](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/items.js): `items.js`
- [Lost reports](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/lost_reports.js): `lost_reports.js`
- [Found reports](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/found_reports.js): `found_reports.js`
- [Claims](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/claims.js): `claims.js`
- [Users](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/users.js): `users.js`
- [Roles](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/roles.js): `roles.js`
- [Departments](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/departments.js): `departments.js`
- [Categories](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/categories.js): `categories.js`
- [Locations](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/locations.js): `locations.js`
- [Item status](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/status.js): `status.js`
- [Item conditions](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/item_condition.js): `item_condition.js`
- [Admins](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/admins.js): `admins.js`
- [Audit logs](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/audit_logs.js): `audit_logs.js`

### Engagement

- [Notifications](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/notifications.js): `notifications.js`
- [Announcements](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/announcements.js): `announcements.js`
- [Feedback](https://github.com/shaheem-codes/lost-and-found-dbms-/blob/main/feedback.js): `feedback.js`

### Other components

- **User**
- **PostgreSQL**

## Connections

- User → UI and dashboard: uses
- UI and dashboard → Fetch wrapper: requests CRUD
- Fetch wrapper → Express server: HTTP requests
- Express server → Items: mounts items*
- Express server → Lost reports: mounts reports*
- Express server → Found reports: mounts reports*
- Express server → Claims: mounts claims*
- Express server → Users: mounts users*
- Express server → Roles: mounts roles*
- Express server → Departments: mounts departments*
- Express server → Categories: mounts categories*
- Express server → Locations: mounts locations*
- Express server → Item status: mounts status*
- Express server → Item conditions: mounts conditions*
- Express server → Admins: mounts admins*
- Express server → Audit logs: mounts audit*
- Express server → Notifications: mounts notifications*
- Express server → Announcements: mounts announcements*
- Express server → Feedback: mounts feedback*
- Items → Postgres pool: queries
- Found reports → Postgres pool: queries
- Users → Postgres pool: queries
- Admins → Postgres pool: queries
- Audit logs → Postgres pool: queries
- Announcements → Postgres pool: queries
- Feedback → Postgres pool: queries
- Postgres pool → PostgreSQL: reads/writes
- UI and dashboard → Dashboard charts: renders dashboard
