# sidsahoo1203/claude architecture

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

- Interactive diagram: https://gitdiagram.com/sidsahoo1203/claude
- Repository: https://github.com/sidsahoo1203/claude

## Overview

Hourglass is a private, single-user time-logging and reflection app. The user logs completed hours during a server-enforced window, then reviews patterns and adds plans, goals, reflections, and other long-term records. The client routes these features through a cookie-authenticated API; the server applies time, authentication, and permanence rules and persists domain records in MongoDB. Feature coverage follows the README and route registrations; unsampled route internals and their specific storage calls are not asserted.

Main entry points: [`client/src/api.js`](https://github.com/sidsahoo1203/claude/blob/main/client/src/api.js) (API client), [`server/src/app.js`](https://github.com/sidsahoo1203/claude/blob/main/server/src/app.js) (Express API), [`client/src/App.jsx`](https://github.com/sidsahoo1203/claude/blob/main/client/src/App.jsx) (Client routes), [`server/src/services/day.js`](https://github.com/sidsahoo1203/claude/blob/main/server/src/services/day.js) (Day and hour rules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Client routes<br/>[App.jsx]"]
  node_session["Session state<br/>[AuthContext.jsx]"]
  node_clockctx["Server clock state<br/>[ClockContext.jsx]"]
  node_reminders["Logging reminders"]
  node_api_client["API client<br/>[api.js]"]
  node_hour_logging["Hour logging<br/>[LogForm.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_planning["Plans and goals<br/>[Plan.jsx]"]
  node_calendar["Calendar and day view<br/>[Calendar.jsx]"]
  node_categories["Categories<br/>[Categories.jsx]"]
  node_stop_doing["Stop Doing list<br/>[StopDoing.jsx]"]
end

subgraph group_server["API and rules"]
  node_api_server["Express API<br/>[app.js]"]
  node_auth["Authentication<br/>[auth.js]"]
  node_blocks["Day and block logging<br/>[blocks.js]"]
  node_feature_routes["Domain API routes"]
end

subgraph group_reflection["Review and growth"]
  node_reflection_ui["Daily reflection<br/>[Reflection.jsx]"]
  node_weekly_ui["Weekly review<br/>[WeeklyReview.jsx]"]
  node_analytics_ui["Analytics<br/>[Analytics.jsx]"]
  node_export_ui["Data export<br/>[Export.jsx]"]
  node_letters_ui["Letters to self<br/>[Letters.jsx]"]
end

subgraph group_platform["Persistence and safeguards"]
  node_day_rules["Day and hour rules<br/>[day.js]"]
  node_time["Timezone and clock<br/>[time.js]"]
  node_clock_guard["Clock integrity guard<br/>[clockGuard.js]"]
  node_auth_middleware["Session verification<br/>[auth.js]"]
  node_models[("Domain records<br/>[index.js]")]
  node_mongo[("MongoDB")]
end

node_user(("Single user"))

node_user -->|"uses"| node_app
node_app -->|"checks session"| node_session
node_app -->|"provides clock"| node_clockctx
node_app -->|"provides reminders"| node_reminders
node_session -->|"requests auth"| node_api_client
node_clockctx -->|"loads server time"| node_api_client
node_reminders -->|"checks open hours"| node_api_client
node_hour_logging -->|"submits logs"| node_api_client
node_dashboard -->|"loads summaries"| node_api_client
node_planning -->|"loads and saves"| node_api_client
node_reflection_ui -->|"loads and saves"| node_api_client
node_weekly_ui -->|"loads review"| node_api_client
node_calendar -->|"loads day data"| node_api_client
node_categories -->|"manages categories"| node_api_client
node_stop_doing -->|"manages items"| node_api_client
node_analytics_ui -->|"loads analytics"| node_api_client
node_export_ui -->|"requests export"| node_api_client
node_letters_ui -->|"manages letters"| node_api_client
node_api_client -->|"sends requests"| node_api_server
node_api_server -->|"routes auth"| node_auth
node_api_server -->|"routes day logs"| node_blocks
node_api_server -->|"mounts features"| node_feature_routes
node_api_server -->|"protects API"| node_auth_middleware
node_api_server -->|"guards API clock"| node_clock_guard
node_blocks -->|"checks day state"| node_day_rules
node_day_rules -->|"uses time rules"| node_time
node_auth_middleware -->|"uses app clock"| node_time
node_day_rules -->|"uses records"| node_models
node_models -.->|"persists records"| node_mongo

click node_app "https://github.com/sidsahoo1203/claude/blob/main/client/src/App.jsx"
click node_session "https://github.com/sidsahoo1203/claude/blob/main/client/src/context/AuthContext.jsx"
click node_clockctx "https://github.com/sidsahoo1203/claude/blob/main/client/src/context/ClockContext.jsx"
click node_reminders "https://github.com/sidsahoo1203/claude/blob/main/client/src/context/RemindersContext.jsx"
click node_api_client "https://github.com/sidsahoo1203/claude/blob/main/client/src/api.js"
click node_hour_logging "https://github.com/sidsahoo1203/claude/blob/main/client/src/components/LogForm.jsx"
click node_dashboard "https://github.com/sidsahoo1203/claude/blob/main/client/src/pages/Dashboard.jsx"
click node_planning "https://github.com/sidsahoo1203/claude/blob/main/client/src/pages/Plan.jsx"
click node_calendar "https://github.com/sidsahoo1203/claude/blob/main/client/src/pages/Calendar.jsx"
click node_categories "https://github.com/sidsahoo1203/claude/blob/main/client/src/pages/Categories.jsx"
click node_stop_doing "https://github.com/sidsahoo1203/claude/blob/main/client/src/pages/StopDoing.jsx"
click node_reflection_ui "https://github.com/sidsahoo1203/claude/blob/main/client/src/pages/Reflection.jsx"
click node_weekly_ui "https://github.com/sidsahoo1203/claude/blob/main/client/src/pages/WeeklyReview.jsx"
click node_analytics_ui "https://github.com/sidsahoo1203/claude/blob/main/client/src/pages/Analytics.jsx"
click node_export_ui "https://github.com/sidsahoo1203/claude/blob/main/client/src/pages/Export.jsx"
click node_letters_ui "https://github.com/sidsahoo1203/claude/blob/main/client/src/pages/Letters.jsx"
click node_api_server "https://github.com/sidsahoo1203/claude/blob/main/server/src/app.js"
click node_auth "https://github.com/sidsahoo1203/claude/blob/main/server/src/routes/auth.js"
click node_blocks "https://github.com/sidsahoo1203/claude/blob/main/server/src/routes/blocks.js"
click node_feature_routes "https://github.com/sidsahoo1203/claude/tree/main/server/src/routes"
click node_day_rules "https://github.com/sidsahoo1203/claude/blob/main/server/src/services/day.js"
click node_time "https://github.com/sidsahoo1203/claude/blob/main/server/src/lib/time.js"
click node_clock_guard "https://github.com/sidsahoo1203/claude/blob/main/server/src/lib/clockGuard.js"
click node_auth_middleware "https://github.com/sidsahoo1203/claude/blob/main/server/src/middleware/auth.js"
click node_models "https://github.com/sidsahoo1203/claude/blob/main/server/src/models/index.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_session,node_clockctx,node_reminders,node_api_client,node_hour_logging,node_dashboard,node_planning,node_calendar,node_categories,node_stop_doing,node_user toneBlue
class node_api_server,node_auth,node_blocks,node_feature_routes toneAmber
class node_reflection_ui,node_weekly_ui,node_analytics_ui,node_export_ui,node_letters_ui toneMint
class node_day_rules,node_time,node_clock_guard,node_auth_middleware,node_models,node_mongo toneRose
```

## Components

### Web client

- [Client routes](https://github.com/sidsahoo1203/claude/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Session state](https://github.com/sidsahoo1203/claude/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Server clock state](https://github.com/sidsahoo1203/claude/blob/main/client/src/context/ClockContext.jsx): `client/src/context/ClockContext.jsx`
- [Logging reminders](https://github.com/sidsahoo1203/claude/blob/main/client/src/context/RemindersContext.jsx): `client/src/context/RemindersContext.jsx`
- [API client](https://github.com/sidsahoo1203/claude/blob/main/client/src/api.js): `client/src/api.js`
- [Hour logging](https://github.com/sidsahoo1203/claude/blob/main/client/src/components/LogForm.jsx): `client/src/components/LogForm.jsx`
- [Dashboard](https://github.com/sidsahoo1203/claude/blob/main/client/src/pages/Dashboard.jsx): `client/src/pages/Dashboard.jsx`
- [Plans and goals](https://github.com/sidsahoo1203/claude/blob/main/client/src/pages/Plan.jsx): `client/src/pages/Plan.jsx`
- [Calendar and day view](https://github.com/sidsahoo1203/claude/blob/main/client/src/pages/Calendar.jsx): `client/src/pages/Calendar.jsx`
- [Categories](https://github.com/sidsahoo1203/claude/blob/main/client/src/pages/Categories.jsx): `client/src/pages/Categories.jsx`
- [Stop Doing list](https://github.com/sidsahoo1203/claude/blob/main/client/src/pages/StopDoing.jsx): `client/src/pages/StopDoing.jsx`

### API and rules

- [Express API](https://github.com/sidsahoo1203/claude/blob/main/server/src/app.js): `server/src/app.js`
- [Authentication](https://github.com/sidsahoo1203/claude/blob/main/server/src/routes/auth.js): `server/src/routes/auth.js`
- [Day and block logging](https://github.com/sidsahoo1203/claude/blob/main/server/src/routes/blocks.js): `server/src/routes/blocks.js`
- [Domain API routes](https://github.com/sidsahoo1203/claude/tree/main/server/src/routes): `server/src/routes`

### Review and growth

- [Daily reflection](https://github.com/sidsahoo1203/claude/blob/main/client/src/pages/Reflection.jsx): `client/src/pages/Reflection.jsx`
- [Weekly review](https://github.com/sidsahoo1203/claude/blob/main/client/src/pages/WeeklyReview.jsx): `client/src/pages/WeeklyReview.jsx`
- [Analytics](https://github.com/sidsahoo1203/claude/blob/main/client/src/pages/Analytics.jsx): `client/src/pages/Analytics.jsx`
- [Data export](https://github.com/sidsahoo1203/claude/blob/main/client/src/pages/Export.jsx): `client/src/pages/Export.jsx`
- [Letters to self](https://github.com/sidsahoo1203/claude/blob/main/client/src/pages/Letters.jsx): `client/src/pages/Letters.jsx`

### Persistence and safeguards

- [Day and hour rules](https://github.com/sidsahoo1203/claude/blob/main/server/src/services/day.js): `server/src/services/day.js`
- [Timezone and clock](https://github.com/sidsahoo1203/claude/blob/main/server/src/lib/time.js): `server/src/lib/time.js`
- [Clock integrity guard](https://github.com/sidsahoo1203/claude/blob/main/server/src/lib/clockGuard.js): `server/src/lib/clockGuard.js`
- [Session verification](https://github.com/sidsahoo1203/claude/blob/main/server/src/middleware/auth.js): `server/src/middleware/auth.js`
- [Domain records](https://github.com/sidsahoo1203/claude/blob/main/server/src/models/index.js): `server/src/models/index.js`
- **MongoDB**

### Other components

- **Single user**

## Connections

- Single user → Client routes: uses (evidence: `client/src/App.jsx`)
- Client routes → Session state: checks session (evidence: `client/src/App.jsx`)
- Client routes → Server clock state: provides clock (evidence: `client/src/App.jsx`)
- Client routes → Logging reminders: provides reminders (evidence: `client/src/App.jsx`)
- Session state → API client: requests auth (evidence: `client/src/context/AuthContext.jsx`)
- Server clock state → API client: loads server time (evidence: `client/src/context/ClockContext.jsx`)
- Logging reminders → API client: checks open hours (evidence: `client/src/context/RemindersContext.jsx`)
- Hour logging → API client: submits logs (evidence: `client/src/components/LogForm.jsx`)
- Dashboard → API client: loads summaries (evidence: `client/src/pages/Dashboard.jsx`)
- Plans and goals → API client: loads and saves (evidence: `client/src/pages/Plan.jsx`)
- Daily reflection → API client: loads and saves (evidence: `client/src/pages/Reflection.jsx`)
- Weekly review → API client: loads review (evidence: `client/src/pages/WeeklyReview.jsx`)
- Calendar and day view → API client: loads day data
- Categories → API client: manages categories
- Stop Doing list → API client: manages items
- Analytics → API client: loads analytics
- Data export → API client: requests export
- Letters to self → API client: manages letters
- API client → Express API: sends requests (evidence: `README.md`)
- Express API → Authentication: routes auth (evidence: `server/src/app.js`)
- Express API → Day and block logging: routes day logs (evidence: `server/src/app.js`)
- Express API → Domain API routes: mounts features (evidence: `server/src/app.js`)
- Express API → Session verification: protects API (evidence: `server/src/app.js`)
- Express API → Clock integrity guard: guards API clock (evidence: `server/src/app.js`)
- Day and block logging → Day and hour rules: checks day state (evidence: `server/src/routes/blocks.js`)
- Day and hour rules → Timezone and clock: uses time rules (evidence: `server/src/services/day.js`)
- Session verification → Timezone and clock: uses app clock (evidence: `server/src/middleware/auth.js`)
- Day and hour rules → Domain records: uses records (evidence: `server/src/services/day.js`)
- Domain records → MongoDB: persists records
