# tedysuwega/my-dashboard-app architecture

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

- Interactive diagram: https://gitdiagram.com/tedysuwega/my-dashboard-app
- Repository: https://github.com/tedysuwega/my-dashboard-app

## Overview

AdminHub is a demo user-management dashboard with in-memory dummy data, not a database-backed service. An administrator views user records and summary cards, searches and paginates the table, then adds, edits, or deletes users through modal forms; the UI updates local state and displays toast feedback. The frontend fetches the user list and submits mutations to the API, served by Fastify locally or a Vercel function in production. The README documents these runtime modes; relationships to the API handlers are based on that documentation because their source was not excerpted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/App.jsx) (Dashboard App), [`frontend/api/users.js`](https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/api/users.js) (Vercel Users Function), [`frontend/src/components/AddUserModal.jsx`](https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/components/AddUserModal.jsx) (Add User Form), [`frontend/src/components/EditUserModal.jsx`](https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/components/EditUserModal.jsx) (Edit User Form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard UI"]
  node_app["Dashboard App<br/>[App.jsx]"]
  node_sidebar["Sidebar Navigation<br/>[Sidebar.jsx]"]
  node_header["Dashboard Header<br/>[Header.jsx]"]
  node_stats["User Statistics<br/>[StatsGrid.jsx]"]
end

subgraph group_user_ops["User Operations"]
  node_table["User Table<br/>[UserTable.jsx]"]
  node_users_hook["User Data Hook<br/>[useUsers.js]"]
  node_add_modal["Add User Form<br/>[AddUserModal.jsx]"]
  node_edit_modal["Edit User Form<br/>[EditUserModal.jsx]"]
  node_delete_modal["Delete Confirmation"]
end

subgraph group_api["API Services"]
  node_local_api["Local Fastify API<br/>[server.js]"]
  node_vercel_api["Vercel Users Function<br/>[users.js]"]
  node_root_api["Root Users Function<br/>[users.js]"]
end

subgraph group_feedback["Feedback"]
  node_toast_hook["Toast State Hook<br/>[useToast.js]"]
  node_toast_view["Toast Notifications<br/>[Toast.jsx]"]
end

node_admin(("Administrator"))

node_admin -->|"uses dashboard"| node_app
node_app -->|"renders"| node_sidebar
node_app -->|"renders"| node_header
node_app -->|"renders"| node_stats
node_app -->|"renders"| node_table
node_app -->|"renders"| node_add_modal
node_app -->|"renders"| node_edit_modal
node_app -->|"renders"| node_delete_modal
node_app -->|"loads and manages"| node_users_hook
node_app -->|"uses notifications"| node_toast_hook
node_app -->|"renders"| node_toast_view
node_app -->|"passes user count"| node_header
node_app -->|"passes users"| node_stats
node_app -->|"passes users and actions"| node_table
node_table -->|"dispatches add edit delete"| node_app
node_add_modal -->|"returns new user"| node_app
node_edit_modal -->|"returns updated user"| node_app
node_delete_modal -->|"returns deleted user"| node_app
node_add_modal -->|"posts user"| node_vercel_api
node_edit_modal -->|"updates user"| node_vercel_api
node_delete_modal -->|"deletes user"| node_vercel_api
node_users_hook -->|"fetches users"| node_vercel_api
node_users_hook -->|"fetches users locally"| node_local_api
node_add_modal -.->|"posts locally"| node_local_api
node_edit_modal -.->|"updates locally"| node_local_api
node_delete_modal -.->|"deletes locally"| node_local_api
node_app -->|"adds action feedback"| node_toast_hook
node_toast_hook -->|"provides toast state"| node_toast_view
node_vercel_api -.->|"deployment relationship unclear"| node_root_api

click node_app "https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/App.jsx"
click node_sidebar "https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/components/Sidebar.jsx"
click node_header "https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/components/Header.jsx"
click node_stats "https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/components/StatsGrid.jsx"
click node_table "https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/components/UserTable.jsx"
click node_users_hook "https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/hooks/useUsers.js"
click node_add_modal "https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/components/AddUserModal.jsx"
click node_edit_modal "https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/components/EditUserModal.jsx"
click node_delete_modal "https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/components/DeleteConfirmModal.jsx"
click node_toast_hook "https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/hooks/useToast.js"
click node_toast_view "https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/components/Toast.jsx"
click node_local_api "https://github.com/tedysuwega/my-dashboard-app/blob/main/backend/server.js"
click node_vercel_api "https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/api/users.js"
click node_root_api "https://github.com/tedysuwega/my-dashboard-app/blob/main/api/users.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_sidebar,node_header,node_stats toneBlue
class node_table,node_users_hook,node_add_modal,node_edit_modal,node_delete_modal toneAmber
class node_local_api,node_vercel_api,node_root_api toneMint
class node_toast_hook,node_toast_view toneRose
class node_admin toneIndigo
```

## Components

### Dashboard UI

- [Dashboard App](https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sidebar Navigation](https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/components/Sidebar.jsx): `frontend/src/components/Sidebar.jsx`
- [Dashboard Header](https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/components/Header.jsx): `frontend/src/components/Header.jsx`
- [User Statistics](https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/components/StatsGrid.jsx): `frontend/src/components/StatsGrid.jsx`

### User Operations

- [User Table](https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/components/UserTable.jsx): `frontend/src/components/UserTable.jsx`
- [User Data Hook](https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/hooks/useUsers.js): `frontend/src/hooks/useUsers.js`
- [Add User Form](https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/components/AddUserModal.jsx): `frontend/src/components/AddUserModal.jsx`
- [Edit User Form](https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/components/EditUserModal.jsx): `frontend/src/components/EditUserModal.jsx`
- [Delete Confirmation](https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/components/DeleteConfirmModal.jsx): `frontend/src/components/DeleteConfirmModal.jsx`

### API Services

- [Local Fastify API](https://github.com/tedysuwega/my-dashboard-app/blob/main/backend/server.js): `backend/server.js`
- [Vercel Users Function](https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/api/users.js): `frontend/api/users.js`
- [Root Users Function](https://github.com/tedysuwega/my-dashboard-app/blob/main/api/users.js): `api/users.js`

### Feedback

- [Toast State Hook](https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/hooks/useToast.js): `frontend/src/hooks/useToast.js`
- [Toast Notifications](https://github.com/tedysuwega/my-dashboard-app/blob/main/frontend/src/components/Toast.jsx): `frontend/src/components/Toast.jsx`

### Other components

- **Administrator**

## Connections

- Administrator → Dashboard App: uses dashboard (evidence: `README.md`)
- Dashboard App → Sidebar Navigation: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → Dashboard Header: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → User Statistics: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → User Table: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → Add User Form: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → Edit User Form: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → Delete Confirmation: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → User Data Hook: loads and manages (evidence: `frontend/src/App.jsx`)
- Dashboard App → Toast State Hook: uses notifications (evidence: `frontend/src/App.jsx`)
- Dashboard App → Toast Notifications: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → Dashboard Header: passes user count (evidence: `frontend/src/App.jsx`)
- Dashboard App → User Statistics: passes users (evidence: `frontend/src/App.jsx`)
- Dashboard App → User Table: passes users and actions (evidence: `frontend/src/App.jsx`)
- User Table → Dashboard App: dispatches add edit delete (evidence: `frontend/src/App.jsx`)
- Add User Form → Dashboard App: returns new user (evidence: `frontend/src/App.jsx`)
- Edit User Form → Dashboard App: returns updated user (evidence: `frontend/src/App.jsx`)
- Delete Confirmation → Dashboard App: returns deleted user (evidence: `frontend/src/App.jsx`)
- Add User Form → Vercel Users Function: posts user (evidence: `frontend/src/components/AddUserModal.jsx`)
- Edit User Form → Vercel Users Function: updates user (evidence: `frontend/src/components/EditUserModal.jsx`)
- Delete Confirmation → Vercel Users Function: deletes user (evidence: `frontend/src/components/DeleteConfirmModal.jsx`)
- User Data Hook → Vercel Users Function: fetches users (evidence: `frontend/src/hooks/useUsers.js`)
- User Data Hook → Local Fastify API: fetches users locally (evidence: `README.md`)
- Add User Form → Local Fastify API: posts locally
- Edit User Form → Local Fastify API: updates locally
- Delete Confirmation → Local Fastify API: deletes locally
- Dashboard App → Toast State Hook: adds action feedback (evidence: `frontend/src/App.jsx`)
- Toast State Hook → Toast Notifications: provides toast state (evidence: `frontend/src/App.jsx`)
- Vercel Users Function → Root Users Function: deployment relationship unclear
