# r4r1ty-tech/aistudydevb2bsaas architecture

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

- Interactive diagram: https://gitdiagram.com/r4r1ty-tech/aistudydevb2bsaas
- Repository: https://github.com/r4r1ty-tech/aistudydevb2bsaas

## Overview

SSAU lecture bot is a set of four Go services sharing SQLite: Telegram onboarding and lecture tools, schedule refresh, a password-protected Mini App, and BBB guest joining/recording. BBB recordings can be processed into lecture materials and published. The map preserves documented Telegram features and the recording pipeline; some module internals were not excerpted, so uncertain links are omitted.

Main entry points: [`internal/store/store.go`](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/store/store.go) (Shared SQLite), [`internal/bbb/worker_lecture.go`](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/bbb/worker_lecture.go) (Lecture processing), [`internal/bbb/worker.go`](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/bbb/worker.go) (Join and recording), [`internal/rasp/refresh.go`](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/rasp/refresh.go) (Schedule refresh)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User interfaces"]
  node_tg["Bot service<br/>[main.go]"]
  node_bot["Bot interactions<br/>[handlers.go]"]
  node_bot_features["Bot features"]
  node_panel["Mini App service<br/>[main.go]"]
  node_web["Web server<br/>[server.go]"]
  node_api["JSON API<br/>[api.go]"]
  node_web_ui["Mini App UI<br/>[app.js]"]
end

subgraph group_schedule["Schedule service"]
  node_rasp["Schedule service<br/>[main.go]"]
  node_refresh["Schedule refresh<br/>[refresh.go]"]
  node_fetch["Schedule fetch<br/>[fetch.go]"]
  node_parse["Schedule parsing<br/>[parse.go]"]
end

subgraph group_bbb["BBB operations"]
  node_bbb_service["BBB service<br/>[main.go]"]
  node_worker["Join and recording<br/>[worker.go]"]
  node_chrome["Chromium joiner<br/>[chrome.go]"]
  node_testjoin["Test joining<br/>[worker_testjoin.go]"]
end

subgraph group_content["Lecture materials"]
  node_capture["Audio capture<br/>[merge.go]"]
  node_lecture["Lecture processing<br/>[worker_lecture.go]"]
  node_notes["Notes generation<br/>[run.go]"]
  node_archive["Lecture archive<br/>[path.go]"]
  node_publish["GitHub publishing<br/>[github.go]"]
end

subgraph group_shared["Shared data and runtime"]
  node_sqlite[("Shared SQLite<br/>[store.go]")]
  node_app_runtime["Service runtime<br/>[run.go]"]
  node_model["Domain model<br/>[model.go]"]
end

node_student(("Student"))
node_admin(("Administrator"))
node_telegram(("Telegram"))

node_student -->|"uses"| node_telegram
node_telegram -->|"sends updates"| node_tg
node_tg -->|"starts bot"| node_bot
node_bot -->|"reads and writes"| node_sqlite
node_bot -.->|"serves features"| node_bot_features
node_admin -->|"opens Mini App"| node_panel
node_panel -->|"starts server"| node_web
node_web -->|"routes requests"| node_api
node_web -.->|"serves interface"| node_web_ui
node_web -->|"accesses data"| node_sqlite
node_panel -->|"requests refresh"| node_refresh
node_rasp -->|"runs refresh"| node_refresh
node_refresh -->|"fetches schedule"| node_fetch
node_refresh -->|"parses response"| node_parse
node_refresh -->|"saves schedule"| node_sqlite
node_bbb_service -->|"runs worker"| node_worker
node_worker -->|"reads and writes"| node_sqlite
node_worker -->|"joins rooms"| node_chrome
node_worker -->|"starts processing"| node_lecture
node_worker -->|"handles test joins"| node_testjoin
node_lecture -->|"records audio"| node_capture
node_lecture -->|"organizes packs"| node_archive
node_lecture -->|"builds notes"| node_notes
node_lecture -->|"publishes materials"| node_publish
node_lecture -->|"tracks pack state"| node_sqlite
node_tg -->|"shares data"| node_sqlite
node_rasp -->|"shares data"| node_sqlite
node_bbb_service -->|"shares data"| node_sqlite
node_app_runtime -->|"opens store"| node_sqlite
node_sqlite -->|"stores domain records"| node_model

click node_tg "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/cmd/tg/main.go"
click node_bot "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/tg/handlers.go"
click node_bot_features "https://github.com/r4r1ty-tech/aistudydevb2bsaas/tree/plan/internal/tg"
click node_panel "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/cmd/panel/main.go"
click node_web "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/webapp/server.go"
click node_api "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/webapp/api.go"
click node_web_ui "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/webapp/static/app.js"
click node_rasp "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/cmd/rasp/main.go"
click node_refresh "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/rasp/refresh.go"
click node_fetch "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/rasp/fetch.go"
click node_parse "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/rasp/parse.go"
click node_bbb_service "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/cmd/bbb/main.go"
click node_worker "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/bbb/worker.go"
click node_chrome "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/bbb/chrome.go"
click node_testjoin "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/bbb/worker_testjoin.go"
click node_capture "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/capture/merge.go"
click node_lecture "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/bbb/worker_lecture.go"
click node_notes "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/notes/run.go"
click node_archive "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/archive/path.go"
click node_publish "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/publish/github.go"
click node_sqlite "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/store/store.go"
click node_app_runtime "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/app/run.go"
click node_model "https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/model/model.go"

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_tg,node_bot,node_bot_features,node_panel,node_web,node_api,node_web_ui toneBlue
class node_rasp,node_refresh,node_fetch,node_parse toneAmber
class node_bbb_service,node_worker,node_chrome,node_testjoin toneMint
class node_capture,node_lecture,node_notes,node_archive,node_publish toneRose
class node_sqlite,node_app_runtime,node_model,node_student,node_admin,node_telegram toneIndigo
```

## Components

### User interfaces

- [Bot service](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/cmd/tg/main.go): `cmd/tg/main.go`
- [Bot interactions](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/tg/handlers.go): `internal/tg/handlers.go`
- [Bot features](https://github.com/r4r1ty-tech/aistudydevb2bsaas/tree/plan/internal/tg): `internal/tg`
- [Mini App service](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/cmd/panel/main.go): `cmd/panel/main.go`
- [Web server](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/webapp/server.go): `internal/webapp/server.go`
- [JSON API](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/webapp/api.go): `internal/webapp/api.go`
- [Mini App UI](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/webapp/static/app.js): `internal/webapp/static/app.js`

### Schedule service

- [Schedule service](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/cmd/rasp/main.go): `cmd/rasp/main.go`
- [Schedule refresh](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/rasp/refresh.go): `internal/rasp/refresh.go`
- [Schedule fetch](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/rasp/fetch.go): `internal/rasp/fetch.go`
- [Schedule parsing](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/rasp/parse.go): `internal/rasp/parse.go`

### BBB operations

- [BBB service](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/cmd/bbb/main.go): `cmd/bbb/main.go`
- [Join and recording](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/bbb/worker.go): `internal/bbb/worker.go`
- [Chromium joiner](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/bbb/chrome.go): `internal/bbb/chrome.go`
- [Test joining](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/bbb/worker_testjoin.go): `internal/bbb/worker_testjoin.go`

### Lecture materials

- [Audio capture](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/capture/merge.go): `internal/capture/merge.go`
- [Lecture processing](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/bbb/worker_lecture.go): `internal/bbb/worker_lecture.go`
- [Notes generation](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/notes/run.go): `internal/notes/run.go`
- [Lecture archive](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/archive/path.go): `internal/archive/path.go`
- [GitHub publishing](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/publish/github.go): `internal/publish/github.go`

### Shared data and runtime

- [Shared SQLite](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/store/store.go): `internal/store/store.go`
- [Service runtime](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/app/run.go): `internal/app/run.go`
- [Domain model](https://github.com/r4r1ty-tech/aistudydevb2bsaas/blob/plan/internal/model/model.go): `internal/model/model.go`

### Other components

- **Student**
- **Administrator**
- **Telegram**

## Connections

- Student → Telegram: uses (evidence: `README.md`)
- Telegram → Bot service: sends updates (evidence: `README.md`)
- Bot service → Bot interactions: starts bot (evidence: `cmd/tg/main.go`)
- Bot interactions → Shared SQLite: reads and writes (evidence: `internal/tg/handlers.go`)
- Bot interactions → Bot features: serves features
- Administrator → Mini App service: opens Mini App (evidence: `README.md`)
- Mini App service → Web server: starts server (evidence: `cmd/panel/main.go`)
- Web server → JSON API: routes requests (evidence: `internal/webapp/server.go`)
- Web server → Mini App UI: serves interface
- Web server → Shared SQLite: accesses data (evidence: `README.md`)
- Mini App service → Schedule refresh: requests refresh (evidence: `cmd/panel/main.go`)
- Schedule service → Schedule refresh: runs refresh (evidence: `cmd/rasp/main.go`)
- Schedule refresh → Schedule fetch: fetches schedule (evidence: `internal/rasp/refresh.go`)
- Schedule refresh → Schedule parsing: parses response (evidence: `internal/rasp/refresh.go`)
- Schedule refresh → Shared SQLite: saves schedule (evidence: `internal/rasp/refresh.go`)
- BBB service → Join and recording: runs worker (evidence: `cmd/bbb/main.go`)
- Join and recording → Shared SQLite: reads and writes (evidence: `internal/bbb/worker.go`)
- Join and recording → Chromium joiner: joins rooms (evidence: `internal/bbb/worker.go`)
- Join and recording → Lecture processing: starts processing (evidence: `internal/bbb/worker_lecture.go`)
- Join and recording → Test joining: handles test joins (evidence: `internal/bbb/worker_testjoin.go`)
- Lecture processing → Audio capture: records audio (evidence: `internal/bbb/worker_lecture.go`)
- Lecture processing → Lecture archive: organizes packs (evidence: `internal/bbb/worker_lecture.go`)
- Lecture processing → Notes generation: builds notes (evidence: `internal/bbb/worker_lecture.go`)
- Lecture processing → GitHub publishing: publishes materials (evidence: `internal/bbb/worker_lecture.go`)
- Lecture processing → Shared SQLite: tracks pack state (evidence: `internal/bbb/worker_lecture.go`)
- Bot service → Shared SQLite: shares data (evidence: `README.md`)
- Schedule service → Shared SQLite: shares data (evidence: `README.md`)
- BBB service → Shared SQLite: shares data (evidence: `README.md`)
- Service runtime → Shared SQLite: opens store (evidence: `internal/app/run.go`)
- Shared SQLite → Domain model: stores domain records (evidence: `internal/store/store.go`)
