An AI-powered code generation tool that creates Python applications and HTML websites with minimal coding knowledge required. Leverages multiple LLM providers to assist in generating, managing, and executing projects through an interactive CLI interface.
The Vibe Coder Agent is designed for users who want to create projects with minimal or no coding experience. It uses artificial intelligence to automatically generate code, manage project environments, and handle dependency installation. The tool supports creating Streamlit applications, FastAPI services, and static HTML websites through conversational AI-driven requirements gathering.
git clone https://github.com/your-username/vibe_coder.git
cd vibe_coder
pip install -r requirements.txt
cp .envcopy .env
Edit the .env
file with your API keys and configuration:
nano .env # or use your preferred editor
Update LLM Client Configuration
The openai_client.py
file handles LLM provider connections. For most providers, you only need to update the .env
file, but for custom setups, you may need to modify this file:
# openai_client.py - Default configuration
from openai import OpenAI
import os
from dotenv import load_dotenv
load_dotenv()
def get_client():
client = OpenAI(
api_key=os.getenv("OPENAI_API_KEY"),
base_url=os.getenv("BASE_URL_OPENAI")
)
return client
For different providers, update the environment variables in .env
accordingly.
Verify Installation
Test your setup by running:
python latest_coding_agent.py
You should see the main menu with three options. If you encounter errors, check the troubleshooting section below.
Hereβs a complete setup example using OpenAI:
# 1. Clone and navigate
git clone https://github.com/your-username/vibe_coder.git
cd vibe_coder
# 2. Install dependencies
pip install -r requirements.txt
# 3. Setup environment
cp .envcopy .env
# 4. Edit .env file (replace with your actual API key)
echo 'OPENAI_API_KEY=sk-proj-your-actual-openai-key-here' > .env
echo 'BASE_URL_OPENAI=https://api.openai.com/v1/' >> .env
echo 'MODEL_NAME=gpt-3.5-turbo' >> .env
# 5. Test the setup
python latest_coding_agent.py
For better dependency management, use a virtual environment:
# Create virtual environment
python -m venv vibe_coder_env
# Activate virtual environment
# On Windows:
vibe_coder_env\Scripts\activate
# On macOS/Linux:
source vibe_coder_env/bin/activate
# Install dependencies
pip install -r requirements.txt
# Continue with setup...
The application uses the following environment variables (defined in .env
). These variables are based on the template provided in .envcopy
:
# OpenAI Configuration
OPENAI_API_KEY=sk-proj-your-api-key-here
BASE_URL_OPENAI=https://api.openai.com/v1/
# DeepSeek Configuration
BASE_URL_DEEPSEEK=https://api.deepseek.com/v1/
# Local LLM Configuration
LOCAL_URL=http://127.0.0.1:1234
LOCAL_API_KEY=your-local-api-key
# Model Configuration
MODEL_NAME=qwen2.5-coder-3b-instruct
Key Environment Variables:
OPENAI_API_KEY
: Your API key for the selected LLM providerBASE_URL_OPENAI
: The base URL for API requests (changes based on provider)MODEL_NAME
: The specific model to use for code generationLOCAL_URL
: Base URL for local LLM servers (Local LLM/Ollama)LOCAL_API_KEY
: API key for local servers (if required)gpt-3.5-turbo
(recommended for cost-effectiveness)gpt-4
(higher quality, more expensive)gpt-4-turbo
(latest GPT-4 variant)gpt-4o
(optimized version).env
: OPENAI_API_KEY=sk-proj-your-actual-key
BASE_URL_OPENAI=https://api.openai.com/v1/
MODEL_NAME=gpt-3.5-turbo
or gpt-4
OPENAI_API_KEY=sk-proj-abc123def456ghi789
BASE_URL_OPENAI=https://api.openai.com/v1/
MODEL_NAME=gpt-3.5-turbo
deepseek-coder
(specialized for code generation)deepseek-chat
(general conversation and coding)deepseek-coder-6.7b-instruct
(specific model variant).env
: OPENAI_API_KEY=your-deepseek-key
BASE_URL_OPENAI=https://api.deepseek.com/v1/
MODEL_NAME=deepseek-coder
or deepseek-chat
OPENAI_API_KEY=sk-deepseek-abc123def456
BASE_URL_OPENAI=https://api.deepseek.com/v1/
MODEL_NAME=deepseek-coder
qwen2.5-coder-3b-instruct
(lightweight, good for coding)codellama-7b-instruct
(Metaβs code-focused model)deepseek-coder-6.7b-instruct
(local version)mistral-7b-instruct
(general purpose).env
: OPENAI_API_KEY=not-needed
(placeholder)BASE_URL_OPENAI=http://127.0.0.1:1234/v1/
MODEL_NAME=your-loaded-model-name
OPENAI_API_KEY=local-placeholder
BASE_URL_OPENAI=http://127.0.0.1:1234/v1/
MODEL_NAME=qwen2.5-coder-3b-instruct
qwen2.5-coder:3b
(lightweight coding model)qwen2.5-coder:7b
(better performance, larger size)codellama:7b
(Metaβs CodeLlama model)deepseek-coder:6.7b
(DeepSeekβs coding model)mistral:7b
(general purpose model)llama3:8b
(Metaβs latest model)ollama serve
ollama pull qwen2.5-coder:3b
ollama list
.env
: OPENAI_API_KEY=ollama
(placeholder)BASE_URL_OPENAI=http://localhost:11434/v1/
MODEL_NAME=qwen2.5-coder:3b
OPENAI_API_KEY=ollama-placeholder
BASE_URL_OPENAI=http://localhost:11434/v1/
MODEL_NAME=qwen2.5-coder:3b
# If Ollama runs on different port
BASE_URL_OPENAI=http://localhost:11434/v1/
# Or for remote Ollama instance
BASE_URL_OPENAI=http://your-server-ip:11434/v1/
deepseek-coder
, qwen2.5-coder
, or codellama
gpt-3.5-turbo
, deepseek-chat
, or mistral
qwen2.5-coder:3b
or mistral:7b
gpt-4
, qwen2.5-coder:7b
, or codellama:13b
Based on the .envcopy
template, here are all available configuration options:
# Primary API Configuration
OPENAI_API_KEY=your-api-key-here # Required for all providers
BASE_URL_OPENAI=provider-base-url # Provider-specific base URL
MODEL_NAME=model-name # Model to use for generation
# Alternative URLs (from .envcopy)
BASE_URL_DEEPSEEK=https://api.deepseek.com/v1/
LOCAL_URL=http://127.0.0.1:1234 # Local LLM server URL
LOCAL_API_KEY=your-local-api-key # Local server API key (if needed)
To switch between providers, simply update these three variables in your .env
file:
# Switch to DeepSeek
OPENAI_API_KEY=your-deepseek-key
BASE_URL_OPENAI=https://api.deepseek.com/v1/
MODEL_NAME=deepseek-coder
# Switch to Local LLM
OPENAI_API_KEY=local-placeholder
BASE_URL_OPENAI=http://127.0.0.1:1234/v1/
MODEL_NAME=qwen2.5-coder-3b-instruct
# Switch to Ollama
OPENAI_API_KEY=ollama-placeholder
BASE_URL_OPENAI=http://localhost:11434/v1/
MODEL_NAME=qwen2.5-coder:3b
Run the application:
python latest_coding_agent.py
The application provides three main options:
================================================================================
Python Application Generator
================================================================================
Options:
1. Create a new Python application
2. Update an existing generated project
3. Create a static HTML website
Enter your choice (1, 2 or 3): 1
What would you like to build today? (Streamlit app or FastAPI service): streamlit app
Project Description: streamlit app
=== Gathering Requirements ===
Any Reference link eg doc:
Question 1: What kind of application do you want to build with Streamlit?
Your response: data visualization dashboard
Question 2: What type of data will you be visualizing?
Your response: sales data with charts and graphs
β
Requirements gathered (2 questions answered)
=== Generating and Running Code ===
Generated 3 files: app.py, requirements.txt, README.md
β
Application started successfully!
π You can access it at: http://localhost:8501
π Project location: /path/to/generated_projects/project_20250107_143022
vibe_coder/
βββ latest_coding_agent.py # Main application entry point
βββ models.py # Pydantic models for structured AI responses
βββ openai_client.py # LLM client configuration
βββ application_executor.py # Application execution handler
βββ project_analyzer.py # Project analysis functionality
βββ project_manager.py # Project creation and management
βββ file_manager.py # File operations utilities
βββ requirements_manager.py # Dependency management
βββ user_interaction.py # User interface components
βββ scraper_doc.py # Web scraping for reference docs
βββ utils.py # General utilities
βββ requirements.txt # Project dependencies
βββ .envcopy # Environment variables template
βββ .gitignore # Git ignore rules
βββ LICENSE # MIT License
βββ README.md # This file
βββ run_command.txt # Execution instructions
βββ generated_projects/ # Directory for generated projects
βββ old_version/ # Previous versions
βββ v0.1_latest_coding_agent.py
βββ v0_old_coder.py
latest_coding_agent.py
(Main Entry Point - 687 lines)
models.py
(Pydantic Models)
File
: Model for individual code files (name, content)RequirementsGatheringEvent
: Model for AI requirements gathering responsesCodeGenerationEvent
: Model for AI code generation responses with file listsProjectAnalysisEvent
: Model for project analysis and update suggestionsopenai_client.py
(LLM Client Configuration)
get_client()
function used throughout the applicationapplication_executor.py
(Application Execution Handler)
project_analyzer.py
(Project Analysis Functionality)
project_manager.py
(Project Creation and Management)
generated_projects
folderfile_manager.py
(File Operations Utilities)
requirements_manager.py
(Dependency Management)
user_interaction.py
(User Interface Components)
scraper_doc.py
(Web Scraping for Reference Documentation)
utils.py
(General Utilities)
requirements.txt
(Project Dependencies)
.envcopy
(Environment Variables Template)
.env
and fill in their actual API keys.gitignore
(Git Ignore Rules)
.env
from version controlLICENSE
(MIT License)
run_command.txt
(Execution Instructions)
python3 latest_coding_agent.py
generated_projects/
(Generated Projects Directory)
project_YYYYMMDD_HHMMSS
old_version/
(Previous Versions)
v0.1_latest_coding_agent.py
: Previous version of main applicationv0_old_coder.py
: Original version of the coding agentWhen the application creates a new project, it generates the following structure:
generated_projects/project_20250107_143022/
βββ app.py # Main application file (Streamlit/FastAPI)
βββ requirements.txt # Project-specific dependencies
βββ README.md # Project documentation
βββ run_command.txt # Command to run the application
βββ static/ # Static files (for web projects)
β βββ css/
β βββ js/
β βββ images/
βββ templates/ # HTML templates (for FastAPI projects)
βββ index.html
app.py
with Streamlit components and UI elementsmain.py
with API endpoints, models, and documentationindex.html
, CSS files, and JavaScript for static websitesrequirements.txt
, README.md
, and run_command.txt
Complete User Interaction Flow:
$ python latest_coding_agent.py
================================================================================
Python Application Generator
================================================================================
Options:
1. Create a new Python application
2. Update an existing generated project
3. Create a static HTML website
Enter your choice (1, 2 or 3): 1
What would you like to build today? (Streamlit app or FastAPI service): streamlit dashboard
Project Description: streamlit dashboard
=== Gathering Requirements ===
Any Reference link eg doc:
Question 1: What kind of data visualization dashboard do you want to create? What type of data will it display?
Your response: sales analytics dashboard with charts showing revenue trends, product performance, and customer demographics
Question 2: What specific chart types would you like to include? (e.g., line charts, bar charts, pie charts, scatter plots)
Your response: line charts for revenue trends, bar charts for product sales, pie charts for customer segments, and interactive filters
Question 3: Do you want the dashboard to use sample data or connect to a specific data source?
Your response: use sample sales data with realistic numbers
β
Requirements gathered (3 questions answered)
=== Generating and Running Code ===
Attempt 1/3
Generated 4 files: app.py, requirements.txt, README.md, sample_data.py
Run command: streamlit run app.py
Installing dependencies...
β
Dependencies installed successfully
Starting application...
β
Application started successfully!
π You can access it at: http://localhost:8501
π Project location: /path/to/generated_projects/project_20250107_143022
π» To run it again: streamlit run app.py
=== Success! ===
Your application has been generated and is ready to use.
Location: /path/to/generated_projects/project_20250107_143022
Generated Files:
app.py
: Main Streamlit application with interactive dashboardrequirements.txt
: Dependencies (streamlit, pandas, plotly, numpy)README.md
: Project documentation and usage instructionssample_data.py
: Sample sales data generatorComplete User Interaction Flow:
$ python latest_coding_agent.py
================================================================================
Python Application Generator
================================================================================
Options:
1. Create a new Python application
2. Update an existing generated project
3. Create a static HTML website
Enter your choice (1, 2 or 3): 1
What would you like to build today? (Streamlit app or FastAPI service): fastapi todo api
Project Description: fastapi todo api
=== Gathering Requirements ===
Any Reference link eg doc:
Question 1: What kind of API endpoints do you want for your todo application?
Your response: CRUD operations - create, read, update, delete todos, plus list all todos and mark as complete
Question 2: What data fields should each todo item have?
Your response: id, title, description, completed status, created date, due date, priority level
Question 3: Do you want authentication, database integration, or just in-memory storage for now?
Your response: in-memory storage with Pydantic models, no authentication needed for now
β
Requirements gathered (3 questions answered)
=== Generating and Running Code ===
Attempt 1/3
Generated 5 files: main.py, models.py, requirements.txt, README.md, test_api.py
Run command: uvicorn main:app --reload
Installing dependencies...
β
Dependencies installed successfully
Starting application...
β
Application started successfully!
π You can access it at: http://localhost:8000
π API Documentation: http://localhost:8000/docs
π Project location: /path/to/generated_projects/project_20250107_144530
π» To run it again: uvicorn main:app --reload
=== Success! ===
Your application has been generated and is ready to use.
Location: /path/to/generated_projects/project_20250107_144530
Generated Files:
main.py
: FastAPI application with CRUD endpointsmodels.py
: Pydantic models for Todo itemsrequirements.txt
: Dependencies (fastapi, uvicorn, pydantic)README.md
: API documentation and usage examplestest_api.py
: Sample API test requestsComplete User Interaction Flow:
$ python latest_coding_agent.py
================================================================================
Python Application Generator
================================================================================
Options:
1. Create a new Python application
2. Update an existing generated project
3. Create a static HTML website
Enter your choice (1, 2 or 3): 2
Found existing projects:
1. project_20250107_143022 - Streamlit project (Created: 2025-01-07 14:30:22)
Main files: app.py, sample_data.py
2. project_20250107_144530 - FastAPI project (Created: 2025-01-07 14:45:30)
Main files: main.py, models.py
Select a project number to update (or 0 to create new): 1
Selected project: /path/to/generated_projects/project_20250107_143022
=== Analyzing Project ===
Project Type: Streamlit
Main Features: Sales analytics dashboard with revenue trends, product performance charts, and customer demographics visualization
Current Files: app.py, sample_data.py, requirements.txt, README.md
What updates would you like to make to this project?
Your input: add user authentication and the ability to upload custom CSV data files
=== Gathering Update Requirements ===
Question 1: What type of authentication do you want to implement? (simple password, user accounts, OAuth, etc.)
Your response: simple password protection with a login form
Question 2: What CSV file format should users be able to upload? What columns are expected?
Your response: CSV files with columns: date, product, revenue, customer_segment, region
Question 3: Should the uploaded data replace the sample data or be added alongside it?
Your response: replace the sample data and allow users to switch between different uploaded datasets
β
Update requirements gathered (3 questions answered)
=== Generating Updated Code ===
Generated 6 files: app.py, auth.py, data_handler.py, requirements.txt, README.md, sample_data.py
Updated/Added files:
- app.py (enhanced with authentication and file upload)
- auth.py (new - authentication functions)
- data_handler.py (new - CSV processing)
- requirements.txt (updated with new dependencies)
β
Updated application started successfully!
π You can access it at: http://localhost:8501
π Updated project location: /path/to/generated_projects/project_20250107_143022_updated_20250107_150015
=== Update Summary ===
Original project: /path/to/generated_projects/project_20250107_143022
Updated project: /path/to/generated_projects/project_20250107_143022_updated_20250107_150015
Updated/Added files:
- app.py
- auth.py
- data_handler.py
- requirements.txt
Complete User Interaction Flow:
$ python latest_coding_agent.py
================================================================================
Python Application Generator
================================================================================
Options:
1. Create a new Python application
2. Update an existing generated project
3. Create a static HTML website
Enter your choice (1, 2 or 3): 3
What kind of website would you like to build? portfolio website for a web developer
Website Description: portfolio website for a web developer
=== Gathering Requirements ===
Any Reference link eg doc:
Question 1: What sections do you want on your portfolio website?
Your response: header with navigation, about me section, skills showcase, project portfolio with images, contact form, and footer
Question 2: What color scheme and design style do you prefer?
Your response: modern dark theme with blue accents, clean minimalist design, responsive layout
Question 3: Do you want any interactive features or animations?
Your response: smooth scrolling, hover effects on project cards, animated skill bars, and a working contact form
β
Requirements gathered (3 questions answered)
=== Generating and Running Code ===
Attempt 1/3
Generated 8 files: index.html, styles.css, script.js, images/placeholder.jpg, README.md, contact.php, projects.json, favicon.ico
Run command: python -m http.server 8000
Starting application...
β
Application started successfully!
π You can access it at: http://localhost:8000
π Project location: /path/to/generated_projects/project_20250107_151245
π» To run it again: python -m http.server 8000
=== Success! ===
Your application has been generated and is ready to use.
Location: /path/to/generated_projects/project_20250107_151245
Generated Files:
index.html
: Main HTML structure with all sectionsstyles.css
: Complete CSS with dark theme and responsive designscript.js
: JavaScript for animations and interactivitycontact.php
: Backend script for contact form processingprojects.json
: Sample project dataimages/
: Directory with placeholder imagesREADME.md
: Website documentation and deployment instructionsStreamlit Applications:
FastAPI Services:
HTML Websites:
For Streamlit Projects:
generated_projects/project_YYYYMMDD_HHMMSS/
βββ app.py # Main Streamlit application
βββ requirements.txt # streamlit, pandas, plotly, etc.
βββ README.md # Usage instructions
βββ run_command.txt # streamlit run app.py
βββ data/ # Sample data files (if needed)
βββ sample_data.csv
For FastAPI Projects:
generated_projects/project_YYYYMMDD_HHMMSS/
βββ main.py # FastAPI application
βββ models.py # Pydantic models
βββ requirements.txt # fastapi, uvicorn, pydantic
βββ README.md # API documentation
βββ run_command.txt # uvicorn main:app --reload
βββ tests/ # API tests (if generated)
βββ test_main.py
For HTML Projects:
generated_projects/project_YYYYMMDD_HHMMSS/
βββ index.html # Main HTML file
βββ styles.css # CSS styling
βββ script.js # JavaScript functionality
βββ README.md # Deployment instructions
βββ run_command.txt # python -m http.server 8000
βββ images/ # Image assets
β βββ placeholder.jpg
βββ assets/ # Additional assets
βββ fonts/
βββ icons/
Main Menu Options:
Requirements Gathering Process:
Code Generation and Execution:
Problem: pip install -r requirements.txt
fails or packages donβt install correctly
Solutions:
python --version
pip install --upgrade pip
python -m venv vibe_coder_env
source vibe_coder_env/bin/activate # On Windows: vibe_coder_env\Scripts\activate
pip install -r requirements.txt
pip cache purge
pip install fastapi openai pydantic python-dotenv streamlit uvicorn
pip install --no-cache-dir -r requirements.txt
Problem: Authentication errors, invalid API key, or connection failures
Solutions:
.env
file (no quotes needed):
OPENAI_API_KEY=sk-proj-your-actual-key-here
https://api.openai.com/v1/
https://api.deepseek.com/v1/
http://127.0.0.1:1234/v1/
http://localhost:11434/v1/
curl -H "Authorization: Bearer YOUR_API_KEY" https://api.openai.com/v1/models
.env
fileProblem: Model not found, unsupported features, or generation failures
Solutions:
.env
matches your providerβs available modelsgpt-3.5-turbo
, gpt-4
, gpt-4-turbo
deepseek-coder
, deepseek-chat
qwen2.5-coder:3b
(include tag)ollama list
(for Ollama) or provider dashboardProblem: Generated applications fail to launch or crash immediately
Solutions:
# Find process using port
lsof -i :8501 # or :8000
# Kill process
kill -9 <PID>
pip list | grep -E "(streamlit|fastapi|uvicorn)"
run_command.txt
for specific instructionscd generated_projects/project_YYYYMMDD_HHMMSS
streamlit run app.py # or uvicorn main:app --reload
Problem: AI generates incomplete, incorrect, or non-functional code
Solutions:
Problem: Cannot create files, permission denied, or path not found errors
Solutions:
sudo python latest_coding_agent.py
(Linux/macOS)df -h
generated_projects
directory can be createdProblem: Import errors, module not found, or system-specific failures
Solutions:
python --version
(requires 3.8+)# Ubuntu/Debian
sudo apt-get update && sudo apt-get install python3-dev python3-pip
# macOS
brew install python
# Windows: Download from python.org
find . -type d -name __pycache__ -delete
pip uninstall package_name && pip install package_name
requirements.txt
installation process occasionally fails due to:
generated_projects/
directoryIdeal For:
Not Recommended For:
User Input β Requirements Gathering β AI Code Generation β Project Creation β Dependency Installation β Application Execution
βββββββββββββββ ββββββββββββββββ βββββββββββββββ ββββββββββββββββ
β CLI β β Requirements β β LLM β β Project β
β Interface βββββΆβ Gathering βββββΆβ Generation βββββΆβ Creation β
βββββββββββββββ ββββββββββββββββ βββββββββββββββ ββββββββββββββββ
β β
βΌ βΌ
ββββββββββββββββ ββββββββββββββββ
β Document β β Dependency β
β Scraping β β Management β
ββββββββββββββββ ββββββββββββββββ
β
βΌ
ββββββββββββββββ
β Application β
β Execution β
ββββββββββββββββ
Streamlit and FastAPI provide the best combination for rapid application development:
The Vibe Coder Agent follows a modular architecture designed for extensibility and maintainability. The system is organized into distinct layers that handle different aspects of the code generation workflow.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β VIBE CODER AGENT ARCHITECTURE β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ β
β β CLI Interface β β User Interface β β Input Handler β β
β β β β Components β β β β
β β β’ Main Menu βββββΊβ β’ Prompts βββββΊβ β’ Validation β β
β β β’ Option Select β β β’ Progress β β β’ Sanitization β β
β β β’ Error Display β β β’ Formatting β β β’ Type Checking β β
β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ β
β β β β β
β βββββββββββββββββββββββββΌββββββββββββββββββββββββ β
β β β
β βββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββ β
β β CORE ORCHESTRATION LAYER β β
β β β β
β β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ β β
β β β Requirements β β AI Conversationβ β Project β β β
β β β Gathering β β Manager β β Analyzer β β β
β β β β β β β β β β
β β β β’ Question Flow βββββΊβ β’ Context Mgmt βββββΊβ β’ Type Detectionβ β β
β β β β’ User Responsesβ β β’ Message Historyβ β β’ File Analysis β β β
β β β β’ Validation β β β’ Model Selectionβ β β’ Update Logic β β β
β β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ β β
β ββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ β
β β β
β βββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββ β
β β LLM INTEGRATION LAYER β β
β β β β
β β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ β β
β β β OpenAI β β DeepSeek β β Local LLM β β β
β β β Client β β Client β β Client β β β
β β β β β β β β β β
β β β β’ GPT Models β β β’ Coder Models β β β’ LM Studio β β β
β β β β’ API Handling β β β’ API Handling β β β’ Ollama β β β
β β β β’ Rate Limiting β β β’ Rate Limiting β β β’ Custom Serversβ β β
β β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ β β
β ββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ β
β β β
β βββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββ β
β β CODE GENERATION & PROCESSING β β
β β β β
β β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ β β
β β β Pydantic β β Code β β File β β β
β β β Models β β Generator β β Manager β β β
β β β β β β β β β β
β β β β’ File Model βββββΊβ β’ Template Mgmt βββββΊβ β’ File Creation β β β
β β β β’ Event Models β β β’ Code Validationβ β β’ Directory Mgmtβ β β
β β β β’ Type Safety β β β’ Multi-attempt β β β’ Path Handling β β β
β β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ β β
β ββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ β
β β β
β βββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββ β
β β PROJECT MANAGEMENT LAYER β β
β β β β
β β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ β β
β β β Project β β Requirements β β Application β β β
β β β Manager β β Manager β β Executor β β β
β β β β β β β β β β
β β β β’ Dir Creation βββββΊβ β’ Dependency βββββΊβ β’ App Startup β β β
β β β β’ Timestamping β β Installation β β β’ Process Mgmt β β β
β β β β’ Organization β β β’ Pip Managementβ β β’ URL Detection β β β
β β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The application follows a structured workflow from user input to application execution:
USER INPUT WORKFLOW
βββββββββββββββββββ
βββββββββββββββ
β START β
β Application β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Main Menu β
β Selection β
β β
β 1. New App β
β 2. Update β
β 3. HTML β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Option 1 β β Option 2 β β Option 3 β
β New Python β β Update β β HTML β
β Application β β Existing β β Website β
ββββββββ¬βββββββ ββββββββ¬βββββββ ββββββββ¬βββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Choose β β Select β β Describe β
β Streamlit/ β β Project β β Website β
β FastAPI β β from List β β Requirementsβ
ββββββββ¬βββββββ ββββββββ¬βββββββ ββββββββ¬βββββββ
β β β
ββββββββββββββββββββΌβββββββββββββββββββ
β
βΌ
βββββββββββββββ
β REQUIREMENTSβ
β GATHERING β
β PHASE β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Reference β
β Doc Input β
β (Optional) β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Web Scraper βββββ scraper_doc.py
β Processing β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β AI Question βββββ models.py
β Generation β (RequirementsGatheringEvent)
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β User Input βββββ user_interaction.py
β Collection β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Sufficient β
βRequirements?β
ββββββββ¬βββββββ
β
ββββββΌβββββ
β NO β
ββββββ¬βββββ
β
βΌ
βββββββββββββββ
β Continue β
β Questioning β
ββββββββ¬βββββββ
β
βββββββββββ
β
ββββββΌβββββ β
β YES β β
ββββββ¬βββββ β
β β
βΌ β
βββββββββββββββ β
β CODE β β
β GENERATION β β
β PHASE β β
ββββββββ¬βββββββ β
β β
βΌ β
βββββββββββββββ β
β LLM Client ββββΌβββ openai_client.py
β Selection β β
ββββββββ¬βββββββ β
β β
βΌ β
βββββββββββββββ β
β AI Code ββββΌβββ models.py
β Generation β β (CodeGenerationEvent)
ββββββββ¬βββββββ β
β β
βΌ β
βββββββββββββββ β
β Code β β
β Validation β β
β & Retry β β
ββββββββ¬βββββββ β
β β
ββββββΌβββββ β
β Success?β β
ββββββ¬βββββ β
β β
ββββββΌβββββ β
β NO β β
β(Retry) β β
ββββββ¬βββββ β
β β
βββββββββββ
ββββββΌβββββ
β YES β
ββββββ¬βββββ
β
βΌ
βββββββββββββββ
β PROJECT β
β CREATION β
β PHASE β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Create βββββ project_manager.py
β Project β
β Directory β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Generate βββββ file_manager.py
β Files β
β Structure β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Write Code β
β Files to β
β Disk β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β DEPENDENCY β
βINSTALLATION β
β PHASE β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Install βββββ requirements_manager.py
β Python β
β Packages β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Handle β
β Install β
β Errors β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
βAPPLICATION β
β EXECUTION β
β PHASE β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Start βββββ application_executor.py
β Application β
β Process β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Detect β
β Application β
β URL & Port β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Display β
β Success β
β Message β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β END β
β Application β
β Ready to β
β Use β
βββββββββββββββ
The major components interact in a coordinated manner to deliver the complete functionality:
COMPONENT INTERACTION DIAGRAM
ββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β INTERACTION FLOW β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
latest_coding_agent.py (Main Controller)
β
βββΊ user_interaction.py βββββββΊ Collect user input and display prompts
β
βββΊ scraper_doc.py ββββββββββββΊ Process reference documentation URLs
β
βββΊ openai_client.py ββββββββββΊ Initialize LLM client connection
β
βββΊ models.py βββββββββββββββββΊ Structure AI requests and responses
β β
β βββΊ RequirementsGatheringEvent
β βββΊ CodeGenerationEvent
β βββΊ ProjectAnalysisEvent
β
βββΊ project_analyzer.py βββββββΊ Analyze existing projects (Option 2)
β
βββΊ project_manager.py ββββββββΊ Create and organize project directories
β β
β βββΊ file_manager.py βββΊ Create files
β
βββΊ requirements_manager.py ββββΊ Install Python dependencies
β
βββΊ application_executor.py ββββΊ Start and manage applications
Data Flow:
User Input β Requirements Gathering β AI Processing β Code Generation β
File Creation β Dependency Installation β Application Execution
generated_projects/
directoryThe application uses Pydantic models to ensure type safety and structured communication:
DATA MODEL HIERARCHY
βββββββββββββββββββ
File Model
βββ name: str (filename)
βββ content: str (file contents)
RequirementsGatheringEvent
βββ all_details_gathered: bool
βββ question: str
βββ project_type: str
βββ requirements: str
CodeGenerationEvent
βββ generated_code: List[File]
βββ run_command: str
ProjectAnalysisEvent
βββ project_structure: str
βββ project_type: str
βββ main_features: str
βββ suggested_updates: List[str]
This architecture ensures maintainability, extensibility, and reliable operation while providing a smooth user experience from initial input to running application.
We welcome contributions! Please follow these steps:
git checkout -b feature/amazing-feature
)git commit -m 'Add amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
For questions, issues, or contributions, please:
Demo Screenshots