# cjbtd/aioa_server architecture

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

- Interactive diagram: https://gitdiagram.com/cjbtd/aioa_server
- Repository: https://github.com/cjbtd/aioa_server

## Overview

AIOA Server is a Django backend for a configurable business system: administrators define database entities and SQL behavior, then configure menus, modules, and permissions; authenticated users invoke those modules for data operations. The main runtime path runs from routed requests through authentication/configuration and the datacenter table handler into SQL-backed reads and mutations. Separate branches support administration, messaging, and system management. Source excerpts establish the principal calls; README documents the configuration workflow and capabilities, while some subsystem internals are represented only by their exact directories.

Main entry points: [`apps/datacenter/table.py`](https://github.com/cjbtd/aioa_server/blob/main/apps/datacenter/table.py) (Table Operations), [`apps/base/config.py`](https://github.com/cjbtd/aioa_server/blob/main/apps/base/config.py) (System Config), [`aioa/urls.py`](https://github.com/cjbtd/aioa_server/blob/main/aioa/urls.py) (URL Routing), [`apps/base/views.py`](https://github.com/cjbtd/aioa_server/blob/main/apps/base/views.py) (Base API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Request Runtime"]
  node_routes["URL Routing<br/>[urls.py]"]
  node_base_api["Base API<br/>[views.py]"]
  node_system_api["System API<br/>[views.py]"]
  node_sql["SQL Helpers<br/>[sql.py]"]
  node_cache["Cache<br/>[cache.py]"]
  node_settings["Runtime Settings<br/>[settings.py]"]
end

subgraph group_config["Configuration &amp; Access"]
  node_config_service["System Config<br/>[config.py]"]
  node_domain_models["Domain Models<br/>[models.py]"]
  node_access_control["Permissions<br/>[views.py]"]
  node_system_store[("System Data<br/>[models.py]")]
end

subgraph group_data["Dynamic Data Center"]
  node_dc_api["Data API<br/>[views.py]"]
  node_table_ops["Table Operations<br/>[table.py]"]
  node_parser["Config Parser<br/>[parser.py]"]
  node_tools["Data Tools<br/>[tools.py]"]
  node_relations["Data Relations<br/>[relations.py]"]
  node_verification["Data Verification<br/>[verify.py]"]
  node_hooks["Data Hooks<br/>[hooks.py]"]
end

subgraph group_features["User Features"]
  node_chat_api["Chat API<br/>[views.py]"]
  node_mail_models["Mail Records<br/>[models.py]"]
  node_file_service["File Uploads<br/>[views.py]"]
end

node_user(("User"))
node_database[("MySQL Database")]
node_redis[("Redis Cache")]

node_user -->|"sends requests"| node_routes
node_routes -->|"routes to"| node_base_api
node_routes -.->|"routes to"| node_system_api
node_routes -.->|"routes to"| node_chat_api
node_routes -.->|"routes to"| node_dc_api
node_base_api -->|"loads configuration"| node_config_service
node_base_api -->|"serves permissions"| node_access_control
node_base_api -->|"queries"| node_database
node_system_api -->|"reads permissions"| node_domain_models
node_system_api -->|"loads config"| node_config_service
node_system_api -->|"executes SQL"| node_database
node_chat_api -->|"reads and writes"| node_mail_models
node_chat_api -->|"queries"| node_database
node_dc_api -->|"dispatches requests"| node_table_ops
node_dc_api -->|"dispatches tools"| node_tools
node_dc_api -->|"dispatches relations"| node_relations
node_dc_api -->|"loads config"| node_config_service
node_table_ops -->|"parses configuration"| node_parser
node_table_ops -->|"builds SQL"| node_sql
node_table_ops -->|"reads and mutates"| node_database
node_table_ops -.->|"validates data"| node_verification
node_tools -->|"uses table operations"| node_table_ops
node_relations -->|"uses table operations"| node_table_ops
node_config_service -->|"reads configuration"| node_domain_models
node_config_service -->|"caches configurations"| node_cache
node_config_service -->|"loads module data"| node_database
node_access_control -->|"checks access"| node_domain_models
node_cache -->|"uses cache backend"| node_redis
node_settings -->|"configures connection"| node_database
node_settings -->|"configures connection"| node_redis
node_base_api -->|"handles uploads"| node_file_service
node_hooks -.->|"integrates hooks"| node_table_ops
node_hooks -.->|"uses configuration"| node_config_service
node_hooks -.->|"notifies users"| node_chat_api

click node_routes "https://github.com/cjbtd/aioa_server/blob/main/aioa/urls.py"
click node_base_api "https://github.com/cjbtd/aioa_server/blob/main/apps/base/views.py"
click node_system_api "https://github.com/cjbtd/aioa_server/blob/main/apps/system/views.py"
click node_chat_api "https://github.com/cjbtd/aioa_server/blob/main/apps/chat/views.py"
click node_dc_api "https://github.com/cjbtd/aioa_server/blob/main/apps/datacenter/views.py"
click node_table_ops "https://github.com/cjbtd/aioa_server/blob/main/apps/datacenter/table.py"
click node_parser "https://github.com/cjbtd/aioa_server/blob/main/apps/datacenter/parser.py"
click node_tools "https://github.com/cjbtd/aioa_server/blob/main/apps/datacenter/tools.py"
click node_relations "https://github.com/cjbtd/aioa_server/blob/main/apps/datacenter/relations.py"
click node_verification "https://github.com/cjbtd/aioa_server/blob/main/apps/datacenter/verify.py"
click node_hooks "https://github.com/cjbtd/aioa_server/blob/main/apps/datacenter/hooks.py"
click node_config_service "https://github.com/cjbtd/aioa_server/blob/main/apps/base/config.py"
click node_domain_models "https://github.com/cjbtd/aioa_server/blob/main/apps/base/models.py"
click node_access_control "https://github.com/cjbtd/aioa_server/blob/main/apps/base/views.py"
click node_sql "https://github.com/cjbtd/aioa_server/blob/main/aioa/sql.py"
click node_cache "https://github.com/cjbtd/aioa_server/blob/main/aioa/cache.py"
click node_mail_models "https://github.com/cjbtd/aioa_server/blob/main/apps/chat/models.py"
click node_file_service "https://github.com/cjbtd/aioa_server/blob/main/apps/base/views.py"
click node_settings "https://github.com/cjbtd/aioa_server/blob/main/aioa/settings.py"
click node_system_store "https://github.com/cjbtd/aioa_server/blob/main/apps/base/models.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_routes,node_base_api,node_system_api,node_sql,node_cache,node_settings,node_user toneBlue
class node_config_service,node_domain_models,node_access_control,node_system_store,node_database,node_redis toneAmber
class node_dc_api,node_table_ops,node_parser,node_tools,node_relations,node_verification,node_hooks toneMint
class node_chat_api,node_mail_models,node_file_service toneRose
```

## Components

### Request Runtime

- [URL Routing](https://github.com/cjbtd/aioa_server/blob/main/aioa/urls.py): `aioa/urls.py`
- [Base API](https://github.com/cjbtd/aioa_server/blob/main/apps/base/views.py): `apps/base/views.py`
- [System API](https://github.com/cjbtd/aioa_server/blob/main/apps/system/views.py): `apps/system/views.py`
- [SQL Helpers](https://github.com/cjbtd/aioa_server/blob/main/aioa/sql.py): `aioa/sql.py`
- [Cache](https://github.com/cjbtd/aioa_server/blob/main/aioa/cache.py): `aioa/cache.py`
- [Runtime Settings](https://github.com/cjbtd/aioa_server/blob/main/aioa/settings.py): `aioa/settings.py`

### Configuration & Access

- [System Config](https://github.com/cjbtd/aioa_server/blob/main/apps/base/config.py): `apps/base/config.py`
- [Domain Models](https://github.com/cjbtd/aioa_server/blob/main/apps/base/models.py): `apps/base/models.py`
- [Permissions](https://github.com/cjbtd/aioa_server/blob/main/apps/base/views.py): `apps/base/views.py`
- [System Data](https://github.com/cjbtd/aioa_server/blob/main/apps/base/models.py): `apps/base/models.py`

### Dynamic Data Center

- [Data API](https://github.com/cjbtd/aioa_server/blob/main/apps/datacenter/views.py): `apps/datacenter/views.py`
- [Table Operations](https://github.com/cjbtd/aioa_server/blob/main/apps/datacenter/table.py): `apps/datacenter/table.py`
- [Config Parser](https://github.com/cjbtd/aioa_server/blob/main/apps/datacenter/parser.py): `apps/datacenter/parser.py`
- [Data Tools](https://github.com/cjbtd/aioa_server/blob/main/apps/datacenter/tools.py): `apps/datacenter/tools.py`
- [Data Relations](https://github.com/cjbtd/aioa_server/blob/main/apps/datacenter/relations.py): `apps/datacenter/relations.py`
- [Data Verification](https://github.com/cjbtd/aioa_server/blob/main/apps/datacenter/verify.py): `apps/datacenter/verify.py`
- [Data Hooks](https://github.com/cjbtd/aioa_server/blob/main/apps/datacenter/hooks.py): `apps/datacenter/hooks.py`

### User Features

- [Chat API](https://github.com/cjbtd/aioa_server/blob/main/apps/chat/views.py): `apps/chat/views.py`
- [Mail Records](https://github.com/cjbtd/aioa_server/blob/main/apps/chat/models.py): `apps/chat/models.py`
- [File Uploads](https://github.com/cjbtd/aioa_server/blob/main/apps/base/views.py): `apps/base/views.py`

### Other components

- **User**
- **MySQL Database**
- **Redis Cache**

## Connections

- User → URL Routing: sends requests (evidence: `README.md`)
- URL Routing → Base API: routes to (evidence: `aioa/urls.py`)
- URL Routing → System API: routes to
- URL Routing → Chat API: routes to
- URL Routing → Data API: routes to
- Base API → System Config: loads configuration (evidence: `apps/base/views.py`)
- Base API → Permissions: serves permissions (evidence: `apps/base/views.py`)
- Base API → MySQL Database: queries (evidence: `apps/base/views.py`)
- System API → Domain Models: reads permissions (evidence: `apps/system/views.py`)
- System API → System Config: loads config (evidence: `apps/system/views.py`)
- System API → MySQL Database: executes SQL (evidence: `apps/system/views.py`)
- Chat API → Mail Records: reads and writes (evidence: `apps/chat/views.py`)
- Chat API → MySQL Database: queries (evidence: `apps/chat/views.py`)
- Data API → Table Operations: dispatches requests (evidence: `apps/datacenter/views.py`)
- Data API → Data Tools: dispatches tools (evidence: `apps/datacenter/views.py`)
- Data API → Data Relations: dispatches relations (evidence: `apps/datacenter/views.py`)
- Data API → System Config: loads config (evidence: `apps/datacenter/views.py`)
- Table Operations → Config Parser: parses configuration (evidence: `apps/datacenter/table.py`)
- Table Operations → SQL Helpers: builds SQL (evidence: `apps/datacenter/table.py`)
- Table Operations → MySQL Database: reads and mutates (evidence: `apps/datacenter/table.py`)
- Table Operations → Data Verification: validates data (evidence: `apps/datacenter/table.py`)
- Data Tools → Table Operations: uses table operations (evidence: `apps/datacenter/tools.py`)
- Data Relations → Table Operations: uses table operations (evidence: `apps/datacenter/relations.py`)
- System Config → Domain Models: reads configuration (evidence: `apps/base/config.py`)
- System Config → Cache: caches configurations (evidence: `apps/base/config.py`)
- System Config → MySQL Database: loads module data (evidence: `apps/base/config.py`)
- Permissions → Domain Models: checks access (evidence: `apps/base/views.py`)
- Cache → Redis Cache: uses cache backend
- Runtime Settings → MySQL Database: configures connection (evidence: `aioa/settings.py`)
- Runtime Settings → Redis Cache: configures connection (evidence: `aioa/settings.py`)
- Base API → File Uploads: handles uploads (evidence: `apps/base/views.py`)
- Data Hooks → Table Operations: integrates hooks (evidence: `apps/datacenter/hooks.py`)
- Data Hooks → System Config: uses configuration (evidence: `apps/datacenter/hooks.py`)
- Data Hooks → Chat API: notifies users (evidence: `apps/datacenter/hooks.py`)
