# aditya160803/cloud-chat-v2 architecture

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

- Interactive diagram: https://gitdiagram.com/aditya160803/cloud-chat-v2
- Repository: https://github.com/aditya160803/cloud-chat-v2

## Overview

Cloud-Chat V2 is a Streamlit application for translating plain-English AWS infrastructure requests into reviewed, deployable Terraform plans. Users enter requirements, the application interprets and plans them, generates and checks Terraform, requests approval, then deploys and independently verifies resources; deployment history is stored in SQLite. The graph preserves the documented AI-provider, security, cost, AWS-authentication, and history capabilities. Some subsystem links are based on README workflow statements because their implementation was not sampled; those edges cite the README.

Main entry points: [`app.py`](https://github.com/aditya160803/cloud-chat-v2/blob/main/app.py) (Streamlit entry point), [`database/repository.py`](https://github.com/aditya160803/cloud-chat-v2/blob/main/database/repository.py) (Deployment repository), [`services/infrastructure_planner.py`](https://github.com/aditya160803/cloud-chat-v2/blob/main/services/infrastructure_planner.py) (Infrastructure planner), [`services/deployment_service.py`](https://github.com/aditya160803/cloud-chat-v2/blob/main/services/deployment_service.py) (Deployment service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_app["Streamlit entry point<br/>[app.py]"]
  node_chat["Request chat<br/>[chat_view.py]"]
  node_builder["Infrastructure builder"]
  node_planreview["Plan review"]
  node_deploymentui["Deployment controls"]
  node_history["Deployment history<br/>[history_view.py]"]
  node_resources["Resource verification UI<br/>[resources_view.py]"]
  node_savedplans["Saved plans"]
end

subgraph group_planning["Interpretation and planning"]
  node_parser["AI request parser<br/>[ai_parser.py]"]
  node_planner["Infrastructure planner"]
  node_dependencies["Dependency resolver"]
  node_ami["AMI resolver<br/>[ami_resolver.py]"]
  node_cost["Cost estimator<br/>[cost_estimator.py]"]
end

subgraph group_execution["Deployment and verification"]
  node_terraform["Terraform pipeline"]
  node_security["Security scanner"]
  node_deployment["Deployment service"]
  node_verification["AWS verification"]
end

subgraph group_platform["State and shared services"]
  node_auth["AWS authentication"]
  node_region["Region selection<br/>[region_service.py]"]
  node_repository["Deployment repository<br/>[repository.py]"]
  node_sqlite[("SQLite database<br/>[db.py]")]
  node_models["Domain models<br/>[models.py]"]
  node_config["Application settings<br/>[config.py]"]
  node_exceptions["Domain exceptions<br/>[exceptions.py]"]
end

node_user(("Infrastructure user"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_chat
node_app -->|"routes to"| node_builder
node_app -->|"routes to"| node_planreview
node_app -->|"routes to"| node_deploymentui
node_app -->|"routes to"| node_history
node_app -->|"routes to"| node_resources
node_app -->|"routes to"| node_savedplans
node_chat -->|"calls"| node_parser
node_parser -.->|"informs plan"| node_planner
node_planner -->|"resolves"| node_dependencies
node_planner -->|"resolves"| node_ami
node_planner -->|"estimates"| node_cost
node_planreview -->|"requests plan"| node_terraform
node_planreview -->|"checks record"| node_repository
node_terraform -->|"scans configuration"| node_security
node_deploymentui -->|"starts deployment"| node_deployment
node_deployment -->|"executes Terraform"| node_terraform
node_deployment -->|"verifies resources"| node_verification
node_history -->|"requests verification"| node_verification
node_resources -->|"reads resources"| node_repository
node_verification -->|"records results"| node_repository
node_deployment -->|"authenticates"| node_auth
node_terraform -->|"uses credentials"| node_auth
node_planner -->|"selects region"| node_region
node_parser -->|"uses region"| node_region
node_repository -->|"reads and writes"| node_sqlite
node_repository -->|"maps records"| node_models
node_repository -->|"raises"| node_exceptions
node_sqlite -->|"loads path"| node_config
node_auth -->|"reads settings"| node_config
node_verification -->|"uses identity"| node_auth
node_deployment -->|"updates records"| node_repository
node_terraform -->|"updates plan"| node_repository

click node_app "https://github.com/aditya160803/cloud-chat-v2/blob/main/app.py"
click node_chat "https://github.com/aditya160803/cloud-chat-v2/blob/main/ui/chat_view.py"
click node_builder "https://github.com/aditya160803/cloud-chat-v2/blob/main/ui/infrastructure_builder.py"
click node_planreview "https://github.com/aditya160803/cloud-chat-v2/blob/main/ui/plan_review_view.py"
click node_deploymentui "https://github.com/aditya160803/cloud-chat-v2/blob/main/ui/deployment_progress_view.py"
click node_history "https://github.com/aditya160803/cloud-chat-v2/blob/main/ui/history_view.py"
click node_resources "https://github.com/aditya160803/cloud-chat-v2/blob/main/ui/resources_view.py"
click node_savedplans "https://github.com/aditya160803/cloud-chat-v2/blob/main/ui/saved_plans_view.py"
click node_parser "https://github.com/aditya160803/cloud-chat-v2/blob/main/services/ai_parser.py"
click node_planner "https://github.com/aditya160803/cloud-chat-v2/blob/main/services/infrastructure_planner.py"
click node_dependencies "https://github.com/aditya160803/cloud-chat-v2/blob/main/services/dependency_resolver.py"
click node_ami "https://github.com/aditya160803/cloud-chat-v2/blob/main/services/ami_resolver.py"
click node_cost "https://github.com/aditya160803/cloud-chat-v2/blob/main/services/cost_estimator.py"
click node_terraform "https://github.com/aditya160803/cloud-chat-v2/blob/main/services/terraform_service.py"
click node_security "https://github.com/aditya160803/cloud-chat-v2/blob/main/services/security_scanner.py"
click node_deployment "https://github.com/aditya160803/cloud-chat-v2/blob/main/services/deployment_service.py"
click node_verification "https://github.com/aditya160803/cloud-chat-v2/blob/main/services/aws_verification_service.py"
click node_auth "https://github.com/aditya160803/cloud-chat-v2/blob/main/services/aws_auth_service.py"
click node_region "https://github.com/aditya160803/cloud-chat-v2/blob/main/services/region_service.py"
click node_repository "https://github.com/aditya160803/cloud-chat-v2/blob/main/database/repository.py"
click node_sqlite "https://github.com/aditya160803/cloud-chat-v2/blob/main/database/db.py"
click node_models "https://github.com/aditya160803/cloud-chat-v2/blob/main/core/models.py"
click node_config "https://github.com/aditya160803/cloud-chat-v2/blob/main/config.py"
click node_exceptions "https://github.com/aditya160803/cloud-chat-v2/blob/main/core/exceptions.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_chat,node_builder,node_planreview,node_deploymentui,node_history,node_resources,node_savedplans,node_user toneBlue
class node_parser,node_planner,node_dependencies,node_ami,node_cost toneAmber
class node_terraform,node_security,node_deployment,node_verification toneMint
class node_auth,node_region,node_repository,node_sqlite,node_models,node_config,node_exceptions toneRose
```

## Components

### User experience

- [Streamlit entry point](https://github.com/aditya160803/cloud-chat-v2/blob/main/app.py): `app.py`
- [Request chat](https://github.com/aditya160803/cloud-chat-v2/blob/main/ui/chat_view.py): `ui/chat_view.py`
- [Infrastructure builder](https://github.com/aditya160803/cloud-chat-v2/blob/main/ui/infrastructure_builder.py): `ui/infrastructure_builder.py`
- [Plan review](https://github.com/aditya160803/cloud-chat-v2/blob/main/ui/plan_review_view.py): `ui/plan_review_view.py`
- [Deployment controls](https://github.com/aditya160803/cloud-chat-v2/blob/main/ui/deployment_progress_view.py): `ui/deployment_progress_view.py`
- [Deployment history](https://github.com/aditya160803/cloud-chat-v2/blob/main/ui/history_view.py): `ui/history_view.py`
- [Resource verification UI](https://github.com/aditya160803/cloud-chat-v2/blob/main/ui/resources_view.py): `ui/resources_view.py`
- [Saved plans](https://github.com/aditya160803/cloud-chat-v2/blob/main/ui/saved_plans_view.py): `ui/saved_plans_view.py`

### Interpretation and planning

- [AI request parser](https://github.com/aditya160803/cloud-chat-v2/blob/main/services/ai_parser.py): `services/ai_parser.py`
- [Infrastructure planner](https://github.com/aditya160803/cloud-chat-v2/blob/main/services/infrastructure_planner.py): `services/infrastructure_planner.py`
- [Dependency resolver](https://github.com/aditya160803/cloud-chat-v2/blob/main/services/dependency_resolver.py): `services/dependency_resolver.py`
- [AMI resolver](https://github.com/aditya160803/cloud-chat-v2/blob/main/services/ami_resolver.py): `services/ami_resolver.py`
- [Cost estimator](https://github.com/aditya160803/cloud-chat-v2/blob/main/services/cost_estimator.py): `services/cost_estimator.py`

### Deployment and verification

- [Terraform pipeline](https://github.com/aditya160803/cloud-chat-v2/blob/main/services/terraform_service.py): `services/terraform_service.py`
- [Security scanner](https://github.com/aditya160803/cloud-chat-v2/blob/main/services/security_scanner.py): `services/security_scanner.py`
- [Deployment service](https://github.com/aditya160803/cloud-chat-v2/blob/main/services/deployment_service.py): `services/deployment_service.py`
- [AWS verification](https://github.com/aditya160803/cloud-chat-v2/blob/main/services/aws_verification_service.py): `services/aws_verification_service.py`

### State and shared services

- [AWS authentication](https://github.com/aditya160803/cloud-chat-v2/blob/main/services/aws_auth_service.py): `services/aws_auth_service.py`
- [Region selection](https://github.com/aditya160803/cloud-chat-v2/blob/main/services/region_service.py): `services/region_service.py`
- [Deployment repository](https://github.com/aditya160803/cloud-chat-v2/blob/main/database/repository.py): `database/repository.py`
- [SQLite database](https://github.com/aditya160803/cloud-chat-v2/blob/main/database/db.py): `database/db.py`
- [Domain models](https://github.com/aditya160803/cloud-chat-v2/blob/main/core/models.py): `core/models.py`
- [Application settings](https://github.com/aditya160803/cloud-chat-v2/blob/main/config.py): `config.py`
- [Domain exceptions](https://github.com/aditya160803/cloud-chat-v2/blob/main/core/exceptions.py): `core/exceptions.py`

### Other components

- **Infrastructure user**

## Connections

- Infrastructure user → Streamlit entry point: uses (evidence: `README.md`)
- Streamlit entry point → Request chat: routes to (evidence: `app.py`)
- Streamlit entry point → Infrastructure builder: routes to (evidence: `app.py`)
- Streamlit entry point → Plan review: routes to (evidence: `app.py`)
- Streamlit entry point → Deployment controls: routes to (evidence: `app.py`)
- Streamlit entry point → Deployment history: routes to (evidence: `app.py`)
- Streamlit entry point → Resource verification UI: routes to (evidence: `app.py`)
- Streamlit entry point → Saved plans: routes to (evidence: `app.py`)
- Request chat → AI request parser: calls (evidence: `ui/chat_view.py`)
- AI request parser → Infrastructure planner: informs plan (evidence: `README.md`)
- Infrastructure planner → Dependency resolver: resolves (evidence: `services/infrastructure_planner.py`)
- Infrastructure planner → AMI resolver: resolves (evidence: `services/infrastructure_planner.py`)
- Infrastructure planner → Cost estimator: estimates (evidence: `services/infrastructure_planner.py`)
- Plan review → Terraform pipeline: requests plan (evidence: `ui/plan_review_view.py`)
- Plan review → Deployment repository: checks record (evidence: `ui/plan_review_view.py`)
- Terraform pipeline → Security scanner: scans configuration (evidence: `services/terraform_service.py`)
- Deployment controls → Deployment service: starts deployment (evidence: `ui/deployment_progress_view.py`)
- Deployment service → Terraform pipeline: executes Terraform (evidence: `services/deployment_service.py`)
- Deployment service → AWS verification: verifies resources (evidence: `services/deployment_service.py`)
- Deployment history → AWS verification: requests verification (evidence: `ui/history_view.py`)
- Resource verification UI → Deployment repository: reads resources (evidence: `ui/resources_view.py`)
- AWS verification → Deployment repository: records results (evidence: `services/aws_verification_service.py`)
- Deployment service → AWS authentication: authenticates (evidence: `services/deployment_service.py`)
- Terraform pipeline → AWS authentication: uses credentials (evidence: `services/terraform_service.py`)
- Infrastructure planner → Region selection: selects region (evidence: `services/infrastructure_planner.py`)
- AI request parser → Region selection: uses region (evidence: `services/ai_parser.py`)
- Deployment repository → SQLite database: reads and writes (evidence: `database/repository.py`)
- Deployment repository → Domain models: maps records (evidence: `database/repository.py`)
- Deployment repository → Domain exceptions: raises (evidence: `database/repository.py`)
- SQLite database → Application settings: loads path (evidence: `database/db.py`)
- AWS authentication → Application settings: reads settings (evidence: `services/aws_auth_service.py`)
- AWS verification → AWS authentication: uses identity (evidence: `services/aws_verification_service.py`)
- Deployment service → Deployment repository: updates records (evidence: `services/deployment_service.py`)
- Terraform pipeline → Deployment repository: updates plan (evidence: `services/terraform_service.py`)
