# zakyprojects/ascendday architecture

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

- Interactive diagram: https://gitdiagram.com/zakyprojects/ascendday
- Repository: https://github.com/zakyprojects/ascendday

## Overview

AscendDay is a gamified self-improvement app. Users enter through the app shell, authenticate or continue with a session, choose a tracking or planning area, record activity, and see progress reflected in their saved state. The tree also shows leagues, accountability partners, focus tools, and public feature pages. The README is empty; some domain components are represented by their enclosing directories because their implementation was not sampled. Edges are limited to relationships visible in the excerpts or SOURCE INDEX.

Main entry points: [`src/App.tsx`](https://github.com/zakyprojects/ascendday/blob/main/src/App.tsx) (App orchestration), [`src/lib/store/store.ts`](https://github.com/zakyprojects/ascendday/blob/main/src/lib/store/store.ts) (App state), [`src/lib/time/clock.ts`](https://github.com/zakyprojects/ascendday/blob/main/src/lib/time/clock.ts) (Trusted clock), [`src/lib/auth/supabase.ts`](https://github.com/zakyprojects/ascendday/blob/main/src/lib/auth/supabase.ts) (Authentication and persistence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App entry and navigation"]
  node_entry["Browser entry<br/>[main.tsx]"]
  node_app_shell["App orchestration<br/>[App.tsx]"]
  node_routing["Page routes<br/>[routes.ts]"]
  node_auth_ui["Sign-in experience<br/>[AuthPage.tsx]"]
end

subgraph group_tracking["Growth tracking"]
  node_views["Tracking and planning views"]
  node_habit_actions["Habit actions<br/>[useHabitActions.ts]"]
  node_time_actions["Time tracking actions"]
  node_points["Points and awards<br/>[stateAwards.ts]"]
  node_leagues["League standings"]
  node_partners["Accountability partnerships<br/>[pactLifecycle.ts]"]
  node_focus["Focus sessions"]
end

subgraph group_services["State and services"]
  node_store["App state<br/>[store.ts]"]
  node_remote_auth["Authentication and persistence<br/>[supabase.ts]"]
  node_offline["Offline status<br/>[deviceOffline.ts]"]
  node_clock["Trusted clock<br/>[clock.ts]"]
  node_dates["Date and streak logic<br/>[dates.ts]"]
  node_push["Push notifications<br/>[push.ts]"]
  node_push_service["Push delivery function<br/>[index.ts]"]
end

subgraph group_public["Public site"]
  node_marketing_routes["Public page routes<br/>[routes.ts]"]
  node_feature_catalog["Feature catalog<br/>[catalog.ts]"]
  node_feedback["Feedback endpoint<br/>[feedback.ts]"]
end

node_user(("User"))

node_user -->|"opens app"| node_entry
node_entry -->|"renders"| node_app_shell
node_app_shell -->|"resolves paths"| node_routing
node_app_shell -->|"uses state"| node_store
node_app_shell -->|"loads sign-in"| node_auth_ui
node_app_shell -->|"renders selected view"| node_views
node_store -->|"loads and saves"| node_remote_auth
node_store -->|"checks connectivity"| node_offline
node_store -->|"uses date logic"| node_dates
node_remote_auth -->|"parses standings"| node_leagues
node_clock -->|"checks connectivity"| node_offline
node_clock -->|"reads server time"| node_remote_auth
node_dates -->|"uses trusted time"| node_clock
node_time_actions -->|"uses day keys"| node_dates
node_time_actions -->|"gets current time"| node_clock
node_time_actions -->|"computes awards"| node_points
node_entry -->|"initializes app"| node_push
node_push -->|"uses Supabase"| node_remote_auth
node_user -.->|"visits public pages"| node_marketing_routes
node_marketing_routes -->|"builds feature routes"| node_feature_catalog

click node_entry "https://github.com/zakyprojects/ascendday/blob/main/src/main.tsx"
click node_app_shell "https://github.com/zakyprojects/ascendday/blob/main/src/App.tsx"
click node_routing "https://github.com/zakyprojects/ascendday/blob/main/src/lib/app/routes.ts"
click node_auth_ui "https://github.com/zakyprojects/ascendday/blob/main/src/components/auth/AuthPage.tsx"
click node_views "https://github.com/zakyprojects/ascendday/tree/main/src/components/views"
click node_habit_actions "https://github.com/zakyprojects/ascendday/blob/main/src/lib/actions/useHabitActions.ts"
click node_time_actions "https://github.com/zakyprojects/ascendday/blob/main/src/lib/actions/useTimeTrackerActions.ts"
click node_points "https://github.com/zakyprojects/ascendday/blob/main/src/lib/points/stateAwards.ts"
click node_leagues "https://github.com/zakyprojects/ascendday/blob/main/src/lib/leagues/leagueStandingsRefresh.ts"
click node_partners "https://github.com/zakyprojects/ascendday/blob/main/src/lib/partners/pactLifecycle.ts"
click node_focus "https://github.com/zakyprojects/ascendday/blob/main/src/components/pfc/FocusSessionProvider.tsx"
click node_store "https://github.com/zakyprojects/ascendday/blob/main/src/lib/store/store.ts"
click node_remote_auth "https://github.com/zakyprojects/ascendday/blob/main/src/lib/auth/supabase.ts"
click node_offline "https://github.com/zakyprojects/ascendday/blob/main/src/lib/store/deviceOffline.ts"
click node_clock "https://github.com/zakyprojects/ascendday/blob/main/src/lib/time/clock.ts"
click node_dates "https://github.com/zakyprojects/ascendday/blob/main/src/lib/time/dates.ts"
click node_push "https://github.com/zakyprojects/ascendday/blob/main/src/lib/app/push.ts"
click node_push_service "https://github.com/zakyprojects/ascendday/blob/main/supabase/functions/send-push/index.ts"
click node_marketing_routes "https://github.com/zakyprojects/ascendday/blob/main/src/marketing/routes.ts"
click node_feature_catalog "https://github.com/zakyprojects/ascendday/blob/main/src/marketing/features/catalog.ts"
click node_feedback "https://github.com/zakyprojects/ascendday/blob/main/api/feedback.ts"

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_entry,node_app_shell,node_routing,node_auth_ui,node_user toneBlue
class node_views,node_habit_actions,node_time_actions,node_points,node_leagues,node_partners,node_focus toneAmber
class node_store,node_remote_auth,node_offline,node_clock,node_dates,node_push,node_push_service toneMint
class node_marketing_routes,node_feature_catalog,node_feedback toneRose
```

## Components

### App entry and navigation

- [Browser entry](https://github.com/zakyprojects/ascendday/blob/main/src/main.tsx): `src/main.tsx`
- [App orchestration](https://github.com/zakyprojects/ascendday/blob/main/src/App.tsx): `src/App.tsx`
- [Page routes](https://github.com/zakyprojects/ascendday/blob/main/src/lib/app/routes.ts): `src/lib/app/routes.ts`
- [Sign-in experience](https://github.com/zakyprojects/ascendday/blob/main/src/components/auth/AuthPage.tsx): `src/components/auth/AuthPage.tsx`

### Growth tracking

- [Tracking and planning views](https://github.com/zakyprojects/ascendday/tree/main/src/components/views): `src/components/views`
- [Habit actions](https://github.com/zakyprojects/ascendday/blob/main/src/lib/actions/useHabitActions.ts): `src/lib/actions/useHabitActions.ts`
- [Time tracking actions](https://github.com/zakyprojects/ascendday/blob/main/src/lib/actions/useTimeTrackerActions.ts): `src/lib/actions/useTimeTrackerActions.ts`
- [Points and awards](https://github.com/zakyprojects/ascendday/blob/main/src/lib/points/stateAwards.ts): `src/lib/points/stateAwards.ts`
- [League standings](https://github.com/zakyprojects/ascendday/blob/main/src/lib/leagues/leagueStandingsRefresh.ts): `src/lib/leagues/leagueStandingsRefresh.ts`
- [Accountability partnerships](https://github.com/zakyprojects/ascendday/blob/main/src/lib/partners/pactLifecycle.ts): `src/lib/partners/pactLifecycle.ts`
- [Focus sessions](https://github.com/zakyprojects/ascendday/blob/main/src/components/pfc/FocusSessionProvider.tsx): `src/components/pfc/FocusSessionProvider.tsx`

### State and services

- [App state](https://github.com/zakyprojects/ascendday/blob/main/src/lib/store/store.ts): `src/lib/store/store.ts`
- [Authentication and persistence](https://github.com/zakyprojects/ascendday/blob/main/src/lib/auth/supabase.ts): `src/lib/auth/supabase.ts`
- [Offline status](https://github.com/zakyprojects/ascendday/blob/main/src/lib/store/deviceOffline.ts): `src/lib/store/deviceOffline.ts`
- [Trusted clock](https://github.com/zakyprojects/ascendday/blob/main/src/lib/time/clock.ts): `src/lib/time/clock.ts`
- [Date and streak logic](https://github.com/zakyprojects/ascendday/blob/main/src/lib/time/dates.ts): `src/lib/time/dates.ts`
- [Push notifications](https://github.com/zakyprojects/ascendday/blob/main/src/lib/app/push.ts): `src/lib/app/push.ts`
- [Push delivery function](https://github.com/zakyprojects/ascendday/blob/main/supabase/functions/send-push/index.ts): `supabase/functions/send-push/index.ts`

### Public site

- [Public page routes](https://github.com/zakyprojects/ascendday/blob/main/src/marketing/routes.ts): `src/marketing/routes.ts`
- [Feature catalog](https://github.com/zakyprojects/ascendday/blob/main/src/marketing/features/catalog.ts): `src/marketing/features/catalog.ts`
- [Feedback endpoint](https://github.com/zakyprojects/ascendday/blob/main/api/feedback.ts): `api/feedback.ts`

### Other components

- **User**

## Connections

- User → Browser entry: opens app (evidence: `src/main.tsx`)
- Browser entry → App orchestration: renders (evidence: `src/main.tsx`)
- App orchestration → Page routes: resolves paths (evidence: `src/App.tsx`)
- App orchestration → App state: uses state (evidence: `src/App.tsx`)
- App orchestration → Sign-in experience: loads sign-in (evidence: `src/App.tsx`)
- App orchestration → Tracking and planning views: renders selected view (evidence: `src/App.tsx`)
- App state → Authentication and persistence: loads and saves (evidence: `src/lib/store/store.ts`)
- App state → Offline status: checks connectivity (evidence: `src/lib/store/store.ts`)
- App state → Date and streak logic: uses date logic (evidence: `src/lib/store/store.ts`)
- Authentication and persistence → League standings: parses standings (evidence: `src/lib/auth/supabase.ts`)
- Trusted clock → Offline status: checks connectivity (evidence: `src/lib/time/clock.ts`)
- Trusted clock → Authentication and persistence: reads server time (evidence: `src/lib/time/clock.ts`)
- Date and streak logic → Trusted clock: uses trusted time (evidence: `src/lib/time/dates.ts`)
- Time tracking actions → Date and streak logic: uses day keys (evidence: `src/lib/actions/useTimeTrackerActions.ts`)
- Time tracking actions → Trusted clock: gets current time (evidence: `src/lib/actions/useTimeTrackerActions.ts`)
- Time tracking actions → Points and awards: computes awards (evidence: `src/lib/actions/useTimeTrackerActions.ts`)
- Browser entry → Push notifications: initializes app
- Push notifications → Authentication and persistence: uses Supabase (evidence: `src/lib/app/push.ts`)
- User → Public page routes: visits public pages
- Public page routes → Feature catalog: builds feature routes (evidence: `src/marketing/routes.ts`)
