# sajagshri300707-ui/hobby-lily architecture

> Architecture diagram of the GitHub repository sajagshri300707-ui/hobby-lily, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sajagshri300707-ui/hobby-lily
- Repository: https://github.com/sajagshri300707-ui/hobby-lily

## Overview

HobbyLily is a personalized hobby-learning product: learners choose hobbies, follow adaptive AI-generated paths, complete tasks, and track visible growth. Its frontend also presents journaling, AI help, and community features. The sampled sources show the app routing, path/task API calls, authentication, backend route dispatch, task persistence, and Socket.IO signaling; other capability links reflect README documentation, since their implementation excerpts were not provided.

Main entry points: [`frontend/src/App.jsx`](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/App.jsx) (App routes), [`backend/server.js`](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/backend/server.js) (Express and sockets), [`frontend/src/lib/api.js`](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/lib/api.js) (HTTP API client), [`backend/routes/ai.js`](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/backend/routes/ai.js) (AI capabilities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Learning experience"]
  node_app["App routes<br/>[App.jsx]"]
  node_landing["Hobby discovery<br/>[LandingPage.jsx]"]
  node_garden["Hobby garden<br/>[GardenPage.jsx]"]
  node_path["Learning paths<br/>[PathPage.jsx]"]
  node_branches["Learning branches<br/>[BranchContext.jsx]"]
  node_journal["Smart journal<br/>[JournalPage.jsx]"]
  node_doubts["Doubt Garden"]
end

subgraph group_identity["Identity and access"]
  node_authctx["Auth context<br/>[AuthContext.jsx]"]
  node_authroutes["Authentication routes<br/>[auth.js]"]
end

subgraph group_services["Backend services"]
  node_api["HTTP API client<br/>[api.js]"]
  node_server["Express and sockets<br/>[server.js]"]
  node_hobbyroutes["Hobby routes<br/>[hobbies.js]"]
  node_taskroutes["Task and progress routes<br/>[tasks.js]"]
  node_airoutes["AI capabilities<br/>[ai.js]"]
  node_db[("PostgreSQL<br/>[db.js]")]
end

subgraph group_collaboration["Community and collaboration"]
  node_community["Community feed<br/>[CommunityPage.jsx]"]
  node_groups["Groups and voice<br/>[GroupsPage.jsx]"]
  node_leaderboard["Leaderboards"]
end

node_learner(("Learner"))
node_gemini["Gemini AI"]
node_socketusers(("Connected members"))

node_learner -->|"explores hobbies"| node_landing
node_learner -->|"uses app"| node_app
node_app -->|"routes to"| node_garden
node_app -->|"routes to"| node_path
node_app -->|"routes to"| node_journal
node_app -->|"routes to"| node_doubts
node_app -->|"routes to"| node_community
node_app -->|"routes to"| node_groups
node_app -->|"routes to"| node_leaderboard
node_app -->|"provides auth"| node_authctx
node_path -->|"manages branches"| node_branches
node_path -->|"requests paths and tasks"| node_api
node_authctx -->|"sends auth requests"| node_api
node_api -->|"sends HTTP requests"| node_server
node_server -->|"dispatches auth"| node_authroutes
node_server -->|"dispatches hobbies"| node_hobbyroutes
node_server -->|"dispatches tasks"| node_taskroutes
node_server -->|"dispatches AI"| node_airoutes
node_authroutes -->|"reads and writes users"| node_db
node_hobbyroutes -->|"reads and writes hobbies"| node_db
node_taskroutes -->|"reads and updates tasks"| node_db
node_taskroutes -->|"updates hobby progress"| node_db
node_path -->|"requests chapter generation"| node_airoutes
node_airoutes -.->|"generates learning content"| node_gemini
node_journal -.->|"uses journal AI"| node_airoutes
node_doubts -.->|"requests mentorship"| node_airoutes
node_groups -->|"exchanges Socket.IO events"| node_server
node_community -.->|"uses live collaboration"| node_server
node_socketusers -->|"joins rooms and signals"| node_server
node_server -->|"broadcasts events"| node_socketusers
node_garden -->|"loads hobby data"| node_api
node_leaderboard -.->|"loads rankings"| node_api

click node_app "https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/App.jsx"
click node_landing "https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/pages/LandingPage.jsx"
click node_garden "https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/pages/app/GardenPage.jsx"
click node_path "https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/pages/app/PathPage.jsx"
click node_branches "https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/context/BranchContext.jsx"
click node_journal "https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/pages/app/JournalPage.jsx"
click node_doubts "https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/pages/app/DoubtGardenPage.jsx"
click node_community "https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/pages/app/CommunityPage.jsx"
click node_groups "https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/pages/app/GroupsPage.jsx"
click node_leaderboard "https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/pages/app/LeaderboardPage.jsx"
click node_api "https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/lib/api.js"
click node_authctx "https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/context/AuthContext.jsx"
click node_authroutes "https://github.com/sajagshri300707-ui/hobby-lily/blob/main/backend/routes/auth.js"
click node_server "https://github.com/sajagshri300707-ui/hobby-lily/blob/main/backend/server.js"
click node_hobbyroutes "https://github.com/sajagshri300707-ui/hobby-lily/blob/main/backend/routes/hobbies.js"
click node_taskroutes "https://github.com/sajagshri300707-ui/hobby-lily/blob/main/backend/routes/tasks.js"
click node_airoutes "https://github.com/sajagshri300707-ui/hobby-lily/blob/main/backend/routes/ai.js"
click node_db "https://github.com/sajagshri300707-ui/hobby-lily/blob/main/backend/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_app,node_landing,node_garden,node_path,node_branches,node_journal,node_doubts toneBlue
class node_authctx,node_authroutes toneAmber
class node_api,node_server,node_hobbyroutes,node_taskroutes,node_airoutes,node_db toneMint
class node_community,node_groups,node_leaderboard toneRose
class node_learner,node_gemini,node_socketusers toneIndigo
```

## Components

### Learning experience

- [App routes](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Hobby discovery](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/pages/LandingPage.jsx): `frontend/src/pages/LandingPage.jsx`
- [Hobby garden](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/pages/app/GardenPage.jsx): `frontend/src/pages/app/GardenPage.jsx`
- [Learning paths](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/pages/app/PathPage.jsx): `frontend/src/pages/app/PathPage.jsx`
- [Learning branches](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/context/BranchContext.jsx): `frontend/src/context/BranchContext.jsx`
- [Smart journal](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/pages/app/JournalPage.jsx): `frontend/src/pages/app/JournalPage.jsx`
- [Doubt Garden](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/pages/app/DoubtGardenPage.jsx): `frontend/src/pages/app/DoubtGardenPage.jsx`

### Identity and access

- [Auth context](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Authentication routes](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/backend/routes/auth.js): `backend/routes/auth.js`

### Backend services

- [HTTP API client](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/lib/api.js): `frontend/src/lib/api.js`
- [Express and sockets](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/backend/server.js): `backend/server.js`
- [Hobby routes](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/backend/routes/hobbies.js): `backend/routes/hobbies.js`
- [Task and progress routes](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/backend/routes/tasks.js): `backend/routes/tasks.js`
- [AI capabilities](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/backend/routes/ai.js): `backend/routes/ai.js`
- [PostgreSQL](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/backend/db.js): `backend/db.js`

### Community and collaboration

- [Community feed](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/pages/app/CommunityPage.jsx): `frontend/src/pages/app/CommunityPage.jsx`
- [Groups and voice](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/pages/app/GroupsPage.jsx): `frontend/src/pages/app/GroupsPage.jsx`
- [Leaderboards](https://github.com/sajagshri300707-ui/hobby-lily/blob/main/frontend/src/pages/app/LeaderboardPage.jsx): `frontend/src/pages/app/LeaderboardPage.jsx`

### Other components

- **Learner**
- **Gemini AI**
- **Connected members**

## Connections

- Learner → Hobby discovery: explores hobbies
- Learner → App routes: uses app
- App routes → Hobby garden: routes to
- App routes → Learning paths: routes to
- App routes → Smart journal: routes to
- App routes → Doubt Garden: routes to
- App routes → Community feed: routes to
- App routes → Groups and voice: routes to
- App routes → Leaderboards: routes to
- App routes → Auth context: provides auth
- Learning paths → Learning branches: manages branches
- Learning paths → HTTP API client: requests paths and tasks
- Auth context → HTTP API client: sends auth requests
- HTTP API client → Express and sockets: sends HTTP requests
- Express and sockets → Authentication routes: dispatches auth
- Express and sockets → Hobby routes: dispatches hobbies
- Express and sockets → Task and progress routes: dispatches tasks
- Express and sockets → AI capabilities: dispatches AI
- Authentication routes → PostgreSQL: reads and writes users
- Hobby routes → PostgreSQL: reads and writes hobbies
- Task and progress routes → PostgreSQL: reads and updates tasks
- Task and progress routes → PostgreSQL: updates hobby progress
- Learning paths → AI capabilities: requests chapter generation
- AI capabilities → Gemini AI: generates learning content
- Smart journal → AI capabilities: uses journal AI
- Doubt Garden → AI capabilities: requests mentorship
- Groups and voice → Express and sockets: exchanges Socket.IO events
- Community feed → Express and sockets: uses live collaboration
- Connected members → Express and sockets: joins rooms and signals
- Express and sockets → Connected members: broadcasts events
- Hobby garden → HTTP API client: loads hobby data
- Leaderboards → HTTP API client: loads rankings
