# 2minstudio/fuel-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/2minstudio/fuel-frontend
- Repository: https://github.com/2minstudio/fuel-frontend

## Overview

This is a clinic-management web application for staff and patients, covering appointment scheduling, patient records, billing, reporting, and clinic configuration. The central staff workflow opens the dashboard calendar, selects a clinic and date, and works with appointments and their detail drawer; appointment and billing actions are represented as distinct domain stages. Shared helpers handle API access and session/location state. The README confirms that Next.js API routes are exposed under `/api/*`. Several API and page implementations were not sampled, so uncertain connections are omitted.

Main entry points: [`helpers/utils.js`](https://github.com/2minstudio/fuel-frontend/blob/stage/helpers/utils.js) (API helpers), [`components/calender/newCalendar.js`](https://github.com/2minstudio/fuel-frontend/blob/stage/components/calender/newCalendar.js) (Calendar view), [`components/dashboard/loadChindren.js`](https://github.com/2minstudio/fuel-frontend/blob/stage/components/dashboard/loadChindren.js) (Appointment actions), [`helpers/crud.js`](https://github.com/2minstudio/fuel-frontend/blob/stage/helpers/crud.js) (CRUD helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scheduling["Scheduling"]
  node_dashboard["Dashboard page<br/>[index.js]"]
  node_calendar["Calendar view<br/>[newCalendar.js]"]
  node_appointment_drawer["Appointment drawer<br/>[rightDrawer.js]"]
  node_appointment_actions["Appointment actions<br/>[loadChindren.js]"]
  node_appointment_status["Status changes<br/>[changestatus.js]"]
end

subgraph group_patient["Patient care"]
  node_patient_pages["Patient pages<br/>[index.js]"]
  node_patient_search["Patient search<br/>[searchbar.js]"]
  node_patient_list["Patient list<br/>[list.js]"]
  node_patient_profile["Patient profile<br/>[&#91;id&#93;.js]"]
end

subgraph group_billing["Billing"]
  node_collection["Payment collection<br/>[collect.js]"]
  node_billing_views["Billing views<br/>[billingitem.js]"]
  node_payment_views["Payment views<br/>[payment.js]"]
end

subgraph group_platform["Application platform"]
  node_api_routes["Application API routes"]
  node_api_helpers["API helpers<br/>[utils.js]"]
  node_crud_helpers["CRUD helpers<br/>[crud.js]"]
  node_session_helpers["Session and location<br/>[otherUtils.js]"]
  node_app_state["Shared UI state<br/>[state.js]"]
end

subgraph group_operations["Clinic operations"]
  node_reports["Reports<br/>[detailReports.js]"]
  node_settings["Clinic settings<br/>[index.js]"]
end

node_staff(("Clinic staff"))
node_external_api(("Configured API service"))

node_staff -->|"opens"| node_dashboard
node_dashboard -->|"renders"| node_calendar
node_calendar -->|"opens"| node_appointment_drawer
node_appointment_drawer -->|"renders"| node_appointment_actions
node_appointment_actions -->|"uses"| node_appointment_status
node_staff -.->|"opens"| node_patient_pages
node_patient_pages -->|"uses"| node_api_helpers
node_staff -.->|"searches"| node_patient_search
node_patient_search -->|"fetches patients"| node_api_helpers
node_patient_search -->|"renders"| node_patient_list
node_staff -.->|"opens"| node_patient_profile
node_appointment_actions -->|"updates"| node_app_state
node_appointment_actions -->|"loads appointment"| node_api_helpers
node_calendar -->|"loads patient"| node_api_helpers
node_calendar -->|"deletes item"| node_crud_helpers
node_staff -.->|"collects payment"| node_collection
node_collection -->|"creates or updates"| node_api_helpers
node_billing_views -->|"uses"| node_crud_helpers
node_payment_views -->|"uses"| node_api_helpers
node_staff -.->|"views"| node_reports
node_staff -.->|"configures clinic"| node_settings
node_api_helpers -->|"posts to"| node_api_routes
node_api_routes -.->|"serves requests"| node_external_api
node_crud_helpers -->|"requests data"| node_external_api
node_api_helpers -->|"uses"| node_session_helpers
node_crud_helpers -->|"gets auth token"| node_session_helpers
node_appointment_status -->|"uses"| node_app_state

click node_dashboard "https://github.com/2minstudio/fuel-frontend/blob/stage/pages/dashboard/index.js"
click node_calendar "https://github.com/2minstudio/fuel-frontend/blob/stage/components/calender/newCalendar.js"
click node_appointment_drawer "https://github.com/2minstudio/fuel-frontend/blob/stage/components/dashboard/rightDrawer.js"
click node_appointment_actions "https://github.com/2minstudio/fuel-frontend/blob/stage/components/dashboard/loadChindren.js"
click node_appointment_status "https://github.com/2minstudio/fuel-frontend/blob/stage/components/appointment/changestatus.js"
click node_patient_pages "https://github.com/2minstudio/fuel-frontend/blob/stage/pages/patients/index.js"
click node_patient_search "https://github.com/2minstudio/fuel-frontend/blob/stage/components/global/searchbar.js"
click node_patient_list "https://github.com/2minstudio/fuel-frontend/blob/stage/components/patient/list.js"
click node_patient_profile "https://github.com/2minstudio/fuel-frontend/blob/stage/pages/patient/%5Bid%5D.js"
click node_collection "https://github.com/2minstudio/fuel-frontend/blob/stage/components/form/collect.js"
click node_billing_views "https://github.com/2minstudio/fuel-frontend/blob/stage/components/billing/billingitem.js"
click node_payment_views "https://github.com/2minstudio/fuel-frontend/blob/stage/components/billing/payment.js"
click node_reports "https://github.com/2minstudio/fuel-frontend/blob/stage/components/report/detailReports.js"
click node_settings "https://github.com/2minstudio/fuel-frontend/blob/stage/pages/dashboard/settings/index.js"
click node_api_routes "https://github.com/2minstudio/fuel-frontend/tree/stage/pages/api"
click node_api_helpers "https://github.com/2minstudio/fuel-frontend/blob/stage/helpers/utils.js"
click node_crud_helpers "https://github.com/2minstudio/fuel-frontend/blob/stage/helpers/crud.js"
click node_session_helpers "https://github.com/2minstudio/fuel-frontend/blob/stage/helpers/otherUtils.js"
click node_app_state "https://github.com/2minstudio/fuel-frontend/blob/stage/helpers/state.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_dashboard,node_calendar,node_appointment_drawer,node_appointment_actions,node_appointment_status toneBlue
class node_patient_pages,node_patient_search,node_patient_list,node_patient_profile toneAmber
class node_collection,node_billing_views,node_payment_views,node_external_api toneMint
class node_api_routes,node_api_helpers,node_crud_helpers,node_session_helpers,node_app_state toneRose
class node_reports,node_settings,node_staff toneIndigo
```

## Components

### Scheduling

- [Dashboard page](https://github.com/2minstudio/fuel-frontend/blob/stage/pages/dashboard/index.js): `pages/dashboard/index.js`
- [Calendar view](https://github.com/2minstudio/fuel-frontend/blob/stage/components/calender/newCalendar.js): `components/calender/newCalendar.js`
- [Appointment drawer](https://github.com/2minstudio/fuel-frontend/blob/stage/components/dashboard/rightDrawer.js): `components/dashboard/rightDrawer.js`
- [Appointment actions](https://github.com/2minstudio/fuel-frontend/blob/stage/components/dashboard/loadChindren.js): `components/dashboard/loadChindren.js`
- [Status changes](https://github.com/2minstudio/fuel-frontend/blob/stage/components/appointment/changestatus.js): `components/appointment/changestatus.js`

### Patient care

- [Patient pages](https://github.com/2minstudio/fuel-frontend/blob/stage/pages/patients/index.js): `pages/patients/index.js`
- [Patient search](https://github.com/2minstudio/fuel-frontend/blob/stage/components/global/searchbar.js): `components/global/searchbar.js`
- [Patient list](https://github.com/2minstudio/fuel-frontend/blob/stage/components/patient/list.js): `components/patient/list.js`
- [Patient profile](https://github.com/2minstudio/fuel-frontend/blob/stage/pages/patient/%5Bid%5D.js): `pages/patient/[id].js`

### Billing

- [Payment collection](https://github.com/2minstudio/fuel-frontend/blob/stage/components/form/collect.js): `components/form/collect.js`
- [Billing views](https://github.com/2minstudio/fuel-frontend/blob/stage/components/billing/billingitem.js): `components/billing/billingitem.js`
- [Payment views](https://github.com/2minstudio/fuel-frontend/blob/stage/components/billing/payment.js): `components/billing/payment.js`

### Application platform

- [Application API routes](https://github.com/2minstudio/fuel-frontend/tree/stage/pages/api): `pages/api`
- [API helpers](https://github.com/2minstudio/fuel-frontend/blob/stage/helpers/utils.js): `helpers/utils.js`
- [CRUD helpers](https://github.com/2minstudio/fuel-frontend/blob/stage/helpers/crud.js): `helpers/crud.js`
- [Session and location](https://github.com/2minstudio/fuel-frontend/blob/stage/helpers/otherUtils.js): `helpers/otherUtils.js`
- [Shared UI state](https://github.com/2minstudio/fuel-frontend/blob/stage/helpers/state.js): `helpers/state.js`

### Clinic operations

- [Reports](https://github.com/2minstudio/fuel-frontend/blob/stage/components/report/detailReports.js): `components/report/detailReports.js`
- [Clinic settings](https://github.com/2minstudio/fuel-frontend/blob/stage/pages/dashboard/settings/index.js): `pages/dashboard/settings/index.js`

### Other components

- **Clinic staff**
- **Configured API service**

## Connections

- Clinic staff → Dashboard page: opens (evidence: `pages/dashboard/index.js`)
- Dashboard page → Calendar view: renders (evidence: `pages/dashboard/index.js`)
- Calendar view → Appointment drawer: opens (evidence: `components/calender/newCalendar.js`)
- Appointment drawer → Appointment actions: renders (evidence: `components/dashboard/rightDrawer.js`)
- Appointment actions → Status changes: uses (evidence: `components/dashboard/loadChindren.js`)
- Clinic staff → Patient pages: opens
- Patient pages → API helpers: uses (evidence: `pages/patients/index.js`)
- Clinic staff → Patient search: searches
- Patient search → API helpers: fetches patients (evidence: `components/global/searchbar.js`)
- Patient search → Patient list: renders (evidence: `components/global/searchbar.js`)
- Clinic staff → Patient profile: opens
- Appointment actions → Shared UI state: updates (evidence: `components/dashboard/loadChindren.js`)
- Appointment actions → API helpers: loads appointment (evidence: `components/dashboard/loadChindren.js`)
- Calendar view → API helpers: loads patient (evidence: `components/calender/newCalendar.js`)
- Calendar view → CRUD helpers: deletes item (evidence: `components/calender/newCalendar.js`)
- Clinic staff → Payment collection: collects payment
- Payment collection → API helpers: creates or updates (evidence: `components/form/collect.js`)
- Billing views → CRUD helpers: uses (evidence: `components/billing/billingitem.js`)
- Payment views → API helpers: uses (evidence: `components/billing/payment.js`)
- Clinic staff → Reports: views
- Clinic staff → Clinic settings: configures clinic
- API helpers → Application API routes: posts to (evidence: `helpers/utils.js`)
- Application API routes → Configured API service: serves requests
- CRUD helpers → Configured API service: requests data (evidence: `helpers/crud.js`)
- API helpers → Session and location: uses (evidence: `helpers/utils.js`)
- CRUD helpers → Session and location: gets auth token (evidence: `helpers/crud.js`)
- Status changes → Shared UI state: uses (evidence: `components/appointment/changestatus.js`)
