# stephen-t-2023/vigil architecture

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

- Interactive diagram: https://gitdiagram.com/stephen-t-2023/vigil
- Repository: https://github.com/stephen-t-2023/vigil

## Overview

Vigil is a fitness-tracking web app: users enter through a session-aware landing route, then use authenticated pages to log meals, workouts, steps, and weight, configure goals, and review progress. The sampled files show page-level access to Supabase through a shared client, plus shared navigation and loading UI. The README describes only the Next.js starter, so several product capabilities are identified from source-index descriptions; unsampled page behavior is not expanded beyond those descriptions.

Main entry points: [`src/lib/supabaseClient.js`](https://github.com/stephen-t-2023/vigil/blob/main/src/lib/supabaseClient.js) (Supabase client), [`src/components/Skeleton.jsx`](https://github.com/stephen-t-2023/vigil/blob/main/src/components/Skeleton.jsx) (Loading skeleton), [`src/pages/index.js`](https://github.com/stephen-t-2023/vigil/blob/main/src/pages/index.js) (Session redirect), [`src/pages/dashboard.jsx`](https://github.com/stephen-t-2023/vigil/blob/main/src/pages/dashboard.jsx) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and navigation"]
  node_home["Session redirect<br/>[index.js]"]
  node_login["Sign in<br/>[login.jsx]"]
  node_signup["Registration<br/>[signup.jsx]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_privacy["Privacy policy<br/>[privacy.jsx]"]
end

subgraph group_tracking["Fitness tracking"]
  node_dashboard["Dashboard<br/>[dashboard.jsx]"]
  node_calories["Meal tracking<br/>[calories.jsx]"]
  node_steps["Step tracking<br/>[steps.jsx]"]
  node_workouts["Workout logging<br/>[workouts.jsx]"]
  node_weight["Weight tracking<br/>[weight.jsx]"]
end

subgraph group_insights["Goals and insights"]
  node_progress["Progress charts<br/>[progress.jsx]"]
  node_settings["Goals and account<br/>[settings.jsx]"]
end

subgraph group_shared["Shared services and UI"]
  node_supabase_client["Supabase client<br/>[supabaseClient.js]"]
  node_supabase[("Supabase backend")]
  node_skeleton["Loading skeleton<br/>[Skeleton.jsx]"]
  node_footer["Global footer<br/>[Footer.jsx]"]
end

node_user(("User"))

node_user -.->|"opens app"| node_home
node_home -->|"checks session"| node_supabase_client
node_home -->|"routes authenticated"| node_dashboard
node_home -->|"routes unauthenticated"| node_login
node_navbar -->|"checks session"| node_supabase_client
node_navbar -->|"signs out to"| node_login
node_dashboard -->|"reads fitness data"| node_supabase_client
node_calories -->|"manages meals"| node_supabase_client
node_steps -->|"manages steps"| node_supabase_client
node_workouts -->|"manages workouts"| node_supabase_client
node_weight -->|"manages entries"| node_supabase_client
node_progress -->|"loads chart data"| node_supabase_client
node_settings -->|"loads settings"| node_supabase_client
node_supabase_client -->|"creates client"| node_supabase
node_calories -->|"renders loading"| node_skeleton
node_dashboard -->|"renders loading"| node_skeleton
node_steps -->|"renders loading"| node_skeleton
node_workouts -->|"renders loading"| node_skeleton
node_weight -->|"renders loading"| node_skeleton
node_progress -->|"renders loading"| node_skeleton
node_settings -->|"renders loading"| node_skeleton
node_privacy -.-> node_supabase_client
node_login -->|"uses auth"| node_supabase_client
node_signup -->|"uses auth"| node_supabase_client

click node_home "https://github.com/stephen-t-2023/vigil/blob/main/src/pages/index.js"
click node_login "https://github.com/stephen-t-2023/vigil/blob/main/src/pages/login.jsx"
click node_signup "https://github.com/stephen-t-2023/vigil/blob/main/src/pages/signup.jsx"
click node_navbar "https://github.com/stephen-t-2023/vigil/blob/main/src/components/Navbar.jsx"
click node_privacy "https://github.com/stephen-t-2023/vigil/blob/main/src/pages/privacy.jsx"
click node_dashboard "https://github.com/stephen-t-2023/vigil/blob/main/src/pages/dashboard.jsx"
click node_calories "https://github.com/stephen-t-2023/vigil/blob/main/src/pages/calories.jsx"
click node_steps "https://github.com/stephen-t-2023/vigil/blob/main/src/pages/steps.jsx"
click node_workouts "https://github.com/stephen-t-2023/vigil/blob/main/src/pages/workouts.jsx"
click node_weight "https://github.com/stephen-t-2023/vigil/blob/main/src/pages/weight.jsx"
click node_progress "https://github.com/stephen-t-2023/vigil/blob/main/src/pages/progress.jsx"
click node_settings "https://github.com/stephen-t-2023/vigil/blob/main/src/pages/settings.jsx"
click node_supabase_client "https://github.com/stephen-t-2023/vigil/blob/main/src/lib/supabaseClient.js"
click node_skeleton "https://github.com/stephen-t-2023/vigil/blob/main/src/components/Skeleton.jsx"
click node_footer "https://github.com/stephen-t-2023/vigil/blob/main/src/components/Footer.jsx"

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_home,node_login,node_signup,node_navbar,node_privacy,node_user toneBlue
class node_dashboard,node_calories,node_steps,node_workouts,node_weight toneAmber
class node_progress,node_settings toneMint
class node_supabase_client,node_supabase,node_skeleton,node_footer toneRose
```

## Components

### Entry and navigation

- [Session redirect](https://github.com/stephen-t-2023/vigil/blob/main/src/pages/index.js): `src/pages/index.js`
- [Sign in](https://github.com/stephen-t-2023/vigil/blob/main/src/pages/login.jsx): `src/pages/login.jsx`
- [Registration](https://github.com/stephen-t-2023/vigil/blob/main/src/pages/signup.jsx): `src/pages/signup.jsx`
- [Navigation](https://github.com/stephen-t-2023/vigil/blob/main/src/components/Navbar.jsx): `src/components/Navbar.jsx`
- [Privacy policy](https://github.com/stephen-t-2023/vigil/blob/main/src/pages/privacy.jsx): `src/pages/privacy.jsx`

### Fitness tracking

- [Dashboard](https://github.com/stephen-t-2023/vigil/blob/main/src/pages/dashboard.jsx): `src/pages/dashboard.jsx`
- [Meal tracking](https://github.com/stephen-t-2023/vigil/blob/main/src/pages/calories.jsx): `src/pages/calories.jsx`
- [Step tracking](https://github.com/stephen-t-2023/vigil/blob/main/src/pages/steps.jsx): `src/pages/steps.jsx`
- [Workout logging](https://github.com/stephen-t-2023/vigil/blob/main/src/pages/workouts.jsx): `src/pages/workouts.jsx`
- [Weight tracking](https://github.com/stephen-t-2023/vigil/blob/main/src/pages/weight.jsx): `src/pages/weight.jsx`

### Goals and insights

- [Progress charts](https://github.com/stephen-t-2023/vigil/blob/main/src/pages/progress.jsx): `src/pages/progress.jsx`
- [Goals and account](https://github.com/stephen-t-2023/vigil/blob/main/src/pages/settings.jsx): `src/pages/settings.jsx`

### Shared services and UI

- [Supabase client](https://github.com/stephen-t-2023/vigil/blob/main/src/lib/supabaseClient.js): `src/lib/supabaseClient.js`
- **Supabase backend**
- [Loading skeleton](https://github.com/stephen-t-2023/vigil/blob/main/src/components/Skeleton.jsx): `src/components/Skeleton.jsx`
- [Global footer](https://github.com/stephen-t-2023/vigil/blob/main/src/components/Footer.jsx): `src/components/Footer.jsx`

### Other components

- **User**

## Connections

- User → Session redirect: opens app
- Session redirect → Supabase client: checks session (evidence: `src/pages/index.js`)
- Session redirect → Dashboard: routes authenticated (evidence: `src/pages/index.js`)
- Session redirect → Sign in: routes unauthenticated (evidence: `src/pages/index.js`)
- Navigation → Supabase client: checks session (evidence: `src/components/Navbar.jsx`)
- Navigation → Sign in: signs out to (evidence: `src/components/Navbar.jsx`)
- Dashboard → Supabase client: reads fitness data (evidence: `src/pages/dashboard.jsx`)
- Meal tracking → Supabase client: manages meals (evidence: `src/pages/calories.jsx`)
- Step tracking → Supabase client: manages steps (evidence: `src/pages/steps.jsx`)
- Workout logging → Supabase client: manages workouts (evidence: `src/pages/workouts.jsx`)
- Weight tracking → Supabase client: manages entries (evidence: `src/pages/weight.jsx`)
- Progress charts → Supabase client: loads chart data (evidence: `src/pages/progress.jsx`)
- Goals and account → Supabase client: loads settings (evidence: `src/pages/settings.jsx`)
- Supabase client → Supabase backend: creates client (evidence: `src/lib/supabaseClient.js`)
- Meal tracking → Loading skeleton: renders loading (evidence: `src/pages/calories.jsx`)
- Dashboard → Loading skeleton: renders loading (evidence: `src/pages/dashboard.jsx`)
- Step tracking → Loading skeleton: renders loading (evidence: `src/pages/steps.jsx`)
- Workout logging → Loading skeleton: renders loading (evidence: `src/pages/workouts.jsx`)
- Weight tracking → Loading skeleton: renders loading (evidence: `src/pages/weight.jsx`)
- Progress charts → Loading skeleton: renders loading (evidence: `src/pages/progress.jsx`)
- Goals and account → Loading skeleton: renders loading (evidence: `src/pages/settings.jsx`)
- Privacy policy → Supabase client
- Sign in → Supabase client: uses auth (evidence: `src/pages/login.jsx`)
- Registration → Supabase client: uses auth (evidence: `src/pages/signup.jsx`)
