# vinogradtanya/artificial_intelligence_prototype architecture

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

- Interactive diagram: https://gitdiagram.com/vinogradtanya/artificial_intelligence_prototype
- Repository: https://github.com/vinogradtanya/artificial_intelligence_prototype

## Overview

AI Content Studio is a Flask prototype for authenticated text, image, and audio generation. Users register or sign in, submit a moderated project, receive generated content, and have successful results and token transactions recorded for later library, history, and export views. Separate branches cover account and tariff management, administration, and the offline/LLM assistant. The excerpts show the main route-to-model and generation calls; optional external engines are documented, while unsampled details are not expanded.

Main entry points: [`app/__init__.py`](https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/__init__.py) (Flask app), [`app/models.py`](https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/models.py) (Business data access), [`app/projects.py`](https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/projects.py) (Project and library), [`app/templates`](https://github.com/vinogradtanya/artificial_intelligence_prototype/tree/main/app/templates) (Web templates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web workflows"]
  node_app["Flask app<br/>[__init__.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_account["Account and billing<br/>[main.py]"]
  node_reports["History and export<br/>[reports.py]"]
  node_templates["Web templates"]
end

subgraph group_generation["Content generation"]
  node_projects["Project and library<br/>[projects.py]"]
  node_moderation["Prompt moderation<br/>[moderation.py]"]
  node_generator["Content engines<br/>[generator.py]"]
  node_media["Generated media"]
end

subgraph group_data["Data and access"]
  node_security["Session and roles<br/>[security.py]"]
  node_models["Business data access<br/>[models.py]"]
  node_db["SQLite access<br/>[db.py]"]
  node_database[("SQLite database<br/>[schema.sql]")]
  node_config["Runtime configuration<br/>[config.py]"]
end

subgraph group_support["Administration and help"]
  node_admin["Admin console<br/>[admin.py]"]
  node_assistant["Assistant<br/>[assistant.py]"]
end

node_user(("User"))
node_pollinations{{"Pollinations image API"}}
node_tts{{"Windows speech"}}
node_llm{{"LLM API"}}

node_user -->|"uses"| node_app
node_app -->|"registers"| node_auth
node_app -->|"registers"| node_account
node_app -->|"registers"| node_projects
node_app -->|"registers"| node_reports
node_app -->|"registers"| node_admin
node_app -->|"registers"| node_assistant
node_app -->|"initializes"| node_security
node_auth -->|"reads and creates users"| node_models
node_security -->|"loads user"| node_models
node_account -->|"updates account and balance"| node_models
node_projects -->|"checks prompt"| node_moderation
node_projects -->|"generates content"| node_generator
node_projects -->|"records result and charge"| node_models
node_projects -.->|"stores generated files"| node_media
node_projects -->|"renders views"| node_templates
node_account -->|"renders views"| node_templates
node_auth -->|"renders login forms"| node_templates
node_reports -->|"queries records"| node_models
node_reports -->|"renders reports"| node_templates
node_admin -->|"manages users and audit"| node_models
node_admin -->|"renders console"| node_templates
node_assistant -->|"writes audit"| node_models
node_assistant -->|"renders assistant"| node_templates
node_assistant -.->|"requests responses"| node_llm
node_generator -.->|"requests images"| node_pollinations
node_generator -.->|"synthesizes speech"| node_tts
node_models -->|"uses connection"| node_db
node_db -->|"executes SQL"| node_database

click node_app "https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/__init__.py"
click node_auth "https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/auth.py"
click node_account "https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/main.py"
click node_projects "https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/projects.py"
click node_moderation "https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/moderation.py"
click node_generator "https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/generator.py"
click node_media "https://github.com/vinogradtanya/artificial_intelligence_prototype/tree/main/storage/media"
click node_reports "https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/reports.py"
click node_templates "https://github.com/vinogradtanya/artificial_intelligence_prototype/tree/main/app/templates"
click node_security "https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/security.py"
click node_models "https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/models.py"
click node_db "https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/db.py"
click node_database "https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/schema.sql"
click node_config "https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/config.py"
click node_admin "https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/admin.py"
click node_assistant "https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/assistant.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_app,node_auth,node_account,node_reports,node_templates,node_user toneBlue
class node_projects,node_moderation,node_generator,node_media toneAmber
class node_security,node_models,node_db,node_database,node_config,node_pollinations,node_llm toneMint
class node_admin,node_assistant toneRose
class node_tts toneIndigo
```

## Components

### Web workflows

- [Flask app](https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/__init__.py): `app/__init__.py`
- [Authentication](https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/auth.py): `app/auth.py`
- [Account and billing](https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/main.py): `app/main.py`
- [History and export](https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/reports.py): `app/reports.py`
- [Web templates](https://github.com/vinogradtanya/artificial_intelligence_prototype/tree/main/app/templates): `app/templates`

### Content generation

- [Project and library](https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/projects.py): `app/projects.py`
- [Prompt moderation](https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/moderation.py): `app/moderation.py`
- [Content engines](https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/generator.py): `app/generator.py`
- [Generated media](https://github.com/vinogradtanya/artificial_intelligence_prototype/tree/main/storage/media): `storage/media`

### Data and access

- [Session and roles](https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/security.py): `app/security.py`
- [Business data access](https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/models.py): `app/models.py`
- [SQLite access](https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/db.py): `app/db.py`
- [SQLite database](https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/schema.sql): `schema.sql`
- [Runtime configuration](https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/config.py): `app/config.py`

### Administration and help

- [Admin console](https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/admin.py): `app/admin.py`
- [Assistant](https://github.com/vinogradtanya/artificial_intelligence_prototype/blob/main/app/assistant.py): `app/assistant.py`

### Other components

- **User**
- **Pollinations image API**
- **Windows speech**
- **LLM API**

## Connections

- User → Flask app: uses (evidence: `README.md`)
- Flask app → Authentication: registers (evidence: `app/__init__.py`)
- Flask app → Account and billing: registers (evidence: `app/__init__.py`)
- Flask app → Project and library: registers (evidence: `app/__init__.py`)
- Flask app → History and export: registers (evidence: `app/__init__.py`)
- Flask app → Admin console: registers (evidence: `app/__init__.py`)
- Flask app → Assistant: registers (evidence: `app/__init__.py`)
- Flask app → Session and roles: initializes (evidence: `app/__init__.py`)
- Authentication → Business data access: reads and creates users (evidence: `app/auth.py`)
- Session and roles → Business data access: loads user (evidence: `app/security.py`)
- Account and billing → Business data access: updates account and balance (evidence: `app/main.py`)
- Project and library → Prompt moderation: checks prompt (evidence: `app/projects.py`)
- Project and library → Content engines: generates content (evidence: `app/projects.py`)
- Project and library → Business data access: records result and charge (evidence: `app/projects.py`)
- Project and library → Generated media: stores generated files
- Project and library → Web templates: renders views (evidence: `app/projects.py`)
- Account and billing → Web templates: renders views (evidence: `app/main.py`)
- Authentication → Web templates: renders login forms (evidence: `app/auth.py`)
- History and export → Business data access: queries records (evidence: `app/reports.py`)
- History and export → Web templates: renders reports (evidence: `app/reports.py`)
- Admin console → Business data access: manages users and audit (evidence: `app/admin.py`)
- Admin console → Web templates: renders console (evidence: `app/admin.py`)
- Assistant → Business data access: writes audit (evidence: `app/assistant.py`)
- Assistant → Web templates: renders assistant (evidence: `app/assistant.py`)
- Assistant → LLM API: requests responses (evidence: `app/assistant.py`)
- Content engines → Pollinations image API: requests images (evidence: `README.md`)
- Content engines → Windows speech: synthesizes speech (evidence: `README.md`)
- Business data access → SQLite access: uses connection (evidence: `app/models.py`)
- SQLite access → SQLite database: executes SQL (evidence: `app/db.py`)
