# valentingues/coach-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/valentingues/coach-dashboard
- Repository: https://github.com/valentingues/coach-dashboard

## Overview

CoachPro is a coach/client fitness dashboard. Users register or log in, then coaches manage clients, schedules, training and communication, while clients track sessions, nutrition and progress. The frontend routes authenticated users to role-aware dashboards and calls a backend API; the backend handles domain requests against a database. The README is only a Vite template and documents no product capabilities. Several feature components and server code are indexed but not fully excerpted, so only explicit routing, imports, and visible API calls are connected here.

Main entry points: [`src/pages/Dashboard.tsx`](https://github.com/valentingues/coach-dashboard/blob/main/src/pages/Dashboard.tsx) (Role dashboard), [`src/App.tsx`](https://github.com/valentingues/coach-dashboard/blob/main/src/App.tsx) (Routes and session), [`src/pages/AuthPage.tsx`](https://github.com/valentingues/coach-dashboard/blob/main/src/pages/AuthPage.tsx) (Sign-in and registration), [`api_backend/app.js`](https://github.com/valentingues/coach-dashboard/blob/main/api_backend/app.js) (API routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry and access"]
  node_main["Frontend bootstrap<br/>[main.tsx]"]
  node_app["Routes and session<br/>[App.tsx]"]
  node_auth["Sign-in and registration<br/>[AuthPage.tsx]"]
  node_login["Login form<br/>[LoginForm.tsx]"]
  node_register["Registration form<br/>[RegisterForm.tsx]"]
end

subgraph group_coach["Coach management"]
  node_dashboard["Role dashboard<br/>[Dashboard.tsx]"]
  node_clients["Client roster<br/>[ClientsList.tsx]"]
  node_clientview["Client overview"]
  node_calendar["Calendar<br/>[CalendarView.tsx]"]
  node_chat["Coach-client chat<br/>[ChatView.tsx]"]
  node_settings["Account settings"]
  node_admin["Admin area<br/>[AdminPage.tsx]"]
  node_adminex["Exercise catalog admin"]
  node_adminfood["Food catalog admin<br/>[AdminFoodsPage.tsx]"]
end

subgraph group_client["Client tracking"]
  node_session["Active training session"]
  node_nutrition["Nutrition tracker"]
end

subgraph group_service["API and persistence"]
  node_server["API routes<br/>[app.js]"]
  node_db[("Application database<br/>[database.js]")]
  node_prodserver["Production server<br/>[prod_server.js]"]
end

node_user(("User"))

node_user -->|"opens app"| node_main
node_main -->|"renders"| node_app
node_app -->|"routes to"| node_auth
node_app -->|"routes to"| node_dashboard
node_auth -->|"renders"| node_login
node_auth -->|"renders"| node_register
node_register -.->|"passes login"| node_app
node_login -.->|"passes login"| node_app
node_dashboard -->|"renders"| node_clients
node_dashboard -->|"renders"| node_calendar
node_dashboard -->|"renders"| node_chat
node_dashboard -->|"renders"| node_clientview
node_dashboard -->|"renders"| node_session
node_dashboard -->|"renders"| node_nutrition
node_dashboard -->|"renders"| node_settings
node_clientview -->|"renders"| node_nutrition
node_clients -->|"requests client link"| node_server
node_user -.->|"uses API"| node_server
node_server -->|"queries"| node_db
node_prodserver -->|"references"| node_db
node_app -->|"routes to"| node_admin
node_app -->|"routes to"| node_adminex
node_app -->|"routes to"| node_adminfood

click node_main "https://github.com/valentingues/coach-dashboard/blob/main/src/main.tsx"
click node_app "https://github.com/valentingues/coach-dashboard/blob/main/src/App.tsx"
click node_auth "https://github.com/valentingues/coach-dashboard/blob/main/src/pages/AuthPage.tsx"
click node_login "https://github.com/valentingues/coach-dashboard/blob/main/src/components/Auth/LoginForm.tsx"
click node_register "https://github.com/valentingues/coach-dashboard/blob/main/src/components/Auth/RegisterForm.tsx"
click node_dashboard "https://github.com/valentingues/coach-dashboard/blob/main/src/pages/Dashboard.tsx"
click node_clients "https://github.com/valentingues/coach-dashboard/blob/main/src/components/Dashboard/ClientsList.tsx"
click node_clientview "https://github.com/valentingues/coach-dashboard/blob/main/src/components/Dashboard/ClientDashboardView.tsx"
click node_calendar "https://github.com/valentingues/coach-dashboard/blob/main/src/components/Dashboard/CalendarView.tsx"
click node_chat "https://github.com/valentingues/coach-dashboard/blob/main/src/components/Dashboard/ChatView.tsx"
click node_settings "https://github.com/valentingues/coach-dashboard/blob/main/src/components/Dashboard/AccountSettingsView.tsx"
click node_admin "https://github.com/valentingues/coach-dashboard/blob/main/src/pages/AdminPage.tsx"
click node_adminex "https://github.com/valentingues/coach-dashboard/blob/main/src/pages/AdminExercisesPage.tsx"
click node_adminfood "https://github.com/valentingues/coach-dashboard/blob/main/src/pages/AdminFoodsPage.tsx"
click node_session "https://github.com/valentingues/coach-dashboard/blob/main/src/components/Dashboard/ActiveSessionView.tsx"
click node_nutrition "https://github.com/valentingues/coach-dashboard/blob/main/src/components/Dashboard/NutritionTrackerView.tsx"
click node_server "https://github.com/valentingues/coach-dashboard/blob/main/api_backend/app.js"
click node_db "https://github.com/valentingues/coach-dashboard/blob/main/api_backend/database.js"
click node_prodserver "https://github.com/valentingues/coach-dashboard/blob/main/prod_server.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_main,node_app,node_auth,node_login,node_register,node_user toneBlue
class node_dashboard,node_clients,node_clientview,node_calendar,node_chat,node_settings,node_admin,node_adminex,node_adminfood toneAmber
class node_session,node_nutrition toneMint
class node_server,node_db,node_prodserver toneRose
```

## Components

### App entry and access

- [Frontend bootstrap](https://github.com/valentingues/coach-dashboard/blob/main/src/main.tsx): `src/main.tsx`
- [Routes and session](https://github.com/valentingues/coach-dashboard/blob/main/src/App.tsx): `src/App.tsx`
- [Sign-in and registration](https://github.com/valentingues/coach-dashboard/blob/main/src/pages/AuthPage.tsx): `src/pages/AuthPage.tsx`
- [Login form](https://github.com/valentingues/coach-dashboard/blob/main/src/components/Auth/LoginForm.tsx): `src/components/Auth/LoginForm.tsx`
- [Registration form](https://github.com/valentingues/coach-dashboard/blob/main/src/components/Auth/RegisterForm.tsx): `src/components/Auth/RegisterForm.tsx`

### Coach management

- [Role dashboard](https://github.com/valentingues/coach-dashboard/blob/main/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`
- [Client roster](https://github.com/valentingues/coach-dashboard/blob/main/src/components/Dashboard/ClientsList.tsx): `src/components/Dashboard/ClientsList.tsx`
- [Client overview](https://github.com/valentingues/coach-dashboard/blob/main/src/components/Dashboard/ClientDashboardView.tsx): `src/components/Dashboard/ClientDashboardView.tsx`
- [Calendar](https://github.com/valentingues/coach-dashboard/blob/main/src/components/Dashboard/CalendarView.tsx): `src/components/Dashboard/CalendarView.tsx`
- [Coach-client chat](https://github.com/valentingues/coach-dashboard/blob/main/src/components/Dashboard/ChatView.tsx): `src/components/Dashboard/ChatView.tsx`
- [Account settings](https://github.com/valentingues/coach-dashboard/blob/main/src/components/Dashboard/AccountSettingsView.tsx): `src/components/Dashboard/AccountSettingsView.tsx`
- [Admin area](https://github.com/valentingues/coach-dashboard/blob/main/src/pages/AdminPage.tsx): `src/pages/AdminPage.tsx`
- [Exercise catalog admin](https://github.com/valentingues/coach-dashboard/blob/main/src/pages/AdminExercisesPage.tsx): `src/pages/AdminExercisesPage.tsx`
- [Food catalog admin](https://github.com/valentingues/coach-dashboard/blob/main/src/pages/AdminFoodsPage.tsx): `src/pages/AdminFoodsPage.tsx`

### Client tracking

- [Active training session](https://github.com/valentingues/coach-dashboard/blob/main/src/components/Dashboard/ActiveSessionView.tsx): `src/components/Dashboard/ActiveSessionView.tsx`
- [Nutrition tracker](https://github.com/valentingues/coach-dashboard/blob/main/src/components/Dashboard/NutritionTrackerView.tsx): `src/components/Dashboard/NutritionTrackerView.tsx`

### API and persistence

- [API routes](https://github.com/valentingues/coach-dashboard/blob/main/api_backend/app.js): `api_backend/app.js`
- [Application database](https://github.com/valentingues/coach-dashboard/blob/main/api_backend/database.js): `api_backend/database.js`
- [Production server](https://github.com/valentingues/coach-dashboard/blob/main/prod_server.js): `prod_server.js`

### Other components

- **User**

## Connections

- User → Frontend bootstrap: opens app (evidence: `src/main.tsx`)
- Frontend bootstrap → Routes and session: renders (evidence: `src/main.tsx`)
- Routes and session → Sign-in and registration: routes to (evidence: `src/App.tsx`)
- Routes and session → Role dashboard: routes to (evidence: `src/App.tsx`)
- Sign-in and registration → Login form: renders (evidence: `src/pages/AuthPage.tsx`)
- Sign-in and registration → Registration form: renders (evidence: `src/pages/AuthPage.tsx`)
- Registration form → Routes and session: passes login
- Login form → Routes and session: passes login
- Role dashboard → Client roster: renders (evidence: `src/pages/Dashboard.tsx`)
- Role dashboard → Calendar: renders (evidence: `src/pages/Dashboard.tsx`)
- Role dashboard → Coach-client chat: renders (evidence: `src/pages/Dashboard.tsx`)
- Role dashboard → Client overview: renders (evidence: `src/pages/Dashboard.tsx`)
- Role dashboard → Active training session: renders (evidence: `src/pages/Dashboard.tsx`)
- Role dashboard → Nutrition tracker: renders (evidence: `src/pages/Dashboard.tsx`)
- Role dashboard → Account settings: renders (evidence: `src/pages/Dashboard.tsx`)
- Client overview → Nutrition tracker: renders (evidence: `src/components/Dashboard/ClientDashboardView.tsx`)
- Client roster → API routes: requests client link (evidence: `src/components/Dashboard/ClientsList.tsx`)
- User → API routes: uses API
- API routes → Application database: queries (evidence: `api_backend/app.js`)
- Production server → Application database: references (evidence: `prod_server.js`)
- Routes and session → Admin area: routes to (evidence: `src/App.tsx`)
- Routes and session → Exercise catalog admin: routes to (evidence: `src/App.tsx`)
- Routes and session → Food catalog admin: routes to (evidence: `src/App.tsx`)
