# prottoy-bhattacharyya/suggestion-hub architecture

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

- Interactive diagram: https://gitdiagram.com/prottoy-bhattacharyya/suggestion-hub
- Repository: https://github.com/prottoy-bhattacharyya/suggestion-hub

## Overview

Suggestion Hub is a university platform for sharing, reviewing, and discussing course notes. Students and teachers use the web app to create accounts, upload and find notes, follow users, and review submissions; moderation is an additional admin capability. The frontend has dedicated routes for these workflows, while Django backend areas handle accounts, notes, reviews, search, feeds, social features, and rankings. MySQL is the documented data store. Evidence is limited to the README and sampled excerpts: several route-to-endpoint mappings and backend URL dispatch details are not shown, so those links are omitted or marked unverified.

Main entry points: [`frontend/src/routeTree.gen.ts`](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routeTree.gen.ts) (Route map), [`backend/core/utils.py`](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/core/utils.py) (Database access), [`backend/notes/views.py`](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/notes/views.py) (Notes and uploads), [`backend/reviews/views.py`](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/reviews/views.py) (Review moderation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_web_router["Web router<br/>[router.tsx]"]
  node_route_map["Route map<br/>[routeTree.gen.ts]"]
  node_login_ui["Login and signup<br/>[login.tsx]"]
  node_signup_ui["Registration<br/>[signup.tsx]"]
  node_upload_ui["Note upload<br/>[upload.tsx]"]
  node_feed_ui["Feeds<br/>[feeds.tsx]"]
  node_search_ui["Search<br/>[search.tsx]"]
  node_pdf_ui["Note viewer<br/>[pdf.$id.tsx]"]
  node_teacher_ui["Teacher review<br/>[teacher.tsx]"]
  node_profile_ui["User profile<br/>[profile.$id.tsx]"]
  node_leaderboard_ui["Leaderboard<br/>[leaderboard.tsx]"]
  node_analytics_ui["Analytics<br/>[analytics.tsx]"]
  node_admin_ui["Admin panel<br/>[admin.tsx]"]
end

subgraph group_identity["Accounts and profiles"]
  node_accounts["Account services<br/>[views.py]"]
  node_academics["Academic data<br/>[views.py]"]
end

subgraph group_content["Notes and discovery"]
  node_notes["Notes and uploads<br/>[views.py]"]
  node_search["Search service<br/>[views.py]"]
  node_feeds["Feed service<br/>[views.py]"]
  node_ai["AI features<br/>[views.py]"]
end

subgraph group_community["Community and review"]
  node_social["Social features<br/>[views.py]"]
  node_reviews["Review moderation<br/>[views.py]"]
  node_rankings["Ranking service<br/>[service.py]"]
end

subgraph group_platform["Backend services"]
  node_db_access["Database access<br/>[utils.py]"]
  node_mysql[("MySQL database")]
  node_ssr["SSR error handling<br/>[server.ts]"]
end

node_student(("Student or teacher"))

node_student -->|"uses"| node_web_router
node_web_router -->|"loads routes"| node_route_map
node_route_map -->|"maps route"| node_login_ui
node_route_map -->|"maps route"| node_signup_ui
node_route_map -->|"maps route"| node_upload_ui
node_route_map -->|"maps route"| node_feed_ui
node_route_map -->|"maps route"| node_search_ui
node_route_map -->|"maps route"| node_pdf_ui
node_route_map -->|"maps route"| node_teacher_ui
node_route_map -->|"maps route"| node_profile_ui
node_route_map -->|"maps route"| node_leaderboard_ui
node_route_map -->|"maps route"| node_analytics_ui
node_route_map -->|"maps route"| node_admin_ui
node_login_ui -.->|"calls API"| node_accounts
node_signup_ui -.->|"calls API"| node_accounts
node_upload_ui -.->|"calls API"| node_notes
node_feed_ui -.->|"calls API"| node_feeds
node_search_ui -.->|"searches people"| node_search
node_search_ui -.->|"posts follow action"| node_social
node_pdf_ui -.->|"loads note"| node_notes
node_teacher_ui -.->|"submits decisions"| node_reviews
node_profile_ui -.->|"loads profile"| node_accounts
node_leaderboard_ui -.->|"loads rankings"| node_rankings
node_analytics_ui -.->|"loads analytics"| node_notes
node_admin_ui -.->|"moderates content"| node_reviews
node_accounts -->|"opens connection"| node_db_access
node_academics -->|"opens connection"| node_db_access
node_notes -->|"opens connection"| node_db_access
node_search -->|"opens connection"| node_db_access
node_feeds -->|"opens connection"| node_db_access
node_ai -->|"opens connection"| node_db_access
node_social -->|"opens connection"| node_db_access
node_reviews -->|"opens connection"| node_db_access
node_notes -->|"recalculates ranks"| node_rankings
node_reviews -->|"recalculates ranks"| node_rankings
node_social -->|"updates ranks"| node_rankings
node_db_access -->|"connects to"| node_mysql
node_ssr -->|"returns error page"| node_student

click node_web_router "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/router.tsx"
click node_route_map "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routeTree.gen.ts"
click node_login_ui "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/login.tsx"
click node_signup_ui "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/signup.tsx"
click node_upload_ui "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/upload.tsx"
click node_feed_ui "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/feeds.tsx"
click node_search_ui "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/search.tsx"
click node_pdf_ui "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/pdf.%24id.tsx"
click node_teacher_ui "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/teacher.tsx"
click node_profile_ui "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/profile.%24id.tsx"
click node_leaderboard_ui "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/leaderboard.tsx"
click node_analytics_ui "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/analytics.tsx"
click node_admin_ui "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/admin.tsx"
click node_accounts "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/accounts/views.py"
click node_academics "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/academics/views.py"
click node_notes "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/notes/views.py"
click node_search "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/search/views.py"
click node_feeds "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/feeds/views.py"
click node_ai "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/ai/views.py"
click node_social "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/social/views.py"
click node_reviews "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/reviews/views.py"
click node_rankings "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/rankings/service.py"
click node_db_access "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/core/utils.py"
click node_ssr "https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/server.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_web_router,node_route_map,node_login_ui,node_signup_ui,node_upload_ui,node_feed_ui,node_search_ui,node_pdf_ui,node_teacher_ui,node_profile_ui,node_leaderboard_ui,node_analytics_ui,node_admin_ui toneBlue
class node_accounts,node_academics toneAmber
class node_notes,node_search,node_feeds,node_ai toneMint
class node_social,node_reviews,node_rankings toneRose
class node_db_access,node_mysql,node_ssr,node_student toneIndigo
```

## Components

### Web application

- [Web router](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/router.tsx): `frontend/src/router.tsx`
- [Route map](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routeTree.gen.ts): `frontend/src/routeTree.gen.ts`
- [Login and signup](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/login.tsx): `frontend/src/routes/login.tsx`
- [Registration](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/signup.tsx): `frontend/src/routes/signup.tsx`
- [Note upload](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/upload.tsx): `frontend/src/routes/upload.tsx`
- [Feeds](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/feeds.tsx): `frontend/src/routes/feeds.tsx`
- [Search](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/search.tsx): `frontend/src/routes/search.tsx`
- [Note viewer](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/pdf.%24id.tsx): `frontend/src/routes/pdf.$id.tsx`
- [Teacher review](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/teacher.tsx): `frontend/src/routes/teacher.tsx`
- [User profile](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/profile.%24id.tsx): `frontend/src/routes/profile.$id.tsx`
- [Leaderboard](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/leaderboard.tsx): `frontend/src/routes/leaderboard.tsx`
- [Analytics](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/analytics.tsx): `frontend/src/routes/analytics.tsx`
- [Admin panel](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/routes/admin.tsx): `frontend/src/routes/admin.tsx`

### Accounts and profiles

- [Account services](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/accounts/views.py): `backend/accounts/views.py`
- [Academic data](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/academics/views.py): `backend/academics/views.py`

### Notes and discovery

- [Notes and uploads](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/notes/views.py): `backend/notes/views.py`
- [Search service](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/search/views.py): `backend/search/views.py`
- [Feed service](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/feeds/views.py): `backend/feeds/views.py`
- [AI features](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/ai/views.py): `backend/ai/views.py`

### Community and review

- [Social features](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/social/views.py): `backend/social/views.py`
- [Review moderation](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/reviews/views.py): `backend/reviews/views.py`
- [Ranking service](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/rankings/service.py): `backend/rankings/service.py`

### Backend services

- [Database access](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/backend/core/utils.py): `backend/core/utils.py`
- **MySQL database**
- [SSR error handling](https://github.com/prottoy-bhattacharyya/suggestion-hub/blob/main/frontend/src/server.ts): `frontend/src/server.ts`

### Other components

- **Student or teacher**

## Connections

- Student or teacher → Web router: uses (evidence: `README.md`)
- Web router → Route map: loads routes (evidence: `frontend/src/router.tsx`)
- Route map → Login and signup: maps route (evidence: `frontend/src/routeTree.gen.ts`)
- Route map → Registration: maps route (evidence: `frontend/src/routeTree.gen.ts`)
- Route map → Note upload: maps route (evidence: `frontend/src/routeTree.gen.ts`)
- Route map → Feeds: maps route (evidence: `frontend/src/routeTree.gen.ts`)
- Route map → Search: maps route (evidence: `frontend/src/routeTree.gen.ts`)
- Route map → Note viewer: maps route (evidence: `frontend/src/routeTree.gen.ts`)
- Route map → Teacher review: maps route (evidence: `frontend/src/routeTree.gen.ts`)
- Route map → User profile: maps route (evidence: `frontend/src/routeTree.gen.ts`)
- Route map → Leaderboard: maps route (evidence: `frontend/src/routeTree.gen.ts`)
- Route map → Analytics: maps route (evidence: `frontend/src/routeTree.gen.ts`)
- Route map → Admin panel: maps route (evidence: `frontend/src/routeTree.gen.ts`)
- Login and signup → Account services: calls API
- Registration → Account services: calls API
- Note upload → Notes and uploads: calls API
- Feeds → Feed service: calls API
- Search → Search service: searches people
- Search → Social features: posts follow action
- Note viewer → Notes and uploads: loads note
- Teacher review → Review moderation: submits decisions
- User profile → Account services: loads profile
- Leaderboard → Ranking service: loads rankings
- Analytics → Notes and uploads: loads analytics
- Admin panel → Review moderation: moderates content
- Account services → Database access: opens connection (evidence: `backend/accounts/views.py`)
- Academic data → Database access: opens connection (evidence: `backend/academics/views.py`)
- Notes and uploads → Database access: opens connection (evidence: `backend/notes/views.py`)
- Search service → Database access: opens connection (evidence: `backend/search/views.py`)
- Feed service → Database access: opens connection (evidence: `backend/feeds/views.py`)
- AI features → Database access: opens connection (evidence: `backend/ai/views.py`)
- Social features → Database access: opens connection (evidence: `backend/social/views.py`)
- Review moderation → Database access: opens connection (evidence: `backend/reviews/views.py`)
- Notes and uploads → Ranking service: recalculates ranks (evidence: `backend/notes/views.py`)
- Review moderation → Ranking service: recalculates ranks (evidence: `backend/reviews/views.py`)
- Social features → Ranking service: updates ranks (evidence: `backend/social/views.py`)
- Database access → MySQL database: connects to (evidence: `backend/core/utils.py`)
- SSR error handling → Student or teacher: returns error page (evidence: `frontend/src/server.ts`)
