# anishkasinghal/grove architecture

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

- Interactive diagram: https://gitdiagram.com/anishkasinghal/grove
- Repository: https://github.com/anishkasinghal/grove

## Overview

Grove is a student-life dashboard spanning academics, tasks, habits, study, journaling, finance, calendar, stats and settings. The browser boots by loading state, then routes views to renderers; user actions are handled by the event layer and state persists locally. The backend exposes account and user-data APIs backed by PostgreSQL, but the README marks frontend authentication and persistent sync as work in progress. The map retains documented modules whose detailed implementation is unsampled; edges are limited to visible or explicitly documented relationships.

Main entry points: [`server/app.js`](https://github.com/anishkasinghal/grove/blob/main/server/app.js) (Express API), [`server/index.js`](https://github.com/anishkasinghal/grove/blob/main/server/index.js) (Server startup), [`js/router.js`](https://github.com/anishkasinghal/grove/blob/main/js/router.js) (View routing), [`server/db.js`](https://github.com/anishkasinghal/grove/blob/main/server/db.js) (Postgres pool)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Student Dashboard"]
  node_boot["App boot<br/>[main.js]"]
  node_router["View routing<br/>[router.js]"]
  node_views["Dashboard modules<br/>[render.js]"]
  node_events["View actions<br/>[events.js]"]
  node_state["Shared state<br/>[state.js]"]
  node_clientdb[("Local persistence<br/>[db.js]")]
  node_clientutils["Date utilities<br/>[utils.js]"]
  node_clientauth["Sign-in UI<br/>[auth.js]"]
end

subgraph group_server["API and Accounts"]
  node_api["Express API<br/>[app.js]"]
  node_authlogic["Token security<br/>[auth.js]"]
  node_defaults["User defaults<br/>[defaults.js]"]
  node_config["Runtime config<br/>[config.js]"]
  node_startup["Server startup<br/>[index.js]"]
end

subgraph group_storage["Persistence"]
  node_pgpool[("Postgres pool<br/>[db.js]")]
  node_postgres[("PostgreSQL")]
end

node_student(("Student"))
node_google(("Google OAuth"))

node_student -->|"selects views"| node_router
node_boot -.->|"loads data"| node_clientdb
node_boot -->|"routes after load"| node_router
node_router -->|"renders view"| node_views
node_router -->|"wires view"| node_events
node_events -.->|"updates state"| node_state
node_views -->|"reads dashboard data"| node_state
node_views -.->|"uses date helpers"| node_clientutils
node_clientauth -.->|"requests auth"| node_api
node_clientauth -.->|"reloads data"| node_clientdb
node_startup -->|"loads settings"| node_config
node_startup -->|"creates pool"| node_pgpool
node_startup -->|"creates app"| node_api
node_startup -->|"runs migration"| node_pgpool
node_pgpool -->|"validates connection"| node_config
node_pgpool -->|"queries"| node_postgres
node_api -->|"uses auth helpers"| node_authlogic
node_api -->|"loads data defaults"| node_defaults
node_api -->|"reads and writes"| node_postgres
node_api -.->|"OAuth sign-in"| node_google

click node_boot "https://github.com/anishkasinghal/grove/blob/main/js/main.js"
click node_router "https://github.com/anishkasinghal/grove/blob/main/js/router.js"
click node_views "https://github.com/anishkasinghal/grove/blob/main/js/render.js"
click node_events "https://github.com/anishkasinghal/grove/blob/main/js/events.js"
click node_state "https://github.com/anishkasinghal/grove/blob/main/js/state.js"
click node_clientdb "https://github.com/anishkasinghal/grove/blob/main/js/db.js"
click node_clientutils "https://github.com/anishkasinghal/grove/blob/main/js/utils.js"
click node_clientauth "https://github.com/anishkasinghal/grove/blob/main/js/auth.js"
click node_api "https://github.com/anishkasinghal/grove/blob/main/server/app.js"
click node_authlogic "https://github.com/anishkasinghal/grove/blob/main/server/auth.js"
click node_defaults "https://github.com/anishkasinghal/grove/blob/main/server/defaults.js"
click node_config "https://github.com/anishkasinghal/grove/blob/main/server/config.js"
click node_startup "https://github.com/anishkasinghal/grove/blob/main/server/index.js"
click node_pgpool "https://github.com/anishkasinghal/grove/blob/main/server/db.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_boot,node_router,node_views,node_events,node_state,node_clientdb,node_clientutils,node_clientauth toneBlue
class node_api,node_authlogic,node_defaults,node_config,node_startup toneAmber
class node_pgpool,node_postgres toneMint
class node_student,node_google toneIndigo
```

## Components

### Student Dashboard

- [App boot](https://github.com/anishkasinghal/grove/blob/main/js/main.js): `js/main.js`
- [View routing](https://github.com/anishkasinghal/grove/blob/main/js/router.js): `js/router.js`
- [Dashboard modules](https://github.com/anishkasinghal/grove/blob/main/js/render.js): `js/render.js`
- [View actions](https://github.com/anishkasinghal/grove/blob/main/js/events.js): `js/events.js`
- [Shared state](https://github.com/anishkasinghal/grove/blob/main/js/state.js): `js/state.js`
- [Local persistence](https://github.com/anishkasinghal/grove/blob/main/js/db.js): `js/db.js`
- [Date utilities](https://github.com/anishkasinghal/grove/blob/main/js/utils.js): `js/utils.js`
- [Sign-in UI](https://github.com/anishkasinghal/grove/blob/main/js/auth.js): `js/auth.js`

### API and Accounts

- [Express API](https://github.com/anishkasinghal/grove/blob/main/server/app.js): `server/app.js`
- [Token security](https://github.com/anishkasinghal/grove/blob/main/server/auth.js): `server/auth.js`
- [User defaults](https://github.com/anishkasinghal/grove/blob/main/server/defaults.js): `server/defaults.js`
- [Runtime config](https://github.com/anishkasinghal/grove/blob/main/server/config.js): `server/config.js`
- [Server startup](https://github.com/anishkasinghal/grove/blob/main/server/index.js): `server/index.js`

### Persistence

- [Postgres pool](https://github.com/anishkasinghal/grove/blob/main/server/db.js): `server/db.js`
- **PostgreSQL**

### Other components

- **Student**
- **Google OAuth**

## Connections

- Student → View routing: selects views (evidence: `js/router.js`)
- App boot → Local persistence: loads data
- App boot → View routing: routes after load (evidence: `js/main.js`)
- View routing → Dashboard modules: renders view (evidence: `js/router.js`)
- View routing → View actions: wires view (evidence: `js/router.js`)
- View actions → Shared state: updates state
- Dashboard modules → Shared state: reads dashboard data (evidence: `js/render.js`)
- Dashboard modules → Date utilities: uses date helpers
- Sign-in UI → Express API: requests auth
- Sign-in UI → Local persistence: reloads data
- Server startup → Runtime config: loads settings (evidence: `server/index.js`)
- Server startup → Postgres pool: creates pool (evidence: `server/index.js`)
- Server startup → Express API: creates app (evidence: `server/index.js`)
- Server startup → Postgres pool: runs migration (evidence: `server/index.js`)
- Postgres pool → Runtime config: validates connection (evidence: `server/db.js`)
- Postgres pool → PostgreSQL: queries (evidence: `server/db.js`)
- Express API → Token security: uses auth helpers (evidence: `server/app.js`)
- Express API → User defaults: loads data defaults (evidence: `server/app.js`)
- Express API → PostgreSQL: reads and writes (evidence: `server/app.js`)
- Express API → Google OAuth: OAuth sign-in (evidence: `README.md`)
