# jagadeesh916/hack2 architecture

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

- Interactive diagram: https://gitdiagram.com/jagadeesh916/hack2
- Repository: https://github.com/jagadeesh916/hack2
- Video tour (about a minute): https://gitdiagram.com/jagadeesh916/hack2/video

## Overview

NoteHub is a study-note application: users authenticate, create note sets from pasted text or PDFs, generate flashcards and a story, then browse, study, and fork note sets. The graph follows the routes and database operations visible in sampled source. Explore and landing pages are included as documented-by-route product surfaces, but their detailed behavior was not sampled; the README is only a Vite template and documents no additional product capabilities.

Main entry points: [`src/App.jsx`](https://github.com/jagadeesh916/hack2/blob/main/src/App.jsx) (Router and app shell), [`src/pages/CreateNotePage.jsx`](https://github.com/jagadeesh916/hack2/blob/main/src/pages/CreateNotePage.jsx) (Create note set), [`src/contexts/AuthContext.jsx`](https://github.com/jagadeesh916/hack2/blob/main/src/contexts/AuthContext.jsx) (Session and auth actions), [`src/lib/supabase.js`](https://github.com/jagadeesh916/hack2/blob/main/src/lib/supabase.js) (Supabase client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application flow"]
  node_app["Router and app shell<br/>[App.jsx]"]
  node_landing["Landing page<br/>[LandingPage.jsx]"]
  node_explore["Explore note sets<br/>[ExplorePage.jsx]"]
  node_navbar["Navigation and sign out<br/>[Navbar.jsx]"]
end

subgraph group_identity["Identity"]
  node_authpage["Sign in and sign up<br/>[AuthPage.jsx]"]
  node_authcontext["Session and auth actions<br/>[AuthContext.jsx]"]
end

subgraph group_notes["Note sets and study"]
  node_dashboard["My note sets<br/>[DashboardPage.jsx]"]
  node_create["Create note set<br/>[CreateNotePage.jsx]"]
  node_pdf["PDF text extraction<br/>[pdfExtract.js]"]
  node_generation["Generate-notes function<br/>[index.ts]"]
  node_view["Study and fork notes<br/>[ViewNotePage.jsx]"]
end

subgraph group_shared["Shared UI and utilities"]
  node_supabaseclient["Supabase client<br/>[supabase.js]"]
  node_ui["Reusable UI components"]
  node_utils["Class-name utilities<br/>[utils.js]"]
end

node_student(("Student"))
node_database[("Supabase note store")]
node_authservice["Supabase Auth"]

node_student -->|"opens routes"| node_app
node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_explore
node_app -->|"routes to"| node_authpage
node_app -->|"protects route"| node_dashboard
node_app -->|"protects route"| node_create
node_app -->|"routes to"| node_view
node_app -->|"provides session"| node_authcontext
node_authpage -->|"calls auth actions"| node_authcontext
node_authcontext -->|"uses client"| node_supabaseclient
node_supabaseclient -->|"configures auth"| node_authservice
node_navbar -->|"calls sign out"| node_authcontext
node_dashboard -->|"queries note sets"| node_supabaseclient
node_dashboard -->|"reads and deletes"| node_database
node_create -->|"extracts PDF text"| node_pdf
node_create -->|"gets current user"| node_authcontext
node_create -->|"inserts and updates"| node_supabaseclient
node_create -->|"creates note set"| node_database
node_create -->|"posts generation request"| node_generation
node_view -->|"fetches and forks"| node_supabaseclient
node_view -->|"reads and inserts"| node_database
node_create -->|"reads session token"| node_authcontext
node_authcontext -->|"refreshes session"| node_supabaseclient
node_authpage -->|"renders controls"| node_ui
node_create -->|"renders form controls"| node_ui
node_ui -->|"merges classes"| node_utils
node_explore -.->|"may query listings"| node_supabaseclient
node_view -->|"renders cards and buttons"| node_ui

click node_app "https://github.com/jagadeesh916/hack2/blob/main/src/App.jsx"
click node_landing "https://github.com/jagadeesh916/hack2/blob/main/src/pages/LandingPage.jsx"
click node_explore "https://github.com/jagadeesh916/hack2/blob/main/src/pages/ExplorePage.jsx"
click node_authpage "https://github.com/jagadeesh916/hack2/blob/main/src/pages/AuthPage.jsx"
click node_authcontext "https://github.com/jagadeesh916/hack2/blob/main/src/contexts/AuthContext.jsx"
click node_navbar "https://github.com/jagadeesh916/hack2/blob/main/src/components/Navbar.jsx"
click node_dashboard "https://github.com/jagadeesh916/hack2/blob/main/src/pages/DashboardPage.jsx"
click node_create "https://github.com/jagadeesh916/hack2/blob/main/src/pages/CreateNotePage.jsx"
click node_pdf "https://github.com/jagadeesh916/hack2/blob/main/src/lib/pdfExtract.js"
click node_generation "https://github.com/jagadeesh916/hack2/blob/main/supabase/functions/generate-notes/index.ts"
click node_view "https://github.com/jagadeesh916/hack2/blob/main/src/pages/ViewNotePage.jsx"
click node_supabaseclient "https://github.com/jagadeesh916/hack2/blob/main/src/lib/supabase.js"
click node_ui "https://github.com/jagadeesh916/hack2/tree/main/src/components/ui"
click node_utils "https://github.com/jagadeesh916/hack2/blob/main/src/lib/utils.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_landing,node_explore,node_navbar toneBlue
class node_authpage,node_authcontext,node_database toneAmber
class node_dashboard,node_create,node_pdf,node_generation,node_view toneMint
class node_supabaseclient,node_ui,node_utils toneRose
class node_student,node_authservice toneIndigo
```

## Components

### Application flow

- [Router and app shell](https://github.com/jagadeesh916/hack2/blob/main/src/App.jsx): `src/App.jsx`
- [Landing page](https://github.com/jagadeesh916/hack2/blob/main/src/pages/LandingPage.jsx): `src/pages/LandingPage.jsx`
- [Explore note sets](https://github.com/jagadeesh916/hack2/blob/main/src/pages/ExplorePage.jsx): `src/pages/ExplorePage.jsx`
- [Navigation and sign out](https://github.com/jagadeesh916/hack2/blob/main/src/components/Navbar.jsx): `src/components/Navbar.jsx`

### Identity

- [Sign in and sign up](https://github.com/jagadeesh916/hack2/blob/main/src/pages/AuthPage.jsx): `src/pages/AuthPage.jsx`
- [Session and auth actions](https://github.com/jagadeesh916/hack2/blob/main/src/contexts/AuthContext.jsx): `src/contexts/AuthContext.jsx`

### Note sets and study

- [My note sets](https://github.com/jagadeesh916/hack2/blob/main/src/pages/DashboardPage.jsx): `src/pages/DashboardPage.jsx`
- [Create note set](https://github.com/jagadeesh916/hack2/blob/main/src/pages/CreateNotePage.jsx): `src/pages/CreateNotePage.jsx`
- [PDF text extraction](https://github.com/jagadeesh916/hack2/blob/main/src/lib/pdfExtract.js): `src/lib/pdfExtract.js`
- [Generate-notes function](https://github.com/jagadeesh916/hack2/blob/main/supabase/functions/generate-notes/index.ts): `supabase/functions/generate-notes/index.ts`
- [Study and fork notes](https://github.com/jagadeesh916/hack2/blob/main/src/pages/ViewNotePage.jsx): `src/pages/ViewNotePage.jsx`

### Shared UI and utilities

- [Supabase client](https://github.com/jagadeesh916/hack2/blob/main/src/lib/supabase.js): `src/lib/supabase.js`
- [Reusable UI components](https://github.com/jagadeesh916/hack2/tree/main/src/components/ui): `src/components/ui`
- [Class-name utilities](https://github.com/jagadeesh916/hack2/blob/main/src/lib/utils.js): `src/lib/utils.js`

### Other components

- **Student**
- **Supabase note store**
- **Supabase Auth**

## Connections

- Student → Router and app shell: opens routes (evidence: `src/App.jsx`)
- Router and app shell → Landing page: routes to (evidence: `src/App.jsx`)
- Router and app shell → Explore note sets: routes to (evidence: `src/App.jsx`)
- Router and app shell → Sign in and sign up: routes to (evidence: `src/App.jsx`)
- Router and app shell → My note sets: protects route (evidence: `src/App.jsx`)
- Router and app shell → Create note set: protects route (evidence: `src/App.jsx`)
- Router and app shell → Study and fork notes: routes to (evidence: `src/App.jsx`)
- Router and app shell → Session and auth actions: provides session (evidence: `src/App.jsx`)
- Sign in and sign up → Session and auth actions: calls auth actions (evidence: `src/pages/AuthPage.jsx`)
- Session and auth actions → Supabase client: uses client (evidence: `src/contexts/AuthContext.jsx`)
- Supabase client → Supabase Auth: configures auth (evidence: `src/lib/supabase.js`)
- Navigation and sign out → Session and auth actions: calls sign out (evidence: `src/components/Navbar.jsx`)
- My note sets → Supabase client: queries note sets (evidence: `src/pages/DashboardPage.jsx`)
- My note sets → Supabase note store: reads and deletes (evidence: `src/pages/DashboardPage.jsx`)
- Create note set → PDF text extraction: extracts PDF text (evidence: `src/pages/CreateNotePage.jsx`)
- Create note set → Session and auth actions: gets current user (evidence: `src/pages/CreateNotePage.jsx`)
- Create note set → Supabase client: inserts and updates (evidence: `src/pages/CreateNotePage.jsx`)
- Create note set → Supabase note store: creates note set (evidence: `src/pages/CreateNotePage.jsx`)
- Create note set → Generate-notes function: posts generation request (evidence: `src/pages/CreateNotePage.jsx`)
- Study and fork notes → Supabase client: fetches and forks (evidence: `src/pages/ViewNotePage.jsx`)
- Study and fork notes → Supabase note store: reads and inserts (evidence: `src/pages/ViewNotePage.jsx`)
- Create note set → Session and auth actions: reads session token (evidence: `src/pages/CreateNotePage.jsx`)
- Session and auth actions → Supabase client: refreshes session (evidence: `src/contexts/AuthContext.jsx`)
- Sign in and sign up → Reusable UI components: renders controls (evidence: `src/pages/AuthPage.jsx`)
- Create note set → Reusable UI components: renders form controls (evidence: `src/pages/CreateNotePage.jsx`)
- Reusable UI components → Class-name utilities: merges classes (evidence: `src/components/ui/Card.jsx`)
- Explore note sets → Supabase client: may query listings (evidence: `src/pages/ExplorePage.jsx`)
- Study and fork notes → Reusable UI components: renders cards and buttons (evidence: `src/pages/ViewNotePage.jsx`)
