# pranavi1605/echoinsight architecture

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

- Interactive diagram: https://gitdiagram.com/pranavi1605/echoinsight
- Repository: https://github.com/pranavi1605/echoinsight

## Overview

Echo-Insight is a research-paper assistant with a React client and an Express API. A signed-in user uploads a PDF; the server extracts and stores its text, which can then drive podcast generation, highlights, Q&A, and quizzes. The client also provides saved-file, voice, and account/settings experiences. The graph includes the documented route wiring and sampled controller/service calls; API-client transport details and several unsampled feature implementations are not shown, so their internal links are omitted.

Main entry points: [`client/src/App.jsx`](https://github.com/pranavi1605/echoinsight/blob/main/client/src/App.jsx) (Client router), [`server/middleware/authMiddleware.js`](https://github.com/pranavi1605/echoinsight/blob/main/server/middleware/authMiddleware.js) (JWT protection), [`server/app.js`](https://github.com/pranavi1605/echoinsight/blob/main/server/app.js) (Express app), [`client/src/services/api.js`](https://github.com/pranavi1605/echoinsight/blob/main/client/src/services/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_app["Client router<br/>[App.jsx]"]
  node_home["Home<br/>[Home.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_files["Paper library<br/>[MyFiles.jsx]"]
  node_podcast_ui["Podcast studio<br/>[PodcastPage.jsx]"]
  node_highlights_ui["Highlights<br/>[HighlightsPage.jsx]"]
  node_qa_ui["Paper Q&amp;A<br/>[QAPage.jsx]"]
  node_voice_ui["Voice lab<br/>[VoiceLab.jsx]"]
  node_settings_ui["Settings<br/>[Settings.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_auth["Identity and access"]
  node_auth_context["Auth state<br/>[AuthContext.jsx]"]
  node_auth_service["Auth service<br/>[authService.js]"]
  node_auth_guard["Protected routes<br/>[ProtectedRoute.jsx]"]
  node_auth_middleware["JWT protection<br/>[authMiddleware.js]"]
end

subgraph group_api["API and processing"]
  node_server["Express app<br/>[app.js]"]
  node_pdf_routes["PDF routes<br/>[pdfRoutes.js]"]
  node_pdf_controller["PDF handling<br/>[pdfController.js]"]
  node_pdf_service["PDF extraction<br/>[pdfService.js]"]
  node_podcast_routes["Podcast routes<br/>[podcastRoutes.js]"]
  node_podcast_controller["Podcast generation"]
  node_highlight_routes["Highlight routes<br/>[highlightRoutes.js]"]
  node_highlight_controller["Highlight generation"]
  node_qa_routes["Q&amp;A routes<br/>[qaRoutes.js]"]
  node_qa_controller["Q&amp;A handling<br/>[qaController.js]"]
  node_quiz_routes["Quiz routes<br/>[quizRoutes.js]"]
  node_quiz_controller["Quiz generation<br/>[quizController.js]"]
end

subgraph group_data["Data and integrations"]
  node_ai_service["AI service<br/>[aiService.js]"]
  node_quiz_service["Quiz service<br/>[quizService.js]"]
  node_paper[("Paper records<br/>[Paper.js]")]
  node_podcast[("Podcast records<br/>[Podcast.js]")]
  node_user_model[("User records<br/>[User.js]")]
end

node_user(("User"))
node_groq{{"Groq API"}}

node_user -.->|"uses"| node_app
node_app -->|"provides auth"| node_auth_context
node_app -->|"guards pages"| node_auth_guard
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_files
node_app -->|"routes to"| node_podcast_ui
node_app -->|"routes to"| node_highlights_ui
node_app -->|"routes to"| node_qa_ui
node_app -->|"routes to"| node_voice_ui
node_app -->|"routes to"| node_settings_ui
node_auth_context -->|"calls"| node_auth_service
node_auth_service -->|"uses"| node_api_client
node_files -->|"requests data"| node_api_client
node_podcast_ui -->|"requests generation"| node_api_client
node_highlights_ui -->|"requests highlights"| node_api_client
node_qa_ui -->|"requests answers"| node_api_client
node_server -->|"mounts routes"| node_pdf_routes
node_server -->|"mounts routes"| node_podcast_routes
node_server -->|"mounts routes"| node_highlight_routes
node_server -->|"mounts routes"| node_qa_routes
node_server -->|"mounts routes"| node_quiz_routes
node_pdf_routes -->|"dispatches"| node_pdf_controller
node_pdf_controller -->|"extracts text"| node_pdf_service
node_pdf_controller -->|"creates and reads"| node_paper
node_podcast_routes -->|"dispatches"| node_podcast_controller
node_podcast_routes -->|"lists records"| node_podcast
node_podcast_controller -->|"loads paper"| node_paper
node_podcast_controller -->|"generates script"| node_ai_service
node_podcast_controller -->|"creates record"| node_podcast
node_highlight_routes -->|"dispatches"| node_highlight_controller
node_highlight_controller -->|"loads paper"| node_paper
node_highlight_controller -->|"generates highlights"| node_ai_service
node_qa_routes -->|"dispatches"| node_qa_controller
node_qa_controller -->|"loads paper"| node_paper
node_qa_controller -->|"answers question"| node_ai_service
node_quiz_routes -->|"dispatches"| node_quiz_controller
node_quiz_controller -->|"loads paper"| node_paper
node_quiz_controller -->|"generates quiz"| node_quiz_service
node_ai_service -->|"calls model"| node_groq
node_auth_middleware -->|"loads user"| node_user_model
node_pdf_routes -->|"protects upload"| node_auth_middleware
node_podcast_routes -->|"protects endpoints"| node_auth_middleware
node_highlight_routes -->|"protects endpoints"| node_auth_middleware
node_qa_routes -->|"protects endpoints"| node_auth_middleware
node_quiz_routes -->|"protects endpoints"| node_auth_middleware

click node_app "https://github.com/pranavi1605/echoinsight/blob/main/client/src/App.jsx"
click node_home "https://github.com/pranavi1605/echoinsight/blob/main/client/src/pages/Home.jsx"
click node_dashboard "https://github.com/pranavi1605/echoinsight/blob/main/client/src/pages/Dashboard.jsx"
click node_files "https://github.com/pranavi1605/echoinsight/blob/main/client/src/pages/MyFiles.jsx"
click node_podcast_ui "https://github.com/pranavi1605/echoinsight/blob/main/client/src/pages/PodcastPage.jsx"
click node_highlights_ui "https://github.com/pranavi1605/echoinsight/blob/main/client/src/pages/HighlightsPage.jsx"
click node_qa_ui "https://github.com/pranavi1605/echoinsight/blob/main/client/src/pages/QAPage.jsx"
click node_voice_ui "https://github.com/pranavi1605/echoinsight/blob/main/client/src/pages/VoiceLab.jsx"
click node_settings_ui "https://github.com/pranavi1605/echoinsight/blob/main/client/src/pages/Settings.jsx"
click node_api_client "https://github.com/pranavi1605/echoinsight/blob/main/client/src/services/api.js"
click node_auth_context "https://github.com/pranavi1605/echoinsight/blob/main/client/src/context/AuthContext.jsx"
click node_auth_service "https://github.com/pranavi1605/echoinsight/blob/main/client/src/services/authService.js"
click node_auth_guard "https://github.com/pranavi1605/echoinsight/blob/main/client/src/routes/ProtectedRoute.jsx"
click node_server "https://github.com/pranavi1605/echoinsight/blob/main/server/app.js"
click node_pdf_routes "https://github.com/pranavi1605/echoinsight/blob/main/server/routes/pdfRoutes.js"
click node_pdf_controller "https://github.com/pranavi1605/echoinsight/blob/main/server/controllers/pdfController.js"
click node_pdf_service "https://github.com/pranavi1605/echoinsight/blob/main/server/services/pdfService.js"
click node_podcast_routes "https://github.com/pranavi1605/echoinsight/blob/main/server/routes/podcastRoutes.js"
click node_podcast_controller "https://github.com/pranavi1605/echoinsight/blob/main/server/controllers/podcastController.js"
click node_highlight_routes "https://github.com/pranavi1605/echoinsight/blob/main/server/routes/highlightRoutes.js"
click node_highlight_controller "https://github.com/pranavi1605/echoinsight/blob/main/server/controllers/highlightController.js"
click node_qa_routes "https://github.com/pranavi1605/echoinsight/blob/main/server/routes/qaRoutes.js"
click node_qa_controller "https://github.com/pranavi1605/echoinsight/blob/main/server/controllers/qaController.js"
click node_quiz_routes "https://github.com/pranavi1605/echoinsight/blob/main/server/routes/quizRoutes.js"
click node_quiz_controller "https://github.com/pranavi1605/echoinsight/blob/main/server/controllers/quizController.js"
click node_ai_service "https://github.com/pranavi1605/echoinsight/blob/main/server/services/aiService.js"
click node_quiz_service "https://github.com/pranavi1605/echoinsight/blob/main/server/services/quizService.js"
click node_paper "https://github.com/pranavi1605/echoinsight/blob/main/server/models/Paper.js"
click node_podcast "https://github.com/pranavi1605/echoinsight/blob/main/server/models/Podcast.js"
click node_auth_middleware "https://github.com/pranavi1605/echoinsight/blob/main/server/middleware/authMiddleware.js"
click node_user_model "https://github.com/pranavi1605/echoinsight/blob/main/server/models/User.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_home,node_dashboard,node_files,node_podcast_ui,node_highlights_ui,node_qa_ui,node_voice_ui,node_settings_ui,node_api_client,node_user toneBlue
class node_auth_context,node_auth_service,node_auth_guard,node_auth_middleware toneAmber
class node_server,node_pdf_routes,node_pdf_controller,node_pdf_service,node_podcast_routes,node_podcast_controller,node_highlight_routes,node_highlight_controller,node_qa_routes,node_qa_controller,node_quiz_routes,node_quiz_controller,node_groq toneMint
class node_ai_service,node_quiz_service,node_paper,node_podcast,node_user_model toneRose
```

## Components

### Client experience

- [Client router](https://github.com/pranavi1605/echoinsight/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Home](https://github.com/pranavi1605/echoinsight/blob/main/client/src/pages/Home.jsx): `client/src/pages/Home.jsx`
- [Dashboard](https://github.com/pranavi1605/echoinsight/blob/main/client/src/pages/Dashboard.jsx): `client/src/pages/Dashboard.jsx`
- [Paper library](https://github.com/pranavi1605/echoinsight/blob/main/client/src/pages/MyFiles.jsx): `client/src/pages/MyFiles.jsx`
- [Podcast studio](https://github.com/pranavi1605/echoinsight/blob/main/client/src/pages/PodcastPage.jsx): `client/src/pages/PodcastPage.jsx`
- [Highlights](https://github.com/pranavi1605/echoinsight/blob/main/client/src/pages/HighlightsPage.jsx): `client/src/pages/HighlightsPage.jsx`
- [Paper Q&A](https://github.com/pranavi1605/echoinsight/blob/main/client/src/pages/QAPage.jsx): `client/src/pages/QAPage.jsx`
- [Voice lab](https://github.com/pranavi1605/echoinsight/blob/main/client/src/pages/VoiceLab.jsx): `client/src/pages/VoiceLab.jsx`
- [Settings](https://github.com/pranavi1605/echoinsight/blob/main/client/src/pages/Settings.jsx): `client/src/pages/Settings.jsx`
- [API client](https://github.com/pranavi1605/echoinsight/blob/main/client/src/services/api.js): `client/src/services/api.js`

### Identity and access

- [Auth state](https://github.com/pranavi1605/echoinsight/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Auth service](https://github.com/pranavi1605/echoinsight/blob/main/client/src/services/authService.js): `client/src/services/authService.js`
- [Protected routes](https://github.com/pranavi1605/echoinsight/blob/main/client/src/routes/ProtectedRoute.jsx): `client/src/routes/ProtectedRoute.jsx`
- [JWT protection](https://github.com/pranavi1605/echoinsight/blob/main/server/middleware/authMiddleware.js): `server/middleware/authMiddleware.js`

### API and processing

- [Express app](https://github.com/pranavi1605/echoinsight/blob/main/server/app.js): `server/app.js`
- [PDF routes](https://github.com/pranavi1605/echoinsight/blob/main/server/routes/pdfRoutes.js): `server/routes/pdfRoutes.js`
- [PDF handling](https://github.com/pranavi1605/echoinsight/blob/main/server/controllers/pdfController.js): `server/controllers/pdfController.js`
- [PDF extraction](https://github.com/pranavi1605/echoinsight/blob/main/server/services/pdfService.js): `server/services/pdfService.js`
- [Podcast routes](https://github.com/pranavi1605/echoinsight/blob/main/server/routes/podcastRoutes.js): `server/routes/podcastRoutes.js`
- [Podcast generation](https://github.com/pranavi1605/echoinsight/blob/main/server/controllers/podcastController.js): `server/controllers/podcastController.js`
- [Highlight routes](https://github.com/pranavi1605/echoinsight/blob/main/server/routes/highlightRoutes.js): `server/routes/highlightRoutes.js`
- [Highlight generation](https://github.com/pranavi1605/echoinsight/blob/main/server/controllers/highlightController.js): `server/controllers/highlightController.js`
- [Q&A routes](https://github.com/pranavi1605/echoinsight/blob/main/server/routes/qaRoutes.js): `server/routes/qaRoutes.js`
- [Q&A handling](https://github.com/pranavi1605/echoinsight/blob/main/server/controllers/qaController.js): `server/controllers/qaController.js`
- [Quiz routes](https://github.com/pranavi1605/echoinsight/blob/main/server/routes/quizRoutes.js): `server/routes/quizRoutes.js`
- [Quiz generation](https://github.com/pranavi1605/echoinsight/blob/main/server/controllers/quizController.js): `server/controllers/quizController.js`

### Data and integrations

- [AI service](https://github.com/pranavi1605/echoinsight/blob/main/server/services/aiService.js): `server/services/aiService.js`
- [Quiz service](https://github.com/pranavi1605/echoinsight/blob/main/server/services/quizService.js): `server/services/quizService.js`
- [Paper records](https://github.com/pranavi1605/echoinsight/blob/main/server/models/Paper.js): `server/models/Paper.js`
- [Podcast records](https://github.com/pranavi1605/echoinsight/blob/main/server/models/Podcast.js): `server/models/Podcast.js`
- [User records](https://github.com/pranavi1605/echoinsight/blob/main/server/models/User.js): `server/models/User.js`

### Other components

- **User**
- **Groq API**

## Connections

- User → Client router: uses
- Client router → Auth state: provides auth (evidence: `client/src/App.jsx`)
- Client router → Protected routes: guards pages (evidence: `client/src/App.jsx`)
- Client router → Home: routes to (evidence: `client/src/App.jsx`)
- Client router → Dashboard: routes to (evidence: `client/src/App.jsx`)
- Client router → Paper library: routes to (evidence: `client/src/App.jsx`)
- Client router → Podcast studio: routes to (evidence: `client/src/App.jsx`)
- Client router → Highlights: routes to (evidence: `client/src/App.jsx`)
- Client router → Paper Q&A: routes to (evidence: `client/src/App.jsx`)
- Client router → Voice lab: routes to (evidence: `client/src/App.jsx`)
- Client router → Settings: routes to (evidence: `client/src/App.jsx`)
- Auth state → Auth service: calls (evidence: `client/src/context/AuthContext.jsx`)
- Auth service → API client: uses (evidence: `client/src/services/authService.js`)
- Paper library → API client: requests data (evidence: `client/src/pages/MyFiles.jsx`)
- Podcast studio → API client: requests generation (evidence: `client/src/pages/PodcastPage.jsx`)
- Highlights → API client: requests highlights (evidence: `client/src/pages/HighlightsPage.jsx`)
- Paper Q&A → API client: requests answers (evidence: `client/src/pages/QAPage.jsx`)
- Express app → PDF routes: mounts routes (evidence: `server/app.js`)
- Express app → Podcast routes: mounts routes (evidence: `server/app.js`)
- Express app → Highlight routes: mounts routes (evidence: `server/app.js`)
- Express app → Q&A routes: mounts routes (evidence: `server/app.js`)
- Express app → Quiz routes: mounts routes (evidence: `server/app.js`)
- PDF routes → PDF handling: dispatches (evidence: `server/routes/pdfRoutes.js`)
- PDF handling → PDF extraction: extracts text (evidence: `server/controllers/pdfController.js`)
- PDF handling → Paper records: creates and reads (evidence: `server/controllers/pdfController.js`)
- Podcast routes → Podcast generation: dispatches (evidence: `server/routes/podcastRoutes.js`)
- Podcast routes → Podcast records: lists records (evidence: `server/routes/podcastRoutes.js`)
- Podcast generation → Paper records: loads paper (evidence: `server/controllers/podcastController.js`)
- Podcast generation → AI service: generates script (evidence: `server/controllers/podcastController.js`)
- Podcast generation → Podcast records: creates record (evidence: `server/controllers/podcastController.js`)
- Highlight routes → Highlight generation: dispatches (evidence: `server/routes/highlightRoutes.js`)
- Highlight generation → Paper records: loads paper (evidence: `server/controllers/highlightController.js`)
- Highlight generation → AI service: generates highlights (evidence: `server/controllers/highlightController.js`)
- Q&A routes → Q&A handling: dispatches (evidence: `server/routes/qaRoutes.js`)
- Q&A handling → Paper records: loads paper (evidence: `server/controllers/qaController.js`)
- Q&A handling → AI service: answers question (evidence: `server/controllers/qaController.js`)
- Quiz routes → Quiz generation: dispatches (evidence: `server/routes/quizRoutes.js`)
- Quiz generation → Paper records: loads paper (evidence: `server/controllers/quizController.js`)
- Quiz generation → Quiz service: generates quiz (evidence: `server/controllers/quizController.js`)
- AI service → Groq API: calls model (evidence: `server/services/aiService.js`)
- JWT protection → User records: loads user (evidence: `server/middleware/authMiddleware.js`)
- PDF routes → JWT protection: protects upload (evidence: `server/routes/pdfRoutes.js`)
- Podcast routes → JWT protection: protects endpoints (evidence: `server/routes/podcastRoutes.js`)
- Highlight routes → JWT protection: protects endpoints (evidence: `server/routes/highlightRoutes.js`)
- Q&A routes → JWT protection: protects endpoints (evidence: `server/routes/qaRoutes.js`)
- Quiz routes → JWT protection: protects endpoints (evidence: `server/routes/quizRoutes.js`)
