An intelligent web development agent that transforms your ideas into fully functional websites. Simply describe what you want or upload an image, and watch as it generates HTML, CSS, and JavaScript code, then automatically deploys it to GitHub Pages.
Watch the demo to see the AI Web Generator in action!
- ๐ค AI-Powered Generation: Uses Google Gemini AI to understand your requirements
- ๐ฑ Multi-Input Support: Accept text prompts or image uploads
- ๐จ Complete Web Stack: Generates HTML, CSS, and JavaScript
- ๐ Auto Deployment: Automatically creates GitHub repository and deploys to GitHub Pages
- ๐ผ๏ธ Image Recognition: Replicates designs from uploaded images
- ๐ Responsive Design: Creates mobile-friendly websites
- โก Local Development: Generates files in your local machine first
Before you begin, ensure you have the following:
- Python 3.8 or higher
- Git installed on your system
- GitHub account
- Google Cloud account (for Gemini API)
git clone https://github.com/yourusername/ai-web-generator.git
cd ai-web-generatorpip install -r requirements.txt- Go to GitHub Settings > Developer settings > Personal access tokens
- Click "Generate new token (classic)"
- Select the following scopes:
repo(Full control of private repositories)workflow(Update GitHub Action workflows)write:packages(Upload packages to GitHub Package Registry)
- Copy the generated token
- Go to Google AI Studio
- Click "Create API Key"
- Select your Google Cloud project or create a new one
- Copy the generated API key
Option 1: Direct Code Modification (Recommended)
Open your main Python file and replace the placeholder values:
# GitHub Configuration (Replace with your actual tokens)
GITHUB_TOKEN = "your_github_personal_access_token_here"
GITHUB_USERNAME = "your_github_username_here"
# Google Gemini AI Configuration
GEMINI_API_KEY = "your_gemini_api_key_here"Option 2: Environment Variables (Optional)
If you prefer using environment variables, create a .env file:
GITHUB_TOKEN=your_github_personal_access_token_here
GITHUB_USERNAME=your_github_username
GEMINI_API_KEY=your_gemini_api_key_heregit config --global user.name "Your Name"
git config --global user.email "[email protected]"python main.pyThe application will guide you through an interactive setup:
-
Image Input: Choose whether to provide an image or text description
Do you wanna give image input(y/n)?:- y Enter the image path: /path/to/your-design.png -
Project Description: Describe what you want to create
๐ฏ Describe the project you want to create: Create a modern portfolio website with dark theme -
Project Name: Enter a name or press Enter for auto-generated name
๐ Project name (press Enter for auto-generated): my-portfolio -
GitHub Deployment: Choose whether to deploy to GitHub
๐ Deploy to GitHub? (y/n): y ๐ฆ Repository name (default: my-portfolio): -
Results: View your generated project and live website
๐ SUCCESS! ๐ Local project: ./generated/my-portfolio ๐ Live website: https://yourusername.github.io/my-portfolio
annotated-types==0.7.0
anyio==4.9.0
cachetools==5.5.2
certifi==2025.4.26
charset-normalizer==3.4.2
google-auth==2.40.2
google-genai==1.16.1
h11==0.16.0
httpcore==1.0.9
httpx==0.28.1
idna==3.10
pyasn1==0.6.1
pyasn1_modules==0.4.2
pydantic==2.11.4
pydantic_core==2.33.2
requests==2.32.3
rsa==4.9.1
sniffio==1.3.1
typing-inspection==0.4.1
typing_extensions==4.13.2
urllib3==2.4.0
websockets==15.0.1
- Operating System: Windows 10+, macOS 10.14+, or Linux
- Python: 3.8 or higher
- Memory: Minimum 4GB RAM
- Storage: 1GB free space
- Internet: Required for AI API calls and GitHub operations
Do you wanna give image input(y/n)?:- n
๐ฏ Describe the project you want to create: Create a minimal portfolio website for a UX designer
๐ Project name (press Enter for auto-generated): ux-portfolio
๐ Deploy to GitHub? (y/n): y
๐ฆ Repository name (default: ux-portfolio):
Do you wanna give image input(y/n)?:- y
Enter the image path: ./designs/mockup.png
๐ฏ Describe the project you want to create: Replicate this restaurant website design
๐ Project name (press Enter for auto-generated): restaurant-site
๐ Deploy to GitHub? (y/n): y
Do you wanna give image input(y/n)?:- n
๐ฏ Describe the project you want to create: Modern SaaS landing page with pricing section
๐ Project name (press Enter for auto-generated): saas-landing
๐ Deploy to GitHub? (y/n): n
-
API Key Errors
Error: Invalid API key
- Verify your API keys in the placeholder sections of your code
- Check if the keys have proper permissions
-
GitHub Permission Errors
Error: Permission denied
- Ensure your GitHub token has the required scopes
- Verify your GitHub username is correct
-
Generation Failures
Error: Failed to generate code
- Check your internet connection
- Verify the Gemini API quota hasn't been exceeded
If you encounter issues, check the console output for detailed error messages and troubleshooting information during the interactive process.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Google Gemini AI for code generation
- GitHub for hosting and deployment
- Unsplash for placeholder images
- The open-source community for inspiration
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Support for React/Vue.js generation
- Database integration capabilities
- Custom domain configuration
- Team collaboration features
- Template marketplace
- Advanced SEO optimization
โญ Star this repository if you find it helpful!
Made with โค๏ธ by Ansh karwasra