Skip to content

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.

License

Notifications You must be signed in to change notification settings

Rachel602144/Karbon

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ 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

Karbon UI Screenshot


🧠 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.exe using PyInstaller
  • Create a GitHub release with the .exe attached

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.

Login Page


πŸ”Ή 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.

Portfolio


πŸ”Ή 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.

Landing Page 1 Landing Page 2


πŸ”Ή 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.

Blog


πŸ”Ή 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.

Form


πŸ“Š 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.

Karbon Architecture

πŸ§‘β€πŸ’» Contributing

Pull requests are welcome! To contribute:

  1. Fork the repo
  2. Create a feature branch (git checkout -b feature/new-feature)
  3. Commit your changes (git commit -m 'Add feature')
  4. Push to the branch (git push origin feature/new-feature)
  5. Open a pull request

πŸ“ License

GNU General Public License v3.0. See LICENSE file for details.


About

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.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.0%
  • HTML 1.0%