# cassidyjames011-coder/studioza architecture

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

- Interactive diagram: https://gitdiagram.com/cassidyjames011-coder/studioza
- Repository: https://github.com/cassidyjames011-coder/studioza

## Overview

Studioza creates focused study sprints from source materials. The apparent workflow is that a learner provides materials and study preferences, the service reads sources, generates questions, checks them for validity and duplication, then returns a response. The sampled worker also shows website fetching, Gemini integration, and a shared daily quota. The README is brief and the frontend was not sampled, so its interactions and links to the worker are shown only as unverified; evaluation scripts and tests are excluded as development tooling.

Main entry points: [`worker.js`](https://github.com/cassidyjames011-coder/studioza/blob/main/worker.js) (Request handler), [`index.html`](https://github.com/cassidyjames011-coder/studioza/blob/main/index.html) (Study interface), [`studioza-theme.js`](https://github.com/cassidyjames011-coder/studioza/blob/main/studioza-theme.js) (Theme preferences), [`question-uniqueness.mjs`](https://github.com/cassidyjames011-coder/studioza/blob/main/question-uniqueness.mjs) (Uniqueness checks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Learner experience"]
  node_studioza_ui["Study interface<br/>[index.html]"]
  node_theme["Theme preferences<br/>[studioza-theme.js]"]
end

subgraph group_service["Question service"]
  node_request_handler["Request handler<br/>[worker.js]"]
  node_source_intake["Source intake<br/>[worker.js]"]
  node_website_reader["Website reader<br/>[worker.js]"]
  node_question_generation["Question generation<br/>[worker.js]"]
  node_length_guidance["Length guidance<br/>[worker.js]"]
  node_question_length_config["Length presets<br/>[question-length.js]"]
  node_quota_reservation["Quota reservation<br/>[worker.js]"]
end

subgraph group_quality["Question quality"]
  node_question_validation["Question validation<br/>[worker.js]"]
  node_uniqueness_checks["Uniqueness checks"]
end

subgraph group_infrastructure["External services"]
  node_quota_store[("Daily quota store<br/>[worker.js]")]
  node_gemini["Gemini API"]
end

node_learner(("Learner"))
node_source_website["Source websites"]

node_learner -.->|"uses"| node_studioza_ui
node_studioza_ui -.->|"submits requests"| node_request_handler
node_request_handler -->|"validates sources"| node_source_intake
node_source_intake -->|"fetches websites"| node_website_reader
node_website_reader -->|"reads pages"| node_source_website
node_request_handler -->|"sets length instructions"| node_length_guidance
node_request_handler -->|"reserves quota"| node_quota_reservation
node_quota_reservation -->|"updates counts"| node_quota_store
node_request_handler -->|"requests generation"| node_gemini
node_request_handler -->|"validates candidates"| node_question_validation
node_question_validation -->|"checks duplicates"| node_uniqueness_checks
node_theme -.->|"applies theme"| node_studioza_ui

click node_studioza_ui "https://github.com/cassidyjames011-coder/studioza/blob/main/index.html"
click node_theme "https://github.com/cassidyjames011-coder/studioza/blob/main/studioza-theme.js"
click node_request_handler "https://github.com/cassidyjames011-coder/studioza/blob/main/worker.js"
click node_source_intake "https://github.com/cassidyjames011-coder/studioza/blob/main/worker.js"
click node_website_reader "https://github.com/cassidyjames011-coder/studioza/blob/main/worker.js"
click node_question_generation "https://github.com/cassidyjames011-coder/studioza/blob/main/worker.js"
click node_length_guidance "https://github.com/cassidyjames011-coder/studioza/blob/main/worker.js"
click node_question_length_config "https://github.com/cassidyjames011-coder/studioza/blob/main/question-length.js"
click node_question_validation "https://github.com/cassidyjames011-coder/studioza/blob/main/worker.js"
click node_uniqueness_checks "https://github.com/cassidyjames011-coder/studioza/blob/main/question-uniqueness.mjs"
click node_quota_reservation "https://github.com/cassidyjames011-coder/studioza/blob/main/worker.js"
click node_quota_store "https://github.com/cassidyjames011-coder/studioza/blob/main/worker.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_studioza_ui,node_theme toneBlue
class node_request_handler,node_source_intake,node_website_reader,node_question_generation,node_length_guidance,node_question_length_config,node_quota_reservation toneAmber
class node_question_validation,node_uniqueness_checks toneMint
class node_quota_store,node_gemini toneRose
class node_learner,node_source_website toneIndigo
```

## Components

### Learner experience

- [Study interface](https://github.com/cassidyjames011-coder/studioza/blob/main/index.html): `index.html`
- [Theme preferences](https://github.com/cassidyjames011-coder/studioza/blob/main/studioza-theme.js): `studioza-theme.js`

### Question service

- [Request handler](https://github.com/cassidyjames011-coder/studioza/blob/main/worker.js): `worker.js`
- [Source intake](https://github.com/cassidyjames011-coder/studioza/blob/main/worker.js): `worker.js`
- [Website reader](https://github.com/cassidyjames011-coder/studioza/blob/main/worker.js): `worker.js`
- [Question generation](https://github.com/cassidyjames011-coder/studioza/blob/main/worker.js): `worker.js`
- [Length guidance](https://github.com/cassidyjames011-coder/studioza/blob/main/worker.js): `worker.js`
- [Length presets](https://github.com/cassidyjames011-coder/studioza/blob/main/question-length.js): `question-length.js`
- [Quota reservation](https://github.com/cassidyjames011-coder/studioza/blob/main/worker.js): `worker.js`

### Question quality

- [Question validation](https://github.com/cassidyjames011-coder/studioza/blob/main/worker.js): `worker.js`
- [Uniqueness checks](https://github.com/cassidyjames011-coder/studioza/blob/main/question-uniqueness.mjs): `question-uniqueness.mjs`

### External services

- [Daily quota store](https://github.com/cassidyjames011-coder/studioza/blob/main/worker.js): `worker.js`
- **Gemini API**

### Other components

- **Learner**
- **Source websites**

## Connections

- Learner → Study interface: uses
- Study interface → Request handler: submits requests
- Request handler → Source intake: validates sources (evidence: `worker.js`)
- Source intake → Website reader: fetches websites (evidence: `worker.js`)
- Website reader → Source websites: reads pages (evidence: `worker.js`)
- Request handler → Length guidance: sets length instructions (evidence: `worker.js`)
- Request handler → Quota reservation: reserves quota (evidence: `worker.js`)
- Quota reservation → Daily quota store: updates counts (evidence: `worker.js`)
- Request handler → Gemini API: requests generation (evidence: `worker.js`)
- Request handler → Question validation: validates candidates (evidence: `worker.js`)
- Question validation → Uniqueness checks: checks duplicates (evidence: `worker.js`)
- Theme preferences → Study interface: applies theme
