# srivarshini0969/snapstudy architecture

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

- Interactive diagram: https://gitdiagram.com/srivarshini0969/snapstudy
- Repository: https://github.com/srivarshini0969/snapstudy

## Overview

SnapStudy captures YouTube lecture moments as timestamped, screenshot-backed study snaps, organizes them for review, and resumes playback at the saved point. Students capture through the Chrome extension or React app; the backend authenticates requests, stores snap and account data, and the app supports editing, revision status, subject analytics, OCR topic detection, and account verification/reset. Relationships between sampled callers and their dependencies are shown; Cloudinary and email delivery are documented or configured but not fully traced in the excerpts.

Main entry points: [`frontend/src/App.js`](https://github.com/srivarshini0969/snapstudy/blob/main/frontend/src/App.js) (React study app), [`backend/index.js`](https://github.com/srivarshini0969/snapstudy/blob/main/backend/index.js) (Express API), [`snapstudy-extension/popup.js`](https://github.com/srivarshini0969/snapstudy/blob/main/snapstudy-extension/popup.js) (Extension popup), [`frontend/src/pages/VerifyEmail.js`](https://github.com/srivarshini0969/snapstudy/blob/main/frontend/src/pages/VerifyEmail.js) (Email verification view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Lecture capture"]
  node_extension["Extension popup<br/>[popup.js]"]
end

subgraph group_web["Study workspace"]
  node_app["React study app<br/>[App.js]"]
  node_timestamp["Timestamp formatter<br/>[formatTimestamp.js]"]
  node_subjects["Subject keywords<br/>[subjectKeywords.js]"]
  node_verifyview["Email verification view<br/>[VerifyEmail.js]"]
  node_resetview["Password reset view<br/>[ResetPassword.js]"]
  node_ocr["Screenshot OCR<br/>[App.js]"]
  node_analytics["Subject analytics<br/>[App.js]"]
end

subgraph group_server["Backend services"]
  node_api["Express API<br/>[index.js]"]
  node_snapmodel[("Snap records<br/>[Snap.js]")]
end

subgraph group_identity["Accounts"]
  node_authmw["JWT middleware<br/>[authMiddleware.js]"]
  node_usermodel[("User records<br/>[User.js]")]
end

node_student(("Student"))
node_youtube["YouTube lecture"]
node_mongodb[("MongoDB")]
node_cloudinary["Cloudinary"]
node_email["Email service"]

node_student -->|"captures with"| node_extension
node_extension -->|"reads video"| node_youtube
node_extension -->|"uploads capture"| node_api
node_student -->|"manages snaps"| node_app
node_app -->|"requests snaps"| node_api
node_app -->|"formats time"| node_timestamp
node_app -.->|"classifies subjects"| node_subjects
node_app -->|"routes to"| node_verifyview
node_app -->|"routes to"| node_resetview
node_verifyview -->|"verifies account"| node_api
node_app -->|"analyzes screenshot"| node_ocr
node_app -->|"shows summaries"| node_analytics
node_api -->|"guards routes"| node_authmw
node_api -->|"creates and queries"| node_snapmodel
node_api -->|"authenticates users"| node_usermodel
node_snapmodel -.->|"persists snaps"| node_mongodb
node_usermodel -.->|"persists accounts"| node_mongodb
node_api -.->|"stores screenshots"| node_cloudinary
node_api -->|"sends account mail"| node_email
node_app -->|"resumes timestamp"| node_youtube

click node_extension "https://github.com/srivarshini0969/snapstudy/blob/main/snapstudy-extension/popup.js"
click node_app "https://github.com/srivarshini0969/snapstudy/blob/main/frontend/src/App.js"
click node_timestamp "https://github.com/srivarshini0969/snapstudy/blob/main/frontend/src/utils/formatTimestamp.js"
click node_subjects "https://github.com/srivarshini0969/snapstudy/blob/main/frontend/src/utils/subjectKeywords.js"
click node_verifyview "https://github.com/srivarshini0969/snapstudy/blob/main/frontend/src/pages/VerifyEmail.js"
click node_resetview "https://github.com/srivarshini0969/snapstudy/blob/main/frontend/src/ResetPassword.js"
click node_api "https://github.com/srivarshini0969/snapstudy/blob/main/backend/index.js"
click node_authmw "https://github.com/srivarshini0969/snapstudy/blob/main/backend/middleware/authMiddleware.js"
click node_snapmodel "https://github.com/srivarshini0969/snapstudy/blob/main/backend/models/Snap.js"
click node_usermodel "https://github.com/srivarshini0969/snapstudy/blob/main/backend/models/User.js"
click node_ocr "https://github.com/srivarshini0969/snapstudy/blob/main/frontend/src/App.js"
click node_analytics "https://github.com/srivarshini0969/snapstudy/blob/main/frontend/src/App.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_extension toneBlue
class node_app,node_timestamp,node_subjects,node_verifyview,node_resetview,node_ocr,node_analytics,node_mongodb toneAmber
class node_api,node_snapmodel toneMint
class node_authmw,node_usermodel toneRose
class node_student,node_youtube,node_cloudinary,node_email toneIndigo
```

## Components

### Lecture capture

- [Extension popup](https://github.com/srivarshini0969/snapstudy/blob/main/snapstudy-extension/popup.js): `snapstudy-extension/popup.js`

### Study workspace

- [React study app](https://github.com/srivarshini0969/snapstudy/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [Timestamp formatter](https://github.com/srivarshini0969/snapstudy/blob/main/frontend/src/utils/formatTimestamp.js): `frontend/src/utils/formatTimestamp.js`
- [Subject keywords](https://github.com/srivarshini0969/snapstudy/blob/main/frontend/src/utils/subjectKeywords.js): `frontend/src/utils/subjectKeywords.js`
- [Email verification view](https://github.com/srivarshini0969/snapstudy/blob/main/frontend/src/pages/VerifyEmail.js): `frontend/src/pages/VerifyEmail.js`
- [Password reset view](https://github.com/srivarshini0969/snapstudy/blob/main/frontend/src/ResetPassword.js): `frontend/src/ResetPassword.js`
- [Screenshot OCR](https://github.com/srivarshini0969/snapstudy/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [Subject analytics](https://github.com/srivarshini0969/snapstudy/blob/main/frontend/src/App.js): `frontend/src/App.js`

### Backend services

- [Express API](https://github.com/srivarshini0969/snapstudy/blob/main/backend/index.js): `backend/index.js`
- [Snap records](https://github.com/srivarshini0969/snapstudy/blob/main/backend/models/Snap.js): `backend/models/Snap.js`

### Accounts

- [JWT middleware](https://github.com/srivarshini0969/snapstudy/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`
- [User records](https://github.com/srivarshini0969/snapstudy/blob/main/backend/models/User.js): `backend/models/User.js`

### Other components

- **Student**
- **YouTube lecture**
- **MongoDB**
- **Cloudinary**
- **Email service**

## Connections

- Student → Extension popup: captures with (evidence: `README.md`)
- Extension popup → YouTube lecture: reads video (evidence: `snapstudy-extension/popup.js`)
- Extension popup → Express API: uploads capture (evidence: `snapstudy-extension/popup.js`)
- Student → React study app: manages snaps (evidence: `README.md`)
- React study app → Express API: requests snaps (evidence: `frontend/src/App.js`)
- React study app → Timestamp formatter: formats time (evidence: `frontend/src/App.js`)
- React study app → Subject keywords: classifies subjects (evidence: `frontend/src/App.js`)
- React study app → Email verification view: routes to (evidence: `frontend/src/App.js`)
- React study app → Password reset view: routes to (evidence: `frontend/src/App.js`)
- Email verification view → Express API: verifies account (evidence: `frontend/src/pages/VerifyEmail.js`)
- React study app → Screenshot OCR: analyzes screenshot (evidence: `frontend/src/App.js`)
- React study app → Subject analytics: shows summaries (evidence: `frontend/src/App.js`)
- Express API → JWT middleware: guards routes (evidence: `backend/index.js`)
- Express API → Snap records: creates and queries (evidence: `backend/index.js`)
- Express API → User records: authenticates users (evidence: `backend/index.js`)
- Snap records → MongoDB: persists snaps
- User records → MongoDB: persists accounts
- Express API → Cloudinary: stores screenshots (evidence: `README.md`)
- Express API → Email service: sends account mail (evidence: `backend/index.js`)
- React study app → YouTube lecture: resumes timestamp (evidence: `README.md`)
