# sudo-workspace/cybrstudy architecture

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

- Interactive diagram: https://gitdiagram.com/sudo-workspace/cybrstudy
- Repository: https://github.com/sudo-workspace/cybrstudy

## Overview

CybrStudy combines an authenticated study-material platform with an automated hackathon discovery subsystem. The primary user flow is login, browse sections, and preview study files; administrators manage content, users, notifications, and hackathons. Discovery aggregates external event sources and processes events through extraction, normalization, classification, validation, deduplication, and Firestore synchronization. The graph follows sampled imports and calls plus README-documented capabilities; source adapter and some runtime details were not sampled, so uncertain connections are omitted.

Main entry points: [`backend/discovery/scheduler/runDiscovery.js`](https://github.com/sudo-workspace/cybrstudy/blob/main/backend/discovery/scheduler/runDiscovery.js) (Discovery Scheduler), [`src/pages/AdminPage.jsx`](https://github.com/sudo-workspace/cybrstudy/blob/main/src/pages/AdminPage.jsx) (Admin Dashboard), [`src/services/firebase.js`](https://github.com/sudo-workspace/cybrstudy/blob/main/src/services/firebase.js) (Firestore Helpers), [`src/pages/BrowsePage.jsx`](https://github.com/sudo-workspace/cybrstudy/blob/main/src/pages/BrowsePage.jsx) (Browse Materials)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Study Platform"]
  node_app["App Router<br/>[App.jsx]"]
  node_browse["Browse Materials<br/>[BrowsePage.jsx]"]
  node_preview["Media Preview<br/>[MediaPreview.jsx]"]
  node_login["Login Page<br/>[LoginPage.jsx]"]
  node_hackathons["Hackathon Listings<br/>[HackathonsPage.jsx]"]
end

subgraph group_admin["Administration"]
  node_adminpage["Admin Dashboard<br/>[AdminPage.jsx]"]
  node_uploader["File Uploader<br/>[FileUploader.jsx]"]
  node_sectionsadmin["Section Manager<br/>[SectionManager.jsx]"]
  node_usersadmin["User Manager<br/>[UserManager.jsx]"]
  node_notificationsadmin["Notification Manager"]
  node_hackathonadmin["Hackathon Manager"]
end

subgraph group_data["Identity And Data"]
  node_sections["Section Subscription<br/>[useSections.js]"]
  node_files["File Subscription<br/>[useFiles.js]"]
  node_drive["Drive Proxy<br/>[driveService.js]"]
  node_firebase[("Firestore Helpers<br/>[firebase.js]")]
  node_auth["Auth Context<br/>[AuthContext.jsx]"]
  node_authservice["Authentication Service<br/>[authService.js]"]
  node_notificationservice["Notification Service"]
  node_hackathonservice["Hackathon Service"]
  node_hackathonhook["Hackathon Subscription<br/>[useHackathons.js]"]
end

subgraph group_discovery["Hackathon Discovery"]
  node_scheduler["Discovery Scheduler<br/>[runDiscovery.js]"]
  node_sources["Source Connectors"]
  node_fetcher["HTTP Fetcher<br/>[httpFetcher.js]"]
  node_sync["Firestore Sync<br/>[firestoreSync.js]"]
end

subgraph group_pipeline["Event Processing"]
  node_extractor["Event Extraction<br/>[eventExtractor.js]"]
  node_normalizer["Event Normalizer<br/>[eventNormalizer.js]"]
  node_classifier["Event Classifier<br/>[eventClassifier.js]"]
  node_validator["Event Validator<br/>[eventValidator.js]"]
  node_deduplicator["Event Deduplicator"]
end

node_visitor(("User"))
node_external(("Event Sources"))
node_firestore[("Firebase Firestore")]

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_browse
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_adminpage
node_browse -->|"loads"| node_sections
node_browse -->|"loads"| node_files
node_browse -->|"renders"| node_preview
node_browse -->|"renames sections"| node_firebase
node_sections -->|"subscribes"| node_firebase
node_files -->|"reads files"| node_firebase
node_preview -->|"loads media"| node_drive
node_login -->|"uses auth state"| node_auth
node_auth -->|"checks sessions"| node_authservice
node_authservice -->|"reads profiles"| node_firebase
node_adminpage -->|"renders"| node_uploader
node_adminpage -->|"renders"| node_sectionsadmin
node_adminpage -->|"renders"| node_usersadmin
node_adminpage -->|"renders"| node_notificationsadmin
node_adminpage -->|"renders"| node_hackathonadmin
node_usersadmin -->|"manages accounts"| node_authservice
node_notificationsadmin -->|"manages notices"| node_notificationservice
node_notificationservice -->|"stores notices"| node_firebase
node_hackathonadmin -->|"manages events"| node_hackathonservice
node_hackathonservice -->|"stores events"| node_firebase
node_hackathonhook -->|"subscribes"| node_hackathonservice
node_hackathons -->|"loads listings"| node_hackathonhook
node_external -->|"provides events"| node_sources
node_sources -->|"registered with"| node_scheduler
node_scheduler -->|"extracts events"| node_extractor
node_scheduler -->|"normalizes events"| node_normalizer
node_scheduler -->|"classifies events"| node_classifier
node_scheduler -->|"validates events"| node_validator
node_scheduler -->|"deduplicates events"| node_deduplicator
node_scheduler -->|"syncs events"| node_sync
node_extractor -.->|"fetches sources"| node_fetcher
node_sync -.->|"writes events"| node_firestore

click node_app "https://github.com/sudo-workspace/cybrstudy/blob/main/src/App.jsx"
click node_browse "https://github.com/sudo-workspace/cybrstudy/blob/main/src/pages/BrowsePage.jsx"
click node_sections "https://github.com/sudo-workspace/cybrstudy/blob/main/src/hooks/useSections.js"
click node_files "https://github.com/sudo-workspace/cybrstudy/blob/main/src/hooks/useFiles.js"
click node_preview "https://github.com/sudo-workspace/cybrstudy/blob/main/src/components/files/MediaPreview.jsx"
click node_drive "https://github.com/sudo-workspace/cybrstudy/blob/main/src/services/driveService.js"
click node_firebase "https://github.com/sudo-workspace/cybrstudy/blob/main/src/services/firebase.js"
click node_login "https://github.com/sudo-workspace/cybrstudy/blob/main/src/pages/LoginPage.jsx"
click node_auth "https://github.com/sudo-workspace/cybrstudy/blob/main/src/context/AuthContext.jsx"
click node_authservice "https://github.com/sudo-workspace/cybrstudy/blob/main/src/services/authService.js"
click node_adminpage "https://github.com/sudo-workspace/cybrstudy/blob/main/src/pages/AdminPage.jsx"
click node_uploader "https://github.com/sudo-workspace/cybrstudy/blob/main/src/components/admin/FileUploader.jsx"
click node_sectionsadmin "https://github.com/sudo-workspace/cybrstudy/blob/main/src/components/admin/SectionManager.jsx"
click node_usersadmin "https://github.com/sudo-workspace/cybrstudy/blob/main/src/components/admin/UserManager.jsx"
click node_notificationsadmin "https://github.com/sudo-workspace/cybrstudy/blob/main/src/components/admin/NotificationManager.jsx"
click node_notificationservice "https://github.com/sudo-workspace/cybrstudy/blob/main/src/services/notificationService.js"
click node_hackathonadmin "https://github.com/sudo-workspace/cybrstudy/blob/main/src/components/admin/HackathonManager.jsx"
click node_hackathonservice "https://github.com/sudo-workspace/cybrstudy/blob/main/src/services/hackathonService.js"
click node_hackathonhook "https://github.com/sudo-workspace/cybrstudy/blob/main/src/hooks/useHackathons.js"
click node_hackathons "https://github.com/sudo-workspace/cybrstudy/blob/main/src/pages/HackathonsPage.jsx"
click node_scheduler "https://github.com/sudo-workspace/cybrstudy/blob/main/backend/discovery/scheduler/runDiscovery.js"
click node_sources "https://github.com/sudo-workspace/cybrstudy/tree/main/backend/discovery/sources"
click node_extractor "https://github.com/sudo-workspace/cybrstudy/blob/main/backend/discovery/extractors/eventExtractor.js"
click node_fetcher "https://github.com/sudo-workspace/cybrstudy/blob/main/backend/discovery/fetcher/httpFetcher.js"
click node_normalizer "https://github.com/sudo-workspace/cybrstudy/blob/main/backend/discovery/normalizer/eventNormalizer.js"
click node_classifier "https://github.com/sudo-workspace/cybrstudy/blob/main/backend/discovery/classifier/eventClassifier.js"
click node_validator "https://github.com/sudo-workspace/cybrstudy/blob/main/backend/discovery/validator/eventValidator.js"
click node_deduplicator "https://github.com/sudo-workspace/cybrstudy/blob/main/backend/discovery/deduplicator/eventDeduplicator.js"
click node_sync "https://github.com/sudo-workspace/cybrstudy/blob/main/backend/discovery/firestore/firestoreSync.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_browse,node_preview,node_login,node_hackathons,node_visitor toneBlue
class node_adminpage,node_uploader,node_sectionsadmin,node_usersadmin,node_notificationsadmin,node_hackathonadmin,node_firestore toneAmber
class node_sections,node_files,node_drive,node_firebase,node_auth,node_authservice,node_notificationservice,node_hackathonservice,node_hackathonhook toneMint
class node_scheduler,node_sources,node_fetcher,node_sync toneRose
class node_extractor,node_normalizer,node_classifier,node_validator,node_deduplicator,node_external toneIndigo
```

## Components

### Study Platform

- [App Router](https://github.com/sudo-workspace/cybrstudy/blob/main/src/App.jsx): `src/App.jsx`
- [Browse Materials](https://github.com/sudo-workspace/cybrstudy/blob/main/src/pages/BrowsePage.jsx): `src/pages/BrowsePage.jsx`
- [Media Preview](https://github.com/sudo-workspace/cybrstudy/blob/main/src/components/files/MediaPreview.jsx): `src/components/files/MediaPreview.jsx`
- [Login Page](https://github.com/sudo-workspace/cybrstudy/blob/main/src/pages/LoginPage.jsx): `src/pages/LoginPage.jsx`
- [Hackathon Listings](https://github.com/sudo-workspace/cybrstudy/blob/main/src/pages/HackathonsPage.jsx): `src/pages/HackathonsPage.jsx`

### Administration

- [Admin Dashboard](https://github.com/sudo-workspace/cybrstudy/blob/main/src/pages/AdminPage.jsx): `src/pages/AdminPage.jsx`
- [File Uploader](https://github.com/sudo-workspace/cybrstudy/blob/main/src/components/admin/FileUploader.jsx): `src/components/admin/FileUploader.jsx`
- [Section Manager](https://github.com/sudo-workspace/cybrstudy/blob/main/src/components/admin/SectionManager.jsx): `src/components/admin/SectionManager.jsx`
- [User Manager](https://github.com/sudo-workspace/cybrstudy/blob/main/src/components/admin/UserManager.jsx): `src/components/admin/UserManager.jsx`
- [Notification Manager](https://github.com/sudo-workspace/cybrstudy/blob/main/src/components/admin/NotificationManager.jsx): `src/components/admin/NotificationManager.jsx`
- [Hackathon Manager](https://github.com/sudo-workspace/cybrstudy/blob/main/src/components/admin/HackathonManager.jsx): `src/components/admin/HackathonManager.jsx`

### Identity And Data

- [Section Subscription](https://github.com/sudo-workspace/cybrstudy/blob/main/src/hooks/useSections.js): `src/hooks/useSections.js`
- [File Subscription](https://github.com/sudo-workspace/cybrstudy/blob/main/src/hooks/useFiles.js): `src/hooks/useFiles.js`
- [Drive Proxy](https://github.com/sudo-workspace/cybrstudy/blob/main/src/services/driveService.js): `src/services/driveService.js`
- [Firestore Helpers](https://github.com/sudo-workspace/cybrstudy/blob/main/src/services/firebase.js): `src/services/firebase.js`
- [Auth Context](https://github.com/sudo-workspace/cybrstudy/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Authentication Service](https://github.com/sudo-workspace/cybrstudy/blob/main/src/services/authService.js): `src/services/authService.js`
- [Notification Service](https://github.com/sudo-workspace/cybrstudy/blob/main/src/services/notificationService.js): `src/services/notificationService.js`
- [Hackathon Service](https://github.com/sudo-workspace/cybrstudy/blob/main/src/services/hackathonService.js): `src/services/hackathonService.js`
- [Hackathon Subscription](https://github.com/sudo-workspace/cybrstudy/blob/main/src/hooks/useHackathons.js): `src/hooks/useHackathons.js`

### Hackathon Discovery

- [Discovery Scheduler](https://github.com/sudo-workspace/cybrstudy/blob/main/backend/discovery/scheduler/runDiscovery.js): `backend/discovery/scheduler/runDiscovery.js`
- [Source Connectors](https://github.com/sudo-workspace/cybrstudy/tree/main/backend/discovery/sources): `backend/discovery/sources`
- [HTTP Fetcher](https://github.com/sudo-workspace/cybrstudy/blob/main/backend/discovery/fetcher/httpFetcher.js): `backend/discovery/fetcher/httpFetcher.js`
- [Firestore Sync](https://github.com/sudo-workspace/cybrstudy/blob/main/backend/discovery/firestore/firestoreSync.js): `backend/discovery/firestore/firestoreSync.js`

### Event Processing

- [Event Extraction](https://github.com/sudo-workspace/cybrstudy/blob/main/backend/discovery/extractors/eventExtractor.js): `backend/discovery/extractors/eventExtractor.js`
- [Event Normalizer](https://github.com/sudo-workspace/cybrstudy/blob/main/backend/discovery/normalizer/eventNormalizer.js): `backend/discovery/normalizer/eventNormalizer.js`
- [Event Classifier](https://github.com/sudo-workspace/cybrstudy/blob/main/backend/discovery/classifier/eventClassifier.js): `backend/discovery/classifier/eventClassifier.js`
- [Event Validator](https://github.com/sudo-workspace/cybrstudy/blob/main/backend/discovery/validator/eventValidator.js): `backend/discovery/validator/eventValidator.js`
- [Event Deduplicator](https://github.com/sudo-workspace/cybrstudy/blob/main/backend/discovery/deduplicator/eventDeduplicator.js): `backend/discovery/deduplicator/eventDeduplicator.js`

### Other components

- **User**
- **Event Sources**
- **Firebase Firestore**

## Connections

- User → App Router: opens (evidence: `src/App.jsx`)
- App Router → Browse Materials: routes to (evidence: `src/App.jsx`)
- App Router → Login Page: routes to (evidence: `src/App.jsx`)
- App Router → Admin Dashboard: routes to (evidence: `src/App.jsx`)
- Browse Materials → Section Subscription: loads (evidence: `src/pages/BrowsePage.jsx`)
- Browse Materials → File Subscription: loads (evidence: `src/pages/BrowsePage.jsx`)
- Browse Materials → Media Preview: renders (evidence: `src/pages/BrowsePage.jsx`)
- Browse Materials → Firestore Helpers: renames sections (evidence: `src/pages/BrowsePage.jsx`)
- Section Subscription → Firestore Helpers: subscribes (evidence: `src/hooks/useSections.js`)
- File Subscription → Firestore Helpers: reads files (evidence: `src/hooks/useFiles.js`)
- Media Preview → Drive Proxy: loads media (evidence: `src/components/files/MediaPreview.jsx`)
- Login Page → Auth Context: uses auth state (evidence: `src/pages/LoginPage.jsx`)
- Auth Context → Authentication Service: checks sessions (evidence: `src/context/AuthContext.jsx`)
- Authentication Service → Firestore Helpers: reads profiles (evidence: `src/services/authService.js`)
- Admin Dashboard → File Uploader: renders (evidence: `src/pages/AdminPage.jsx`)
- Admin Dashboard → Section Manager: renders (evidence: `src/pages/AdminPage.jsx`)
- Admin Dashboard → User Manager: renders (evidence: `src/pages/AdminPage.jsx`)
- Admin Dashboard → Notification Manager: renders (evidence: `src/pages/AdminPage.jsx`)
- Admin Dashboard → Hackathon Manager: renders (evidence: `src/pages/AdminPage.jsx`)
- User Manager → Authentication Service: manages accounts (evidence: `src/components/admin/UserManager.jsx`)
- Notification Manager → Notification Service: manages notices (evidence: `src/components/admin/NotificationManager.jsx`)
- Notification Service → Firestore Helpers: stores notices (evidence: `src/services/notificationService.js`)
- Hackathon Manager → Hackathon Service: manages events (evidence: `src/components/admin/HackathonManager.jsx`)
- Hackathon Service → Firestore Helpers: stores events (evidence: `src/services/hackathonService.js`)
- Hackathon Subscription → Hackathon Service: subscribes (evidence: `src/hooks/useHackathons.js`)
- Hackathon Listings → Hackathon Subscription: loads listings (evidence: `src/pages/HackathonsPage.jsx`)
- Event Sources → Source Connectors: provides events (evidence: `README.md`)
- Source Connectors → Discovery Scheduler: registered with (evidence: `backend/discovery/scheduler/runDiscovery.js`)
- Discovery Scheduler → Event Extraction: extracts events (evidence: `backend/discovery/scheduler/runDiscovery.js`)
- Discovery Scheduler → Event Normalizer: normalizes events (evidence: `backend/discovery/scheduler/runDiscovery.js`)
- Discovery Scheduler → Event Classifier: classifies events (evidence: `backend/discovery/scheduler/runDiscovery.js`)
- Discovery Scheduler → Event Validator: validates events (evidence: `backend/discovery/scheduler/runDiscovery.js`)
- Discovery Scheduler → Event Deduplicator: deduplicates events (evidence: `backend/discovery/scheduler/runDiscovery.js`)
- Discovery Scheduler → Firestore Sync: syncs events (evidence: `backend/discovery/scheduler/runDiscovery.js`)
- Event Extraction → HTTP Fetcher: fetches sources
- Firestore Sync → Firebase Firestore: writes events
