Karbon
Karbon copied to clipboard
Karbon is a desktop app that uses AI to generate and iteratively refine HTML/CSS/JS websites from simple prompts. Built with Python and Tkinter, it provides a live preview and export functionality.
π Karbon - AI Web Builder
Karbon is a desktop app that uses AI to generate and iteratively refine HTML/CSS/JS websites from simple prompts. Built with Python and Tkinter, it provides a live preview and export functionality.
Screenshots

π§ Features
- π€ Prompt-based website generation using AI
- π οΈ Iterative prompt-based updates to the code
- πΌοΈ Live preview in a browser window
- π€ Export final code to HTML/CSS/JS files
- ποΈ Simple and intuitive Tkinter GUI
βοΈ Installation
1. Clone the repository
git clone https://github.com/prakhardoneria/karbon.git
cd karbon
2. Install dependencies
pip install -r requirements.txt
βΆοΈ Running the App
python main.py
The app window will launch, allowing you to enter a prompt to generate your first website layout.
π Project Structure
karbon/
βββ main.py # Main application entry point
βββ ui.py # Legacy UI entry point (deprecated)
βββ contributors_page.py # Contributors page UI
βββ code_editor_ui.py # Code editor interface
βββ
βββ core/ # Core functionality
β βββ ai_engine.py # AI generation engine
β βββ token_manager.py # API token management
β βββ prompt_history.py # Prompt history management
β βββ prompt_drafts_system.py # Draft system
β
βββ ui_items/ # UI components
β βββ karbon_ui.py # Main UI controller
β βββ prompt_view.py # Prompt input interface
β βββ editor_view.py # Code editor view
β βββ contributors_view.py # Contributors display
β βββ token_manager_view.py # Token management UI
β
βββ exporters/ # Export functionality
β βββ exporter.py # General export functions
β βββ github_exporter.py # GitHub export
β βββ repo_pusher.py # Repository management
β
βββ utils/ # Utility functions
β βββ preview.py # Preview functionality
β βββ project_io.py # Project I/O operations
β
βββ tests/ # Test suite
β βββ test_dummy.py # Basic tests
β
βββ assets/ # Static assets
βββ docs/ # Documentation
βββ requirements.txt # Python dependencies
π οΈ Building Executable (Windows)
Use PyInstaller to create a standalone .exe:
pyinstaller ui.py --onefile --noconsole --name Karbon --icon=icon.ico
The built executable will appear in the dist/ folder.
π¦ Release via GitHub Actions
On push to the main branch, GitHub Actions will:
- Build
Karbon.exeusing PyInstaller - Create a GitHub release with the
.exeattached
See .github/workflows/build-karbon.yml for details.
π Project Structure
karbon/
βββ ui.py # Main UI launcher
βββ ai_engine.py # Handles AI code generation
βββ exporter.py # Exports final code to files
βββ preview.py # Opens code in browser preview
βββ ui_items/ # Modularized UI components
β βββ __init__.py
β βββ prompt_view.py
β βββ editor_view.py
β βββ karbon_ui.py
βββ requirements.txt
βββ .gitignore
βββ README.md
π§ͺ Example Prompts and Outputs
Here are some example prompts you can try in Karbon, along with typical outputs:
πΉ Prompt: βCreate a login page using HTML and TailwindΒ CSSβ
Output: Generates a login page which takes user's Username and Password as input for Login.

πΉ Prompt: βBuild a personal portfolio page with sections for About, Projects,Β andΒ Contactβ
Output: Generates HTML/CSS with an About Me, My projects and Get in Touch.

πΉ Prompt: βDesign a landing page for a mobile app with a pricing section andΒ testimonialsβ
Output: Renders a landing page layout with Pricing Plans, and What Our Users Say.
.jpg)
πΉ Prompt: βCreate a dark-themed blog homepage with a navbar and featuredΒ articlesβ
Output: Creates a dark-themed homepage with navbar having Home, About, Contact and features articles with images.

πΉ Prompt: βGenerate a simple form to collect name, email, and message withΒ aΒ submitΒ buttonβ
Output: Creates a form with labeled input fields and a submit button, styled using CSS.

π Architecture
The following diagram illustrates Karbon's high-level architecture.
It shows how user input flows from the GUI to the AI engine and how the generated code is previewed and exported.
This structure makes the project modular, easier to maintain, and simple to extend.

π§βπ» Contributing
Pull requests are welcome! To contribute:
- Fork the repo
- Create a feature branch (
git checkout -b feature/new-feature) - Commit your changes (
git commit -m 'Add feature') - Push to the branch (
git push origin feature/new-feature) - Open a pull request
π License
GNU General Public License v3.0. See LICENSE file for details.