# praneet50/intelliquest architecture

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

- Interactive diagram: https://gitdiagram.com/praneet50/intelliquest
- Repository: https://github.com/praneet50/intelliquest

## Overview

#### Purpose and deployment shape
IntelliQuest is a full-stack document-to-question application: authenticated users upload files, backend processing extracts content and generates questions, and the frontend presents upload workflow, generated questions, and session history. It is split into a Node backend and a Vite/React frontend. Container and platform deployment assets exist at `docker-compose.yml`, `backend/Dockerfile`, and `render.yaml`.

#### Backend HTTP entry point
The Express server is rooted at `backend/server.js`, with application/database setup in `backend/config/config.js` and `backend/config/database.js`. Route modules separate the public API into authentication (`backend/routes/authRoutes.js`) and upload/question processing (`backend/routes/uploadRoutes.js`). Controllers provide the HTTP boundary: `backend/controllers/authController.js` and `backend/controllers/uploadController.js`.

#### Identity and access boundary
User accounts are persisted through `backend/models/User.js`. Authentication behavior is implemented by `backend/controllers/authController.js`; protected API access is enforced by `backend/middleware/auth.js`. The frontend maintains client authentication state in `frontend/IntelliQuest/src/context/AuthContext.jsx` and gates application routes through `frontend/IntelliQuest/src/components/auth/ProtectedRoute.jsx`.

#### Upload-to-question processing pipeline
Upload requests enter through `backend/routes/uploadRoutes.js` and `backend/controllers/uploadController.js`. Uploaded source files are parsed by `backend/utils/fileParser.js`, then passed to `backend/services/questionService.js` for question generation. `backend/eng.traineddata` indicates OCR support for English-language image/scanned-document extraction. Progress/lifecycle updates are handled by `backend/utils/progressTracker.js`.

#### Persistent upload and session domain
Upload records are modeled in `backend/models/Upload.js`, forming the backend representation of submitted documents and their processing/results. On the client, `frontend/IntelliQuest/src/context/SessionContext.jsx` owns session-oriented state, while sidebar history components (`frontend/IntelliQuest/src/components/sidebar/HistoryList.jsx`, `frontend/IntelliQuest/src/components/sidebar/HistoryItem.jsx`) expose prior sessions/uploads.

#### Frontend application composition
The React entry path is `frontend/IntelliQuest/src/main.jsx` into `frontend/IntelliQuest/src/App.jsx`. Page-level control is organized around `Dashboard.jsx`, `Login.jsx`, `Register.jsx`, and `Settings.jsx` under `frontend/IntelliQuest/src/pages`. Authenticated workspace structure is supplied by `frontend/IntelliQuest/src/components/layout/MainLayout.jsx`.

#### User workflow and API boundary
The dashboard upload flow is composed in `frontend/IntelliQuest/src/components/upload/UploadContainer.jsx`: file selection via `DropZone.jsx`, question options via `QuestionSettings.jsx`, submission via `UploadButton.jsx`, and results via `QuestionDisplay.jsx`. All browser-to-backend communication is centralized in `frontend/IntelliQuest/src/services/api.js`, making it the primary client/server contract boundary. The frontend is a Vite application (`frontend/IntelliQuest/vite.config.js`) with Vercel deployment configuration at `frontend/IntelliQuest/vercel.json`.

Main entry points: [`backend/routes/uploadRoutes.js`](https://github.com/praneet50/intelliquest/blob/main/backend/routes/uploadRoutes.js) (Upload API), [`frontend/IntelliQuest/src/services/api.js`](https://github.com/praneet50/intelliquest/blob/main/frontend/IntelliQuest/src/services/api.js) (API client), [`frontend/IntelliQuest/src/App.jsx`](https://github.com/praneet50/intelliquest/blob/main/frontend/IntelliQuest/src/App.jsx) (App routing), [`frontend/IntelliQuest/src/pages/Dashboard.jsx`](https://github.com/praneet50/intelliquest/blob/main/frontend/IntelliQuest/src/pages/Dashboard.jsx) (Dashboard workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React frontend"]
  node_vite{{"Vite app<br/>frontend runtime<br/>[main.jsx]"}}
  node_app["App routing<br/>React composition<br/>[App.jsx]"]
  node_auth_context["Auth state<br/>React context<br/>[AuthContext.jsx]"]
  node_protected_route["Protected routes<br/>route guard<br/>[ProtectedRoute.jsx]"]
  node_workspace["Dashboard workspace<br/>page and layout<br/>[Dashboard.jsx]"]
  node_upload_ui["Upload workflow<br/>React components"]
  node_session_context["Session state<br/>React context<br/>[SessionContext.jsx]"]
  node_history["Session history<br/>sidebar components<br/>[HistoryList.jsx]"]
  node_api{{"API client<br/>client-server contract<br/>[api.js]"}}
end

subgraph group_backend["Express backend"]
  node_server{{"Express server<br/>HTTP entry point<br/>[server.js]"}}
  node_auth_api["Auth API<br/>routes and controller<br/>[authRoutes.js]"]
  node_upload_api["Upload API<br/>routes and controller<br/>[uploadRoutes.js]"]
  node_auth_guard["Access middleware<br/>authentication guard<br/>[auth.js]"]
  node_users[("Users<br/>account model<br/>[User.js]")]
  node_uploads[("Uploads<br/>document/session model<br/>[Upload.js]")]
end

subgraph group_pipeline["Document pipeline"]
  node_parser["File extraction<br/>document parser<br/>[fileParser.js]"]
  node_questions["Question generation<br/>generation service<br/>[questionService.js]"]
  node_progress["Processing progress<br/>lifecycle tracker<br/>[progressTracker.js]"]
end

node_vite -->|"boots"| node_app
node_app -->|"provides"| node_auth_context
node_app -->|"gates workspace"| node_protected_route
node_protected_route -->|"authorizes"| node_workspace
node_workspace -->|"hosts"| node_upload_ui
node_workspace -->|"uses"| node_session_context
node_session_context -->|"supplies"| node_history
node_auth_context -->|"auth requests"| node_api
node_upload_ui -->|"submits files and options"| node_api
node_session_context -->|"loads sessions"| node_api
node_api -->|"HTTP API"| node_server
node_server -->|"routes"| node_auth_api
node_server -->|"routes"| node_upload_api
node_auth_api -->|"accounts"| node_users
node_upload_api -->|"protects"| node_auth_guard
node_auth_guard -->|"scopes access"| node_uploads
node_upload_api -->|"extracts upload"| node_parser
node_parser -->|"source content"| node_questions
node_questions -->|"stores results"| node_uploads
node_upload_api -->|"tracks lifecycle"| node_progress
node_progress -->|"updates status"| node_uploads

click node_vite "https://github.com/praneet50/intelliquest/blob/main/frontend/IntelliQuest/src/main.jsx"
click node_app "https://github.com/praneet50/intelliquest/blob/main/frontend/IntelliQuest/src/App.jsx"
click node_auth_context "https://github.com/praneet50/intelliquest/blob/main/frontend/IntelliQuest/src/context/AuthContext.jsx"
click node_protected_route "https://github.com/praneet50/intelliquest/blob/main/frontend/IntelliQuest/src/components/auth/ProtectedRoute.jsx"
click node_workspace "https://github.com/praneet50/intelliquest/blob/main/frontend/IntelliQuest/src/pages/Dashboard.jsx"
click node_upload_ui "https://github.com/praneet50/intelliquest/blob/main/frontend/IntelliQuest/src/components/upload/UploadContainer.jsx"
click node_session_context "https://github.com/praneet50/intelliquest/blob/main/frontend/IntelliQuest/src/context/SessionContext.jsx"
click node_history "https://github.com/praneet50/intelliquest/blob/main/frontend/IntelliQuest/src/components/sidebar/HistoryList.jsx"
click node_api "https://github.com/praneet50/intelliquest/blob/main/frontend/IntelliQuest/src/services/api.js"
click node_server "https://github.com/praneet50/intelliquest/blob/main/backend/server.js"
click node_auth_api "https://github.com/praneet50/intelliquest/blob/main/backend/routes/authRoutes.js"
click node_upload_api "https://github.com/praneet50/intelliquest/blob/main/backend/routes/uploadRoutes.js"
click node_auth_guard "https://github.com/praneet50/intelliquest/blob/main/backend/middleware/auth.js"
click node_users "https://github.com/praneet50/intelliquest/blob/main/backend/models/User.js"
click node_uploads "https://github.com/praneet50/intelliquest/blob/main/backend/models/Upload.js"
click node_parser "https://github.com/praneet50/intelliquest/blob/main/backend/utils/fileParser.js"
click node_questions "https://github.com/praneet50/intelliquest/blob/main/backend/services/questionService.js"
click node_progress "https://github.com/praneet50/intelliquest/blob/main/backend/utils/progressTracker.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_vite,node_app,node_auth_context,node_protected_route,node_workspace,node_upload_ui,node_session_context,node_history,node_api toneBlue
class node_server,node_auth_api,node_upload_api,node_auth_guard,node_users,node_uploads toneAmber
class node_parser,node_questions,node_progress toneMint
```

## Components

### React frontend

- [Vite app](https://github.com/praneet50/intelliquest/blob/main/frontend/IntelliQuest/src/main.jsx): frontend runtime · `frontend/IntelliQuest/src/main.jsx`
- [App routing](https://github.com/praneet50/intelliquest/blob/main/frontend/IntelliQuest/src/App.jsx): React composition · `frontend/IntelliQuest/src/App.jsx`
- [Auth state](https://github.com/praneet50/intelliquest/blob/main/frontend/IntelliQuest/src/context/AuthContext.jsx): React context · `frontend/IntelliQuest/src/context/AuthContext.jsx`
- [Protected routes](https://github.com/praneet50/intelliquest/blob/main/frontend/IntelliQuest/src/components/auth/ProtectedRoute.jsx): route guard · `frontend/IntelliQuest/src/components/auth/ProtectedRoute.jsx`
- [Dashboard workspace](https://github.com/praneet50/intelliquest/blob/main/frontend/IntelliQuest/src/pages/Dashboard.jsx): page and layout · `frontend/IntelliQuest/src/pages/Dashboard.jsx`
- [Upload workflow](https://github.com/praneet50/intelliquest/blob/main/frontend/IntelliQuest/src/components/upload/UploadContainer.jsx): React components · Selection, question settings, submission, and results. · `frontend/IntelliQuest/src/components/upload/UploadContainer.jsx`
- [Session state](https://github.com/praneet50/intelliquest/blob/main/frontend/IntelliQuest/src/context/SessionContext.jsx): React context · `frontend/IntelliQuest/src/context/SessionContext.jsx`
- [Session history](https://github.com/praneet50/intelliquest/blob/main/frontend/IntelliQuest/src/components/sidebar/HistoryList.jsx): sidebar components · `frontend/IntelliQuest/src/components/sidebar/HistoryList.jsx`
- [API client](https://github.com/praneet50/intelliquest/blob/main/frontend/IntelliQuest/src/services/api.js): client-server contract · `frontend/IntelliQuest/src/services/api.js`

### Express backend

- [Express server](https://github.com/praneet50/intelliquest/blob/main/backend/server.js): HTTP entry point · `backend/server.js`
- [Auth API](https://github.com/praneet50/intelliquest/blob/main/backend/routes/authRoutes.js): routes and controller · `backend/routes/authRoutes.js`
- [Upload API](https://github.com/praneet50/intelliquest/blob/main/backend/routes/uploadRoutes.js): routes and controller · `backend/routes/uploadRoutes.js`
- [Access middleware](https://github.com/praneet50/intelliquest/blob/main/backend/middleware/auth.js): authentication guard · `backend/middleware/auth.js`
- [Users](https://github.com/praneet50/intelliquest/blob/main/backend/models/User.js): account model · `backend/models/User.js`
- [Uploads](https://github.com/praneet50/intelliquest/blob/main/backend/models/Upload.js): document/session model · Persists submitted documents, lifecycle, and results. · `backend/models/Upload.js`

### Document pipeline

- [File extraction](https://github.com/praneet50/intelliquest/blob/main/backend/utils/fileParser.js): document parser · Supports OCR-backed English extraction. · `backend/utils/fileParser.js`
- [Question generation](https://github.com/praneet50/intelliquest/blob/main/backend/services/questionService.js): generation service · `backend/services/questionService.js`
- [Processing progress](https://github.com/praneet50/intelliquest/blob/main/backend/utils/progressTracker.js): lifecycle tracker · `backend/utils/progressTracker.js`

## Connections

- Vite app → App routing: boots
- App routing → Auth state: provides
- App routing → Protected routes: gates workspace
- Protected routes → Dashboard workspace: authorizes
- Dashboard workspace → Upload workflow: hosts
- Dashboard workspace → Session state: uses
- Session state → Session history: supplies
- Auth state → API client: auth requests
- Upload workflow → API client: submits files and options
- Session state → API client: loads sessions
- API client → Express server: HTTP API
- Express server → Auth API: routes
- Express server → Upload API: routes
- Auth API → Users: accounts
- Upload API → Access middleware: protects
- Access middleware → Uploads: scopes access
- Upload API → File extraction: extracts upload
- File extraction → Question generation: source content
- Question generation → Uploads: stores results
- Upload API → Processing progress: tracks lifecycle
- Processing progress → Uploads: updates status
