# tamanna456760-it/tamanna- architecture

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

- Interactive diagram: https://gitdiagram.com/tamanna456760-it/tamanna-
- Repository: https://github.com/tamanna456760-it/tamanna-

## Overview

1. This repository is a multi-project automation platform, not a single app. The dominant architectural theme is an AI-driven control plane that scans code, fixes issues, syncs repositories, monitors health, and triggers builds/deploys across many language stacks.

2. The repo-level automation layer is centered on the root runner scripts and the behavior described in the README. The main responsibilities are split into scan/detect, auto-fix, and system-monitor roles, with supporting entry points like `run.py`, `monitor.py`, `lint_monitor.py`, `auto_fix_issues.py`, and many `tamanna_*` shell/Python scripts.

3. GitHub Actions is a major orchestration boundary. `.github/workflows` contains many pipelines for auto-sync, auto-heal, lint/fix, security checks, build/deploy, APK builds, and AI-run workflows, while `.github/scripts` holds custom policy/decision utilities that shape those jobs.

4. The AI/runtime core is spread across several Python- and JavaScript-heavy subtrees such as `ai/`, `Tamanna-AI-System/`, `ai system/`, and large parts of `bd-king-r7/IT/`. These modules implement scanner, decision, learning, backup, code-generation, monitoring, and sync behaviors, usually with file-backed state rather than a centralized database.

5. A second important subsystem is repository and environment synchronization. This includes `git_sync`, backup managers, auto-sync scripts, device sync folders, timers/services, and orchestrator code under `bd-king-r7/IT/.../powerhub` and related sync folders. The data flow here is typically “local changes → sync/backup/orchestrate → remote repo or device target.”

6. The web/API layer is split into multiple independently deployable services. Examples include `website/` (Node backend, React frontend, .NET Razor app, Nginx, Docker), `server/` (Node backend with auth/chat routes and static pages), `tamanna-server/`, `AI_CHAT/chat_server.py`, and `artifacts/api-server` with its OpenAPI spec and DB schema.

7. There is also a mobile/client tier. `tamanna-ai-app/`, `bd-king-r7/IT/tamannna-android/`, and `device/` contain Android/Kotlin/Java clients, WebView bridges, and local control panels, suggesting a remote-control or companion-app architecture that talks to the backend and sync/AI services.

8. Security and defense are first-class concerns, not an afterthought. Subsystems like `face-detector/`, `deep_packet_inspection.py`, `bd-king-r7/IT/potocol/`, `security_*` modules, and `cybersecurity` scripts provide scanning, auth, threat detection, rate limiting, logging, and blocking/response logic.

9. The repository uses many runtimes and infrastructure tools side by side: Python, Node.js/TypeScript, Bash, Kotlin/Java Android, .NET 8, and some PHP. Deployment and execution are mediated by Docker, Nginx, systemd services/timers, GitHub Actions, and in a few places Cloudflare Workers-style DNS/edge configuration.

10. State is mostly file-based and configuration-driven. Important stores include JSON/YAML config files, log files, SQLite databases like `reports.db`, schema files under `artifacts/lib/db`, and numerous project-specific memory/backup files; this means the architecture is closer to “many cooperating services with local persistence” than to a single centralized database app.

11. For an architecture diagram, the clearest top-level view is: a central AI automation/control plane at the repo root, GitHub Actions as the orchestration bus, and several satellite product stacks beneath it—web, mobile, API, security, sync/backup, and CV/auth—connected mostly through files, scripts, and CI jobs rather than a single shared service boundary.

Main entry points: [`ai_brain_core.py`](https://github.com/tamanna456760-it/tamanna-/blob/main/ai_brain_core.py) (AI brain), [`run.py`](https://github.com/tamanna456760-it/tamanna-/blob/main/run.py) (Run), [`Tamanna-AI-System/tamanna_ai_system.py`](https://github.com/tamanna456760-it/tamanna-/blob/main/Tamanna-AI-System/tamanna_ai_system.py) (AI system), [`bd-king-r7/IT/bd-king-r7/powerhub/bd-king-r7 powerhub/orchestrator/app.py`](https://github.com/tamanna456760-it/tamanna-/blob/HEAD/bd-king-r7/IT/bd-king-r7/powerhub/bd-king-r7%20powerhub/orchestrator/app.py) (Orchestrator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_root["Repo control"]
  node_run_py["Run<br/>[run.py]"]
  node_monitor_py["Monitor<br/>[monitor.py]"]
  node_fix_issues["Auto fix<br/>repair driver<br/>[auto_fix_issues.py]"]
  node_lint_monitor["Lint watch<br/>[lint_monitor.py]"]
end

subgraph group_ci["CI orchestration"]
  node_github_wf["Actions<br/>ci workflows<br/>[auto-sync.yml]"]
  node_github_scripts["Policy scripts<br/>ci helpers<br/>[auto_code_fixer.py]"]
end

subgraph group_ai["AI core"]
  node_ai_core["AI brain<br/>ai orchestrator<br/>[ai_brain_core.py]"]
  node_ai_scan["Scanner<br/>analysis engine"]
  node_ai_defense["Defense<br/>policy engine<br/>[ai_defense_core.py]"]
  node_ai_monitor["System watch<br/>telemetry monitor"]
  node_ai_powerhub["Power hub<br/>ai sync core"]
end

subgraph group_sync["Sync plane"]
  node_tamanna_sys["AI system<br/>python system"]
  node_git_sync["Git sync<br/>sync engine<br/>[git_sync.py]"]
  node_backup_mgr["Backup<br/>[backup_manager.py]"]
  node_powerhub_orch["Orchestrator<br/>multi-runtime hub<br/>[app.py]"]
end

subgraph group_services["Services"]
  node_api_srv["API server<br/>typed service<br/>[app.ts]"]
  node_web_backend["Web backend<br/>node service<br/>[server.js]"]
  node_web_portal["Web portal<br/>dotnet app<br/>[Program.cs]"]
end

subgraph group_clients["Clients"]
  node_mobile_app["Mobile app<br/>android client<br/>[MainActivity.kt]"]
  node_device_panel["Device panel<br/>device client<br/>[MainActivity.kt]"]
  node_android_ctl["Android hub<br/>android client<br/>[mainactivity.java]"]
end

subgraph group_sec["Security"]
  node_face_lock["Face lock<br/>cv auth<br/>[app.py]"]
  node_dpi["Packet inspect<br/>network defense"]
  node_potocol_def["Defender<br/>security protocol<br/>[main.py]"]
  node_cybersec["Cybersecurity<br/>security suite<br/>[cybersecurity.py]"]
end

subgraph group_state["State"]
  node_memory["Memory<br/>file state<br/>[brain_memory.json]"]
  node_configs["Configs<br/>config store<br/>[config.json]"]
  node_db_schema["DB schema<br/>schema store<br/>[index.ts]"]
  node_logs["Logs"]
end

node_run_py -->|"drives"| node_ai_core
node_run_py -->|"starts"| node_monitor_py
node_run_py -->|"repairs"| node_fix_issues
node_monitor_py -->|"checks"| node_lint_monitor
node_fix_issues -->|"uses"| node_github_scripts
node_github_wf -->|"orchestrates"| node_github_scripts
node_github_wf -->|"triggers"| node_ai_core
node_github_scripts -->|"scores"| node_ai_scan
node_ai_core -->|"scans"| node_ai_scan
node_ai_core -->|"defends"| node_ai_defense
node_ai_core -->|"watches"| node_ai_monitor
node_ai_core -->|"coordinates"| node_ai_powerhub
node_ai_core -->|"persists"| node_memory
node_tamanna_sys -->|"syncs"| node_git_sync
node_tamanna_sys -->|"backs up"| node_backup_mgr
node_git_sync -->|"reads"| node_configs
node_backup_mgr -->|"records"| node_logs
node_powerhub_orch -->|"orchestrates"| node_git_sync
node_powerhub_orch -->|"stores"| node_db_schema
node_api_srv -->|"reads/writes"| node_db_schema
node_web_backend -->|"calls"| node_api_srv
node_web_portal -->|"queries"| node_db_schema
node_mobile_app -->|"uses"| node_web_backend
node_device_panel -->|"controls"| node_tamanna_sys
node_android_ctl -.->|"monitors"| node_powerhub_orch
node_face_lock -->|"auths"| node_web_backend
node_dpi -->|"feeds"| node_potocol_def
node_cybersec -->|"hardens"| node_potocol_def
node_ai_defense -->|"analyzes"| node_dpi
node_ai_monitor -->|"emits"| node_logs

click node_run_py "https://github.com/tamanna456760-it/tamanna-/blob/main/run.py"
click node_monitor_py "https://github.com/tamanna456760-it/tamanna-/blob/main/monitor.py"
click node_fix_issues "https://github.com/tamanna456760-it/tamanna-/blob/main/auto_fix_issues.py"
click node_lint_monitor "https://github.com/tamanna456760-it/tamanna-/blob/main/lint_monitor.py"
click node_github_wf "https://github.com/tamanna456760-it/tamanna-/blob/main/.github/workflows/auto-sync.yml"
click node_github_scripts "https://github.com/tamanna456760-it/tamanna-/blob/main/.github/scripts/auto_code_fixer.py"
click node_ai_core "https://github.com/tamanna456760-it/tamanna-/blob/main/ai_brain_core.py"
click node_ai_scan "https://github.com/tamanna456760-it/tamanna-/blob/main/ai_code_integrity_monitor.py"
click node_ai_defense "https://github.com/tamanna456760-it/tamanna-/blob/main/ai_defense_core.py"
click node_ai_monitor "https://github.com/tamanna456760-it/tamanna-/blob/main/ai_system_monitor.py"
click node_ai_powerhub "https://github.com/tamanna456760-it/tamanna-/blob/main/ai_powerhub_core.py"
click node_tamanna_sys "https://github.com/tamanna456760-it/tamanna-/blob/main/Tamanna-AI-System/tamanna_ai_system.py"
click node_git_sync "https://github.com/tamanna456760-it/tamanna-/blob/main/Tamanna-AI-System/git_sync.py"
click node_backup_mgr "https://github.com/tamanna456760-it/tamanna-/blob/main/Tamanna-AI-System/backup_manager.py"
click node_powerhub_orch "https://github.com/tamanna456760-it/tamanna-/blob/main/bd-king-r7/IT/bd-king-r7/powerhub/bd-king-r7 powerhub/orchestrator/app.py"
click node_api_srv "https://github.com/tamanna456760-it/tamanna-/blob/main/artifacts/api-server/src/app.ts"
click node_web_backend "https://github.com/tamanna456760-it/tamanna-/blob/main/bd-king-r7/website/backend/server.js"
click node_web_portal "https://github.com/tamanna456760-it/tamanna-/blob/main/bd-king-r7/website/bd-king-website/Program.cs"
click node_mobile_app "https://github.com/tamanna456760-it/tamanna-/blob/main/tamanna-ai-app/app/src/main/java/com/tamanna/MainActivity.kt"
click node_device_panel "https://github.com/tamanna456760-it/tamanna-/blob/main/device/MainActivity.kt"
click node_android_ctl "https://github.com/tamanna456760-it/tamanna-/blob/main/bd-king-r7/IT/tamannna-android/app/src/java/com/tamanna/app/mainactivity.java"
click node_face_lock "https://github.com/tamanna456760-it/tamanna-/blob/main/face-detector/app.py"
click node_dpi "https://github.com/tamanna456760-it/tamanna-/blob/main/deep_packet_inspection.py"
click node_potocol_def "https://github.com/tamanna456760-it/tamanna-/blob/main/bd-king-r7/IT/potocol/server defanding potocol/main.py"
click node_cybersec "https://github.com/tamanna456760-it/tamanna-/blob/main/bd-king-r7/IT/Cybersecurity/cybersecurity.py"
click node_memory "https://github.com/tamanna456760-it/tamanna-/blob/main/brain_memory.json"
click node_configs "https://github.com/tamanna456760-it/tamanna-/blob/main/Tamanna-AI-System/config/config.json"
click node_db_schema "https://github.com/tamanna456760-it/tamanna-/blob/main/artifacts/lib/db/src/schema/index.ts"
click node_logs "https://github.com/tamanna456760-it/tamanna-/blob/main/ROOT/logs/tamanna_pro_cli.log"

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_run_py,node_monitor_py,node_fix_issues,node_lint_monitor,node_face_lock,node_dpi,node_potocol_def,node_cybersec toneBlue
class node_github_wf,node_github_scripts,node_memory,node_configs,node_db_schema,node_logs toneAmber
class node_ai_core,node_ai_scan,node_ai_defense,node_ai_monitor,node_ai_powerhub toneMint
class node_tamanna_sys,node_git_sync,node_backup_mgr,node_powerhub_orch toneRose
class node_api_srv,node_web_backend,node_web_portal toneIndigo
class node_mobile_app,node_device_panel,node_android_ctl toneTeal
```

## Components

### Repo control

Root-level automation entry points and runner scripts.

- [Run](https://github.com/tamanna456760-it/tamanna-/blob/main/run.py): root runner · Primary Python entry point for repo automation. · `run.py`
- [Monitor](https://github.com/tamanna456760-it/tamanna-/blob/main/monitor.py): root monitor · Top-level monitoring and health loop. · `monitor.py`
- [Auto fix](https://github.com/tamanna456760-it/tamanna-/blob/main/auto_fix_issues.py): repair driver · Root issue-fixing automation entry point. · `auto_fix_issues.py`
- [Lint watch](https://github.com/tamanna456760-it/tamanna-/blob/main/lint_monitor.py): lint watcher · Detects and tracks lint or quality problems. · `lint_monitor.py`

### CI orchestration

GitHub Actions workflows and policy scripts.

- [Actions](https://github.com/tamanna456760-it/tamanna-/blob/main/.github/workflows/auto-sync.yml): ci workflows · Main GitHub Actions orchestration surface. · `.github/workflows/auto-sync.yml`
- [Policy scripts](https://github.com/tamanna456760-it/tamanna-/blob/main/.github/scripts/auto_code_fixer.py): ci helpers · Workflow decision and fixer utilities. · `.github/scripts/auto_code_fixer.py`

### AI core

Scanner, decision, learning, monitor, and generation logic.

- [AI brain](https://github.com/tamanna456760-it/tamanna-/blob/main/ai_brain_core.py): ai orchestrator · Central AI control and coordination logic. · `ai_brain_core.py`
- [Scanner](https://github.com/tamanna456760-it/tamanna-/blob/main/ai_code_integrity_monitor.py): analysis engine · Code and issue scanning layer. · `ai_code_integrity_monitor.py`
- [Defense](https://github.com/tamanna456760-it/tamanna-/blob/main/ai_defense_core.py): policy engine · AI defense and response logic. · `ai_defense_core.py`
- [System watch](https://github.com/tamanna456760-it/tamanna-/blob/main/ai_system_monitor.py): telemetry monitor · Repo and system health observation. · `ai_system_monitor.py`
- [Power hub](https://github.com/tamanna456760-it/tamanna-/blob/main/ai_powerhub_core.py): ai sync core · Coordination layer for AI-driven repo operations. · `ai_powerhub_core.py`

### Sync plane

Repository sync, backup, and device/repo propagation.

- [AI system](https://github.com/tamanna456760-it/tamanna-/blob/main/Tamanna-AI-System/tamanna_ai_system.py): python system · File-backed AI runtime and sync utilities. · `Tamanna-AI-System/tamanna_ai_system.py`
- [Git sync](https://github.com/tamanna456760-it/tamanna-/blob/main/Tamanna-AI-System/git_sync.py): sync engine · Repository clone/update and sync operations. · `Tamanna-AI-System/git_sync.py`
- [Backup](https://github.com/tamanna456760-it/tamanna-/blob/main/Tamanna-AI-System/backup_manager.py): state backup · Backup and restore manager for local state. · `Tamanna-AI-System/backup_manager.py`
- [Orchestrator](https://github.com/tamanna456760-it/tamanna-/blob/HEAD/bd-king-r7/IT/bd-king-r7/powerhub/bd-king-r7%20powerhub/orchestrator/app.py): multi-runtime hub · Hybrid PowerHub orchestrator spanning Python and .NET. · `bd-king-r7/IT/bd-king-r7/powerhub/bd-king-r7 powerhub/orchestrator/app.py`

### Services

Web/API backends and deployable service stacks.

- [API server](https://github.com/tamanna456760-it/tamanna-/blob/main/artifacts/api-server/src/app.ts): typed service · OpenAPI-backed API service boundary. · `artifacts/api-server/src/app.ts`
- [Web backend](https://github.com/tamanna456760-it/tamanna-/blob/main/bd-king-r7/website/backend/server.js): node service · Node backend for web-facing interactions. · `bd-king-r7/website/backend/server.js`
- [Web portal](https://github.com/tamanna456760-it/tamanna-/blob/main/bd-king-r7/website/bd-king-website/Program.cs): dotnet app · Razor-based site and project UI. · `bd-king-r7/website/bd-king-website/Program.cs`

### Clients

Mobile, desktop, and device-facing control surfaces.

- [Mobile app](https://github.com/tamanna456760-it/tamanna-/blob/main/tamanna-ai-app/app/src/main/java/com/tamanna/MainActivity.kt): android client · Android client and control shell. · `tamanna-ai-app/app/src/main/java/com/tamanna/MainActivity.kt`
- [Device panel](https://github.com/tamanna456760-it/tamanna-/blob/main/device/MainActivity.kt): device client · Local device control and sync UI. · `device/MainActivity.kt`
- [Android hub](https://github.com/tamanna456760-it/tamanna-/blob/main/bd-king-r7/IT/tamannna-android/app/src/java/com/tamanna/app/mainactivity.java): android client · Secondary Android companion app. · `bd-king-r7/IT/tamannna-android/app/src/java/com/tamanna/app/mainactivity.java`

### Security

Detection, hardening, and defensive control logic.

- [Face lock](https://github.com/tamanna456760-it/tamanna-/blob/main/face-detector/app.py): cv auth · Face-based authentication and detection stack. · `face-detector/app.py`
- [Packet inspect](https://github.com/tamanna456760-it/tamanna-/blob/main/deep_packet_inspection.py): network defense · Deep packet inspection and traffic analysis. · `deep_packet_inspection.py`
- [Defender](https://github.com/tamanna456760-it/tamanna-/blob/HEAD/bd-king-r7/IT/potocol/server%20defanding%20potocol/main.py): security protocol · Server defense and blocking protocol. · `bd-king-r7/IT/potocol/server defanding potocol/main.py`
- [Cybersecurity](https://github.com/tamanna456760-it/tamanna-/blob/main/bd-king-r7/IT/Cybersecurity/cybersecurity.py): security suite · Security auditing and hardening scripts. · `bd-king-r7/IT/Cybersecurity/cybersecurity.py`

### State

File-backed memory, config, schema, and logs.

- [Memory](https://github.com/tamanna456760-it/tamanna-/blob/main/brain_memory.json): file state · Persistent AI memory and learned state. · `brain_memory.json`
- [Configs](https://github.com/tamanna456760-it/tamanna-/blob/main/Tamanna-AI-System/config/config.json): config store · Central configuration and monitoring settings. · `Tamanna-AI-System/config/config.json`
- [DB schema](https://github.com/tamanna456760-it/tamanna-/blob/main/artifacts/lib/db/src/schema/index.ts): schema store · Shared database schema for service data. · `artifacts/lib/db/src/schema/index.ts`
- [Logs](https://github.com/tamanna456760-it/tamanna-/blob/main/ROOT/logs/tamanna_pro_cli.log): runtime logs · Repository-wide operational log files. · `ROOT/logs/tamanna_pro_cli.log`

## Connections

- Run → AI brain: drives · Root runner invokes the central AI control plane.
- Run → Monitor: starts · Runner hands off to monitoring when needed.
- Run → Auto fix: repairs · Root automation can trigger issue-fixing flows.
- Monitor → Lint watch: checks · Monitoring feeds lint/quality surveillance.
- Auto fix → Policy scripts: uses · Root repair logic relies on workflow fixer utilities.
- Actions → Policy scripts: orchestrates · Actions workflows call custom policy and fixer scripts.
- Actions → AI brain: triggers · CI workflows launch AI-run automation jobs.
- Policy scripts → Scanner: scores · Policy scripts evaluate scan results and build risk.
- AI brain → Scanner: scans · Core AI delegates code analysis and detection.
- AI brain → Defense: defends · Core AI routes threats to defense logic.
- AI brain → System watch: watches · Core AI keeps runtime health under observation.
- AI brain → Power hub: coordinates · PowerHub is the execution layer for AI actions.
- AI brain → Memory: persists · AI state is stored in file-backed memory.
- AI system → Git sync: syncs · AI system updates repositories through sync tooling.
- AI system → Backup: backs up · Local state is preserved through backup flows.
- Git sync → Configs: reads · Sync behavior is configuration-driven.
- Backup → Logs: records · Backup and restore operations write operational logs.
- Orchestrator → Git sync: orchestrates · PowerHub orchestrator coordinates repo sync operations.
- Orchestrator → DB schema: stores · Orchestrator has local structured persistence.
- API server → DB schema: reads/writes · API service uses shared database schema.
- Web backend → API server: calls · Web backend fronts API-style interactions.
- Web portal → DB schema: queries · Portal data is shaped by stored project records.
- Mobile app → Web backend: uses · Android app talks to backend services.
- Device panel → AI system: controls · Device UI acts as a local control surface for the AI system.
- Android hub → Orchestrator: monitors · Companion Android layer hooks into orchestration.
- Face lock → Web backend: auths · Face auth can gate web-facing access.
- Packet inspect → Defender: feeds · Packet inspection informs defensive protocol logic.
- Cybersecurity → Defender: hardens · Cybersecurity scripts backstop protocol defenses.
- Defense → Packet inspect: analyzes · AI defense consumes network inspection signals.
- System watch → Logs: emits · Monitoring writes operational traces.
