# gdonaj/scc architecture

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

- Interactive diagram: https://gitdiagram.com/gdonaj/scc
- Repository: https://github.com/gdonaj/scc

## Overview

SCC is a Flask-based speech-corpus collection portal. Contributors register and submit recordings with recording and speaker metadata; editors review and curate corpus records; transcribers download audio and upload transcript versions; administrators manage records and users. The application factory wires the web blueprints to SQLAlchemy models and login handling. The excerpts confirm account, transcription, and administrative behavior, but omit much of the upload and editing route logic, so uncertain internal links are not shown.

Main entry points: [`website/__init__.py`](https://github.com/gdonaj/scc/blob/main/website/__init__.py) (Flask app factory), [`website/dbModels.py`](https://github.com/gdonaj/scc/blob/main/website/dbModels.py) (Corpus models), [`website/viewAccount.py`](https://github.com/gdonaj/scc/blob/main/website/viewAccount.py) (Account routes), [`website/viewAdmin.py`](https://github.com/gdonaj/scc/blob/main/website/viewAdmin.py) (Admin routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_main["Application entry<br/>[main.py]"]
  node_app["Flask app factory<br/>[__init__.py]"]
  node_templates["Web pages"]
end

subgraph group_accounts["Accounts and access"]
  node_account["Account routes<br/>[viewAccount.py]"]
end

subgraph group_corpus["Corpus workflow"]
  node_user["Contributor routes<br/>[viewUser.py]"]
  node_admin["Admin routes<br/>[viewAdmin.py]"]
  node_transcriber["Transcription routes<br/>[viewTranscriber.py]"]
end

subgraph group_persistence["Persistence and utilities"]
  node_models["Corpus models<br/>[dbModels.py]"]
  node_db[("SQL database<br/>[dbModels.py]")]
  node_format["Record formatting<br/>[utilFormat.py]"]
  node_utilities["Shared utilities<br/>[util.py]"]
end

node_visitor(("Portal user"))
node_smtp["SMTP mail service"]

node_visitor -->|"uses portal"| node_templates
node_main -->|"creates app"| node_app
node_app -->|"registers blueprint"| node_account
node_app -->|"registers blueprint"| node_user
node_app -->|"registers blueprint"| node_admin
node_app -->|"registers blueprint"| node_transcriber
node_app -->|"initializes"| node_db
node_account -->|"reads and writes"| node_models
node_user -->|"reads and writes"| node_models
node_admin -->|"reads and writes"| node_models
node_transcriber -->|"reads and writes"| node_models
node_admin -->|"formats records"| node_format
node_format -->|"reads records"| node_models
node_utilities -->|"updates totals"| node_models
node_utilities -.->|"sends mail"| node_smtp
node_account -->|"renders pages"| node_templates
node_transcriber -->|"renders page"| node_templates

click node_main "https://github.com/gdonaj/scc/blob/main/main.py"
click node_app "https://github.com/gdonaj/scc/blob/main/website/__init__.py"
click node_templates "https://github.com/gdonaj/scc/tree/main/website/templates"
click node_account "https://github.com/gdonaj/scc/blob/main/website/viewAccount.py"
click node_user "https://github.com/gdonaj/scc/blob/main/website/viewUser.py"
click node_admin "https://github.com/gdonaj/scc/blob/main/website/viewAdmin.py"
click node_transcriber "https://github.com/gdonaj/scc/blob/main/website/viewTranscriber.py"
click node_models "https://github.com/gdonaj/scc/blob/main/website/dbModels.py"
click node_db "https://github.com/gdonaj/scc/blob/main/website/dbModels.py"
click node_format "https://github.com/gdonaj/scc/blob/main/website/utilFormat.py"
click node_utilities "https://github.com/gdonaj/scc/blob/main/website/util.py"

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_main,node_app,node_templates,node_visitor toneBlue
class node_account toneAmber
class node_user,node_admin,node_transcriber toneMint
class node_models,node_db,node_format,node_utilities toneRose
class node_smtp toneIndigo
```

## Components

### Web application

- [Application entry](https://github.com/gdonaj/scc/blob/main/main.py): `main.py`
- [Flask app factory](https://github.com/gdonaj/scc/blob/main/website/__init__.py): `website/__init__.py`
- [Web pages](https://github.com/gdonaj/scc/tree/main/website/templates): `website/templates`

### Accounts and access

- [Account routes](https://github.com/gdonaj/scc/blob/main/website/viewAccount.py): `website/viewAccount.py`

### Corpus workflow

- [Contributor routes](https://github.com/gdonaj/scc/blob/main/website/viewUser.py): `website/viewUser.py`
- [Admin routes](https://github.com/gdonaj/scc/blob/main/website/viewAdmin.py): `website/viewAdmin.py`
- [Transcription routes](https://github.com/gdonaj/scc/blob/main/website/viewTranscriber.py): `website/viewTranscriber.py`

### Persistence and utilities

- [Corpus models](https://github.com/gdonaj/scc/blob/main/website/dbModels.py): `website/dbModels.py`
- [SQL database](https://github.com/gdonaj/scc/blob/main/website/dbModels.py): `website/dbModels.py`
- [Record formatting](https://github.com/gdonaj/scc/blob/main/website/utilFormat.py): `website/utilFormat.py`
- [Shared utilities](https://github.com/gdonaj/scc/blob/main/website/util.py): `website/util.py`

### Other components

- **Portal user**
- **SMTP mail service**

## Connections

- Portal user → Web pages: uses portal
- Application entry → Flask app factory: creates app
- Flask app factory → Account routes: registers blueprint
- Flask app factory → Contributor routes: registers blueprint
- Flask app factory → Admin routes: registers blueprint
- Flask app factory → Transcription routes: registers blueprint
- Flask app factory → SQL database: initializes
- Account routes → Corpus models: reads and writes
- Contributor routes → Corpus models: reads and writes
- Admin routes → Corpus models: reads and writes
- Transcription routes → Corpus models: reads and writes
- Admin routes → Record formatting: formats records
- Record formatting → Corpus models: reads records
- Shared utilities → Corpus models: updates totals
- Shared utilities → SMTP mail service: sends mail
- Account routes → Web pages: renders pages
- Transcription routes → Web pages: renders page
