# evansean/roomvision-ai architecture

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

- Interactive diagram: https://gitdiagram.com/evansean/roomvision-ai
- Repository: https://github.com/evansean/roomvision-ai

## Overview

##### Project Type and Purpose
- RoomVision-AI is a lightweight, single-page web application built with Streamlit. Its purpose is to serve as a “virtual interior designer,” accepting user inputs (e.g., room photos, style preferences) and generating AI-powered design suggestions or images via an external AI API.

##### File Structure Analysis
- Top-level files:
- app.py        → The main Streamlit application script (UI + control flow)
- prompts.py    → Encapsulates prompt templates and logic for interacting with the AI service
- requirements.txt → Python dependencies (Streamlit, OpenAI or similar SDKs)
- .devcontainer/... → Development container settings (for reproducible dev environment)
- .streamlit/config.toml → Streamlit runtime configuration
- venv           → Local Python virtual environment (isolated runtime)
- No separate “backend” or “database” directories: all business logic and UI code live together in a single monolithic Python app.

##### README Insights
- The README is minimal but clearly brands the tool as “Your Virtual Interior Designer,” implying a workflow of user → AI service → visual/design output.

a. Main Components
- User (browser)
- Streamlit Web App (app.py)
- Prompt Manager (prompts.py)
- External AI Service (e.g., OpenAI’s image/text-generation API)
- Local Development Container (for dev environment)
b. Relationships & Interactions
1. User interacts with the Streamlit UI in their browser.
2. Streamlit app.py captures inputs and invokes functions in prompts.py to build API calls.
3. prompts.py sends requests to the external AI service over HTTPS.
4. AI service returns generated images/text.
5. app.py renders results back to the user’s browser.
6. (Optional) Devcontainer/Docker facilitates reproducible local testing.
c. Architectural Patterns & Principles
- Monolithic, single-process service
- Clear separation of concerns: UI logic in app.py vs. prompt construction in prompts.py
- Dependency isolation via virtual environment (.venv) and devcontainer
d. Key Technologies
- Streamlit (UI framework)
- Python (app logic)
- OpenAI or alternative AI-generation API
- Docker/DevContainer (development environment)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External User
    User["User (Browser)"]:::external

    %% Development Environment
    subgraph "Local Development Environment"
        direction TB
        DevContainer["DevContainer Settings"]:::infra
        DevConfig["devcontainer.json"]:::infra
        Venv["venv/ (Virtual Env)"]:::infra
    end

    %% Streamlit Application Monolith
    subgraph "Streamlit App"
        direction TB
        App["app.py (UI & Control Flow)"]:::inApp
        Prompt["prompts.py (AI Prompt Construction)"]:::inApp
        Config["config.toml (.streamlit)"]:::inApp
        Requirements["requirements.txt"]:::inApp
        Readme["README.md (Branding)"]:::inApp
    end

    %% External AI Service
    AI["External AI Service"]:::external

    %% Connections
    User -->|"Interacts via HTTP"| App
    App -->|"calls build_prompt()"| Prompt
    Prompt -->|"HTTP POST: generate_image_request"| AI
    AI -->|"Returns generated design"| Prompt
    Prompt -->|"Delivers payload"| App
    App -->|"Renders results"| User
    DevContainer -->|hosts| App
    Venv -->|provides runtime| App

    %% Click Events
    click App "https://github.com/evansean/roomvision-ai/blob/main/app.py"
    click Prompt "https://github.com/evansean/roomvision-ai/blob/main/prompts.py"
    click Config "https://github.com/evansean/roomvision-ai/blob/main/.streamlit/config.toml"
    click DevContainer "https://github.com/evansean/roomvision-ai/tree/main/.devcontainer/"
    click DevConfig "https://github.com/evansean/roomvision-ai/blob/main/.devcontainer/devcontainer.json"
    click Requirements "https://github.com/evansean/roomvision-ai/blob/main/requirements.txt"
    click Venv "https://github.com/evansean/roomvision-ai/tree/main/venv/"
    click Readme "https://github.com/evansean/roomvision-ai/blob/main/README.md"

    %% Styles
    classDef inApp fill:#cce5ff,stroke:#3399ff,color:#000;
    classDef external fill:#d4edda,stroke:#28a745,color:#000;
    classDef infra fill:#e2e3e5,stroke:#6c757d,color:#000;
```
