# pradyumnakolya-ship-it/study architecture

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

- Interactive diagram: https://gitdiagram.com/pradyumnakolya-ship-it/study
- Repository: https://github.com/pradyumnakolya-ship-it/study

## Overview

StudyGPT is a web-based AI study platform: students use the frontend to ask questions, study materials, generate learning plans and quizzes, track progress, and collaborate in guilds or direct messages. The backend exposes these capabilities through FastAPI routers, with AI services and persistence beneath them. The graph preserves the documented product branches and the substantial core modules. Some frontend-to-API wiring and unsampled service internals are not shown in the excerpts, so those relationships are omitted rather than inferred.

Main entry points: [`backend/routers/features.py`](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/routers/features.py) (Learning endpoints), [`backend/routers/guilds.py`](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/routers/guilds.py) (Guild endpoints), [`backend/services/auth_service.py`](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/services/auth_service.py) (User and token service), [`backend/database.py`](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/database.py) (MongoDB access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Study frontend"]
  node_chat_ui["AI tutor chat<br/>[page.tsx]"]
  node_materials_ui["Study materials<br/>[page.tsx]"]
  node_roadmap_ui["Roadmap planner<br/>[page.tsx]"]
  node_quiz_ui["Quiz practice<br/>[page.tsx]"]
  node_practice_ui["Practice drills<br/>[page.tsx]"]
  node_progress_ui["Progress analytics<br/>[page.tsx]"]
  node_guild_ui["Guild learning<br/>[page.tsx]"]
  node_connect_ui["Social messaging<br/>[page.tsx]"]
  node_auth_ui["Sign-in screens<br/>[page.tsx]"]
end

subgraph group_learning["AI learning services"]
  node_ask_router["Question endpoint<br/>[ask.py]"]
  node_features_router["Learning endpoints<br/>[features.py]"]
  node_gemini["Gemini generation<br/>[gemini_service.py]"]
  node_rag["Material retrieval<br/>[rag_service.py]"]
  node_conversation_store[("Conversation storage")]
  node_progress_store[("Progress storage<br/>[progress_store.py]")]
end

subgraph group_community["Guilds and social"]
  node_guild_router["Guild endpoints<br/>[guilds.py]"]
  node_guild_ai["Guild AI learning"]
  node_guild_store[("Guild persistence<br/>[guild_store.py]")]
  node_social_router["Social endpoints<br/>[features.py]"]
  node_websocket["Live messaging"]
end

subgraph group_platform["Identity and persistence"]
  node_auth_router["Authentication endpoints<br/>[auth.py]"]
  node_auth_service["User and token service<br/>[auth_service.py]"]
  node_user_models["User schemas<br/>[user.py]"]
  node_learning_models["Learning schemas<br/>[extra.py]"]
  node_guild_models["Guild schemas<br/>[guild.py]"]
  node_material_models["Material schemas<br/>[material.py]"]
  node_database[("MongoDB access<br/>[database.py]")]
  node_config["Runtime settings<br/>[config.py]"]
end

node_student(("Student"))

node_student -->|"asks questions"| node_chat_ui
node_student -->|"studies materials"| node_materials_ui
node_student -->|"plans study"| node_roadmap_ui
node_student -->|"takes quizzes"| node_quiz_ui
node_student -->|"learns together"| node_guild_ui
node_chat_ui -->|"asks via API"| node_ask_router
node_features_router -->|"uses schemas"| node_learning_models
node_features_router -->|"generates answers"| node_gemini
node_features_router -->|"loads conversations"| node_conversation_store
node_features_router -->|"updates progress"| node_progress_store
node_rag -->|"builds material chunks"| node_material_models
node_rag -->|"requests generation"| node_gemini
node_guild_router -->|"uses schemas"| node_guild_models
node_guild_router -->|"generates roadmaps"| node_guild_ai
node_guild_router -->|"persists guilds"| node_guild_store
node_social_router -->|"dispatches messages"| node_websocket
node_websocket -->|"stores messages"| node_database
node_auth_router -->|"authenticates users"| node_auth_service
node_auth_router -->|"uses user schemas"| node_user_models
node_auth_service -->|"handles user records"| node_user_models
node_auth_service -->|"reads and writes users"| node_database
node_database -->|"reads settings"| node_config

click node_chat_ui "https://github.com/pradyumnakolya-ship-it/study/blob/main/frontend/src/app/chat/page.tsx"
click node_materials_ui "https://github.com/pradyumnakolya-ship-it/study/blob/main/frontend/src/app/materials/page.tsx"
click node_roadmap_ui "https://github.com/pradyumnakolya-ship-it/study/blob/main/frontend/src/app/roadmap/page.tsx"
click node_quiz_ui "https://github.com/pradyumnakolya-ship-it/study/blob/main/frontend/src/app/quiz/page.tsx"
click node_practice_ui "https://github.com/pradyumnakolya-ship-it/study/blob/main/frontend/src/app/practice/page.tsx"
click node_progress_ui "https://github.com/pradyumnakolya-ship-it/study/blob/main/frontend/src/app/progress/page.tsx"
click node_guild_ui "https://github.com/pradyumnakolya-ship-it/study/blob/main/frontend/src/app/home/page.tsx"
click node_connect_ui "https://github.com/pradyumnakolya-ship-it/study/blob/main/frontend/src/app/connect/page.tsx"
click node_auth_ui "https://github.com/pradyumnakolya-ship-it/study/blob/main/frontend/src/app/auth/login/page.tsx"
click node_ask_router "https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/routers/ask.py"
click node_features_router "https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/routers/features.py"
click node_gemini "https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/services/gemini_service.py"
click node_rag "https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/services/rag_service.py"
click node_conversation_store "https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/services/conversation_store.py"
click node_progress_store "https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/services/progress_store.py"
click node_guild_router "https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/routers/guilds.py"
click node_guild_ai "https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/services/guild_ai_service.py"
click node_guild_store "https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/services/guild_store.py"
click node_social_router "https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/routers/features.py"
click node_websocket "https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/services/websocket_manager.py"
click node_auth_router "https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/routers/auth.py"
click node_auth_service "https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/services/auth_service.py"
click node_user_models "https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/models/user.py"
click node_learning_models "https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/models/extra.py"
click node_guild_models "https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/models/guild.py"
click node_material_models "https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/models/material.py"
click node_database "https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/database.py"
click node_config "https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/config.py"

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_chat_ui,node_materials_ui,node_roadmap_ui,node_quiz_ui,node_practice_ui,node_progress_ui,node_guild_ui,node_connect_ui,node_auth_ui toneBlue
class node_ask_router,node_features_router,node_gemini,node_rag,node_conversation_store,node_progress_store toneAmber
class node_guild_router,node_guild_ai,node_guild_store,node_social_router,node_websocket toneMint
class node_auth_router,node_auth_service,node_user_models,node_learning_models,node_guild_models,node_material_models,node_database,node_config toneRose
class node_student toneIndigo
```

## Components

### Study frontend

- [AI tutor chat](https://github.com/pradyumnakolya-ship-it/study/blob/main/frontend/src/app/chat/page.tsx): `frontend/src/app/chat/page.tsx`
- [Study materials](https://github.com/pradyumnakolya-ship-it/study/blob/main/frontend/src/app/materials/page.tsx): `frontend/src/app/materials/page.tsx`
- [Roadmap planner](https://github.com/pradyumnakolya-ship-it/study/blob/main/frontend/src/app/roadmap/page.tsx): `frontend/src/app/roadmap/page.tsx`
- [Quiz practice](https://github.com/pradyumnakolya-ship-it/study/blob/main/frontend/src/app/quiz/page.tsx): `frontend/src/app/quiz/page.tsx`
- [Practice drills](https://github.com/pradyumnakolya-ship-it/study/blob/main/frontend/src/app/practice/page.tsx): `frontend/src/app/practice/page.tsx`
- [Progress analytics](https://github.com/pradyumnakolya-ship-it/study/blob/main/frontend/src/app/progress/page.tsx): `frontend/src/app/progress/page.tsx`
- [Guild learning](https://github.com/pradyumnakolya-ship-it/study/blob/main/frontend/src/app/home/page.tsx): `frontend/src/app/home/page.tsx`
- [Social messaging](https://github.com/pradyumnakolya-ship-it/study/blob/main/frontend/src/app/connect/page.tsx): `frontend/src/app/connect/page.tsx`
- [Sign-in screens](https://github.com/pradyumnakolya-ship-it/study/blob/main/frontend/src/app/auth/login/page.tsx): `frontend/src/app/auth/login/page.tsx`

### AI learning services

- [Question endpoint](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/routers/ask.py): `backend/routers/ask.py`
- [Learning endpoints](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/routers/features.py): `backend/routers/features.py`
- [Gemini generation](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/services/gemini_service.py): `backend/services/gemini_service.py`
- [Material retrieval](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/services/rag_service.py): `backend/services/rag_service.py`
- [Conversation storage](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/services/conversation_store.py): `backend/services/conversation_store.py`
- [Progress storage](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/services/progress_store.py): `backend/services/progress_store.py`

### Guilds and social

- [Guild endpoints](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/routers/guilds.py): `backend/routers/guilds.py`
- [Guild AI learning](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/services/guild_ai_service.py): `backend/services/guild_ai_service.py`
- [Guild persistence](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/services/guild_store.py): `backend/services/guild_store.py`
- [Social endpoints](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/routers/features.py): `backend/routers/features.py`
- [Live messaging](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/services/websocket_manager.py): `backend/services/websocket_manager.py`

### Identity and persistence

- [Authentication endpoints](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/routers/auth.py): `backend/routers/auth.py`
- [User and token service](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/services/auth_service.py): `backend/services/auth_service.py`
- [User schemas](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/models/user.py): `backend/models/user.py`
- [Learning schemas](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/models/extra.py): `backend/models/extra.py`
- [Guild schemas](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/models/guild.py): `backend/models/guild.py`
- [Material schemas](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/models/material.py): `backend/models/material.py`
- [MongoDB access](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/database.py): `backend/database.py`
- [Runtime settings](https://github.com/pradyumnakolya-ship-it/study/blob/main/backend/config.py): `backend/config.py`

### Other components

- **Student**

## Connections

- Student → AI tutor chat: asks questions (evidence: `README.md`)
- Student → Study materials: studies materials (evidence: `README.md`)
- Student → Roadmap planner: plans study (evidence: `README.md`)
- Student → Quiz practice: takes quizzes (evidence: `README.md`)
- Student → Guild learning: learns together (evidence: `README.md`)
- AI tutor chat → Question endpoint: asks via API (evidence: `README.md`)
- Learning endpoints → Learning schemas: uses schemas (evidence: `backend/routers/features.py`)
- Learning endpoints → Gemini generation: generates answers (evidence: `backend/routers/features.py`)
- Learning endpoints → Conversation storage: loads conversations (evidence: `backend/routers/features.py`)
- Learning endpoints → Progress storage: updates progress (evidence: `backend/routers/features.py`)
- Material retrieval → Material schemas: builds material chunks (evidence: `backend/services/rag_service.py`)
- Material retrieval → Gemini generation: requests generation (evidence: `backend/services/rag_service.py`)
- Guild endpoints → Guild schemas: uses schemas (evidence: `backend/routers/guilds.py`)
- Guild endpoints → Guild AI learning: generates roadmaps (evidence: `backend/routers/guilds.py`)
- Guild endpoints → Guild persistence: persists guilds (evidence: `backend/routers/guilds.py`)
- Social endpoints → Live messaging: dispatches messages (evidence: `backend/routers/features.py`)
- Live messaging → MongoDB access: stores messages (evidence: `backend/services/websocket_manager.py`)
- Authentication endpoints → User and token service: authenticates users (evidence: `backend/routers/auth.py`)
- Authentication endpoints → User schemas: uses user schemas (evidence: `backend/routers/auth.py`)
- User and token service → User schemas: handles user records (evidence: `backend/services/auth_service.py`)
- User and token service → MongoDB access: reads and writes users (evidence: `backend/services/auth_service.py`)
- MongoDB access → Runtime settings: reads settings (evidence: `backend/database.py`)
