# khushi-saraswat/askhelp architecture

> Architecture diagram of the GitHub repository khushi-saraswat/askhelp, 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/khushi-saraswat/askhelp
- Repository: https://github.com/khushi-saraswat/askhelp

## Overview

AskHelp is a React study-assistant application backed by Spring Boot. The main workflow is a student submitting content or a question through a feature page, the frontend API service forwarding it to the backend controller, and a research service producing an AI response for display. Separate flows cover account sessions, saved notes, flashcard persistence, and keyword-based RAG. The README documents the feature set; sampled source confirms service and controller wiring, while individual page-to-API calls were not sampled.

Main entry points: [`student-ai/student-ai/src/services/api.js`](https://github.com/khushi-saraswat/askhelp/blob/main/student-ai/student-ai/src/services/api.js) (Frontend API), [`ResearchBackend/src/main/java/com/research/assistant/Service/ResearchService.java`](https://github.com/khushi-saraswat/askhelp/blob/main/ResearchBackend/src/main/java/com/research/assistant/Service/ResearchService.java) (AI research service), [`student-ai/student-ai/src/context/AppContext.jsx`](https://github.com/khushi-saraswat/askhelp/blob/main/student-ai/student-ai/src/context/AppContext.jsx) (App state), [`ResearchBackend/src/main/java/com/research/assistant/Controller/ResearchController.java`](https://github.com/khushi-saraswat/askhelp/blob/main/ResearchBackend/src/main/java/com/research/assistant/Controller/ResearchController.java) (Research API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Study experience"]
  node_chat["AI chat<br/>[ChatPage.jsx]"]
  node_summarize["Summarization<br/>[SummarizePage.jsx]"]
  node_explain["Concept explanation<br/>[ExplainPage.jsx]"]
  node_flashcards["Flashcard study<br/>[FlashcardsPage.jsx]"]
  node_cite["Citation creation<br/>[CitePage.jsx]"]
  node_notes["Notes<br/>[NotesPage.jsx]"]
  node_knowledge["Knowledge base<br/>[KnowledgeBase.jsx]"]
  node_api["Frontend API<br/>[api.js]"]
  node_appstate["App state<br/>[AppContext.jsx]"]
  node_localstorage[("Browser storage")]
end

subgraph group_backend["Backend workflows"]
  node_researchcontroller["Research API"]
  node_researchservice["AI research service"]
  node_ragservice["Keyword retrieval<br/>[RagService.java]"]
  node_flashrepo["Flashcard repository"]
  node_database[("Application database")]
end

subgraph group_identity["Identity and state"]
  node_authcontroller["Authentication API"]
  node_userrepo["User repository"]
end

subgraph group_integrations["External services"]
  node_gemini["Gemini AI"]
end

node_student(("Student"))

node_student -->|"submits query"| node_chat
node_student -->|"submits text"| node_summarize
node_student -->|"requests explanation"| node_explain
node_student -->|"requests cards"| node_flashcards
node_student -->|"enters details"| node_cite
node_student -->|"asks question"| node_knowledge
node_chat -->|"API request"| node_api
node_summarize -->|"API request"| node_api
node_explain -->|"API request"| node_api
node_flashcards -->|"API request"| node_api
node_cite -->|"API request"| node_api
node_knowledge -->|"API request"| node_api
node_api -->|"HTTP request"| node_researchcontroller
node_researchcontroller -->|"invokes AI operations"| node_researchservice
node_researchcontroller -->|"dispatches RAG query"| node_ragservice
node_researchservice -->|"sends prompt"| node_gemini
node_ragservice -->|"loads flashcards"| node_flashrepo
node_ragservice -->|"submits context and question"| node_researchservice
node_researchservice -->|"saves flashcard"| node_flashrepo
node_flashrepo -->|"reads and writes"| node_database
node_student -->|"creates notes"| node_notes
node_notes -->|"updates notes"| node_appstate
node_appstate -->|"persists notes"| node_localstorage
node_student -->|"registers or signs in"| node_authcontroller
node_authcontroller -->|"looks up and saves user"| node_userrepo
node_userrepo -->|"reads and writes"| node_database
node_appstate -->|"checks session"| node_api
node_api -->|"auth request"| node_authcontroller

click node_chat "https://github.com/khushi-saraswat/askhelp/blob/main/student-ai/student-ai/src/pages/ChatPage.jsx"
click node_summarize "https://github.com/khushi-saraswat/askhelp/blob/main/student-ai/student-ai/src/pages/SummarizePage.jsx"
click node_explain "https://github.com/khushi-saraswat/askhelp/blob/main/student-ai/student-ai/src/pages/ExplainPage.jsx"
click node_flashcards "https://github.com/khushi-saraswat/askhelp/blob/main/student-ai/student-ai/src/pages/FlashcardsPage.jsx"
click node_cite "https://github.com/khushi-saraswat/askhelp/blob/main/student-ai/student-ai/src/pages/CitePage.jsx"
click node_notes "https://github.com/khushi-saraswat/askhelp/blob/main/student-ai/student-ai/src/pages/NotesPage.jsx"
click node_knowledge "https://github.com/khushi-saraswat/askhelp/blob/main/student-ai/student-ai/src/pages/KnowledgeBase.jsx"
click node_api "https://github.com/khushi-saraswat/askhelp/blob/main/student-ai/student-ai/src/services/api.js"
click node_appstate "https://github.com/khushi-saraswat/askhelp/blob/main/student-ai/student-ai/src/context/AppContext.jsx"
click node_researchcontroller "https://github.com/khushi-saraswat/askhelp/blob/main/ResearchBackend/src/main/java/com/research/assistant/Controller/ResearchController.java"
click node_researchservice "https://github.com/khushi-saraswat/askhelp/blob/main/ResearchBackend/src/main/java/com/research/assistant/Service/ResearchService.java"
click node_ragservice "https://github.com/khushi-saraswat/askhelp/blob/main/ResearchBackend/src/main/java/com/research/assistant/Service/RagService.java"
click node_flashrepo "https://github.com/khushi-saraswat/askhelp/blob/main/ResearchBackend/src/main/java/com/research/assistant/Repository/FlashCardRepository.java"
click node_authcontroller "https://github.com/khushi-saraswat/askhelp/blob/main/ResearchBackend/src/main/java/com/research/assistant/Controller/AuthController.java"
click node_userrepo "https://github.com/khushi-saraswat/askhelp/blob/main/ResearchBackend/src/main/java/com/research/assistant/Repository/UserRepository.java"

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,node_summarize,node_explain,node_flashcards,node_cite,node_notes,node_knowledge,node_api,node_appstate,node_localstorage toneBlue
class node_researchcontroller,node_researchservice,node_ragservice,node_flashrepo,node_database toneAmber
class node_authcontroller,node_userrepo toneMint
class node_gemini toneRose
class node_student toneIndigo
```

## Components

### Study experience

- [AI chat](https://github.com/khushi-saraswat/askhelp/blob/main/student-ai/student-ai/src/pages/ChatPage.jsx): `student-ai/student-ai/src/pages/ChatPage.jsx`
- [Summarization](https://github.com/khushi-saraswat/askhelp/blob/main/student-ai/student-ai/src/pages/SummarizePage.jsx): `student-ai/student-ai/src/pages/SummarizePage.jsx`
- [Concept explanation](https://github.com/khushi-saraswat/askhelp/blob/main/student-ai/student-ai/src/pages/ExplainPage.jsx): `student-ai/student-ai/src/pages/ExplainPage.jsx`
- [Flashcard study](https://github.com/khushi-saraswat/askhelp/blob/main/student-ai/student-ai/src/pages/FlashcardsPage.jsx): `student-ai/student-ai/src/pages/FlashcardsPage.jsx`
- [Citation creation](https://github.com/khushi-saraswat/askhelp/blob/main/student-ai/student-ai/src/pages/CitePage.jsx): `student-ai/student-ai/src/pages/CitePage.jsx`
- [Notes](https://github.com/khushi-saraswat/askhelp/blob/main/student-ai/student-ai/src/pages/NotesPage.jsx): `student-ai/student-ai/src/pages/NotesPage.jsx`
- [Knowledge base](https://github.com/khushi-saraswat/askhelp/blob/main/student-ai/student-ai/src/pages/KnowledgeBase.jsx): `student-ai/student-ai/src/pages/KnowledgeBase.jsx`
- [Frontend API](https://github.com/khushi-saraswat/askhelp/blob/main/student-ai/student-ai/src/services/api.js): `student-ai/student-ai/src/services/api.js`
- [App state](https://github.com/khushi-saraswat/askhelp/blob/main/student-ai/student-ai/src/context/AppContext.jsx): `student-ai/student-ai/src/context/AppContext.jsx`
- **Browser storage**

### Backend workflows

- [Research API](https://github.com/khushi-saraswat/askhelp/blob/main/ResearchBackend/src/main/java/com/research/assistant/Controller/ResearchController.java): `ResearchBackend/src/main/java/com/research/assistant/Controller/ResearchController.java`
- [AI research service](https://github.com/khushi-saraswat/askhelp/blob/main/ResearchBackend/src/main/java/com/research/assistant/Service/ResearchService.java): `ResearchBackend/src/main/java/com/research/assistant/Service/ResearchService.java`
- [Keyword retrieval](https://github.com/khushi-saraswat/askhelp/blob/main/ResearchBackend/src/main/java/com/research/assistant/Service/RagService.java): `ResearchBackend/src/main/java/com/research/assistant/Service/RagService.java`
- [Flashcard repository](https://github.com/khushi-saraswat/askhelp/blob/main/ResearchBackend/src/main/java/com/research/assistant/Repository/FlashCardRepository.java): `ResearchBackend/src/main/java/com/research/assistant/Repository/FlashCardRepository.java`
- **Application database**

### Identity and state

- [Authentication API](https://github.com/khushi-saraswat/askhelp/blob/main/ResearchBackend/src/main/java/com/research/assistant/Controller/AuthController.java): `ResearchBackend/src/main/java/com/research/assistant/Controller/AuthController.java`
- [User repository](https://github.com/khushi-saraswat/askhelp/blob/main/ResearchBackend/src/main/java/com/research/assistant/Repository/UserRepository.java): `ResearchBackend/src/main/java/com/research/assistant/Repository/UserRepository.java`

### External services

- **Gemini AI**

### Other components

- **Student**

## Connections

- Student → AI chat: submits query
- Student → Summarization: submits text
- Student → Concept explanation: requests explanation
- Student → Flashcard study: requests cards
- Student → Citation creation: enters details
- Student → Knowledge base: asks question
- AI chat → Frontend API: API request
- Summarization → Frontend API: API request
- Concept explanation → Frontend API: API request
- Flashcard study → Frontend API: API request
- Citation creation → Frontend API: API request
- Knowledge base → Frontend API: API request
- Frontend API → Research API: HTTP request
- Research API → AI research service: invokes AI operations
- Research API → Keyword retrieval: dispatches RAG query
- AI research service → Gemini AI: sends prompt
- Keyword retrieval → Flashcard repository: loads flashcards
- Keyword retrieval → AI research service: submits context and question
- AI research service → Flashcard repository: saves flashcard
- Flashcard repository → Application database: reads and writes
- Student → Notes: creates notes
- Notes → App state: updates notes
- App state → Browser storage: persists notes
- Student → Authentication API: registers or signs in
- Authentication API → User repository: looks up and saves user
- User repository → Application database: reads and writes
- App state → Frontend API: checks session
- Frontend API → Authentication API: auth request
