Skip to content

siddiksawani/CodeSnap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿช„ CodeSnap AI

Transform ideas into fully functional websites with the power of AI

TypeScript React Node.js Vite Tailwind CSS

๐ŸŽฏ What is CodeSnap AI?

CodeSnap AI is a revolutionary web development tool that bridges the gap between ideas and implementation. Simply describe your website in natural language, and watch as AI generates a complete, production-ready project that runs instantly in your browser.

โœจ Key Features

  • ๐Ÿค– AI-Powered Generation: Natural language โ†’ Working websites
  • โšก Instant Preview: See your website live immediately using WebContainer
  • ๐Ÿ“ Smart File Management: Interactive file explorer with Monaco editor
  • ๐ŸŽจ Modern UI/UX: Clean, professional dark theme interface
  • ๐Ÿ“ฑ Responsive Design: Works seamlessly across all devices
  • ๐Ÿ’พ Project Export: Download complete projects as ZIP files
  • ๐Ÿ”ง Zero Setup: No local development environment needed

๐Ÿš€ Live Demo

CodeSnap AI Demo

๐Ÿ› ๏ธ Tech Stack

Frontend

  • React 18 with TypeScript for type safety
  • Vite for lightning-fast development
  • Tailwind CSS for modern styling
  • Monaco Editor for professional code editing
  • WebContainer API for browser-based Node.js runtime
  • JSZip for client-side project downloads

Backend

  • Node.js with Express.js
  • TypeScript for enhanced development experience
  • Anthropic Claude AI for intelligent code generation
  • CORS configured for cross-origin requests

Key Integrations

  • ๐Ÿง  Anthropic Claude AI: Powers intelligent code generation
  • ๐ŸŒ WebContainer: Enables browser-based Node.js execution
  • ๐Ÿ’ป Monaco Editor: Provides VSCode-powered editing experience
  • ๐Ÿ“ฆ JSZip: Handles client-side ZIP file creation

๐Ÿš€ Quick Start

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/siddiksawani/CodeSnap.git
    cd CodeSnap
  2. Backend Setup

    cd be
    npm install
    echo "ANTHROPIC_API_KEY=your_api_key_here" > .env
    npm run dev
  3. Frontend Setup (in a new terminal)

    cd frontend
    npm install
    npm run dev
  4. Open your browser

    • Frontend: http://localhost:5173
    • Backend: http://localhost:3000

๐ŸŽจ How to Use

1. Describe Your Vision

"Create a modern portfolio website with dark theme, hero section, about me, projects showcase, and contact form"

2. Watch the Magic

  • AI analyzes your requirements
  • Determines the best technology stack
  • Generates complete project structure
  • Creates all necessary files and dependencies

3. Instant Preview

  • Files are mounted in WebContainer
  • Dependencies install automatically
  • Development server starts instantly
  • Live preview becomes available

4. Edit & Export

  • Navigate files with interactive explorer
  • Edit code with Monaco editor
  • See changes in real-time
  • Download complete project as ZIP

๐Ÿ“ Project Structure

CodeSnap/
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ be/                          # Backend server
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ index.ts            # Main API server
โ”‚   โ”‚   โ”œโ”€โ”€ prompts.ts          # AI prompt templates
โ”‚   โ”‚   โ””โ”€โ”€ defaults/           # Project boilerplates
โ”‚   โ”‚       โ”œโ”€โ”€ react.ts        # React project template
โ”‚   โ”‚       โ””โ”€โ”€ node.ts         # Node.js project template
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ””โ”€โ”€ tsconfig.json
โ”‚
โ””โ”€โ”€ frontend/                    # React application
    โ”œโ”€โ”€ src/
    โ”‚   โ”œโ”€โ”€ components/          # Reusable UI components
    โ”‚   โ”‚   โ”œโ”€โ”€ TabView.tsx      # Code/Preview tabs
    โ”‚   โ”‚   โ”œโ”€โ”€ CodeEditor.tsx   # Monaco editor wrapper
    โ”‚   โ”‚   โ”œโ”€โ”€ FileExplorer.tsx # Interactive file tree
    โ”‚   โ”‚   โ”œโ”€โ”€ PreviewFrame.tsx # WebContainer preview
    โ”‚   โ”‚   โ””โ”€โ”€ FullScreenPreview.tsx # Modal preview
    โ”‚   โ”œโ”€โ”€ pages/
    โ”‚   โ”‚   โ”œโ”€โ”€ Home.tsx         # Landing page
    โ”‚   โ”‚   โ””โ”€โ”€ Builder.tsx      # Main development interface
    โ”‚   โ”œโ”€โ”€ hooks/
    โ”‚   โ”‚   โ””โ”€โ”€ useWebContainer.ts # WebContainer management
    โ”‚   โ””โ”€โ”€ utils/
    โ”‚       โ””โ”€โ”€ downloadUtils.ts # ZIP download functionality
    โ”œโ”€โ”€ package.json
    โ””โ”€โ”€ vite.config.ts

๐ŸŽฏ Example Use Cases

Portfolio Website

Input: "Create a developer portfolio with hero section, skills, projects, and contact"
Output: Modern React app with routing, animations, and responsive design

Business Landing Page

Input: "Build a SaaS landing page with pricing, features, and testimonials"
Output: Complete marketing site with modern UI components

Web Application

Input: "Make a todo app with drag-and-drop, categories, and local storage"
Output: Full-featured React app with state management

๐Ÿ”ง API Endpoints

Generate Website

POST /api/generate
Content-Type: application/json

{
  "prompt": "Your website description here"
}

Response:

{
  "files": {
    "package.json": "...",
    "src/index.js": "...",
    "src/App.jsx": "..."
  },
  "steps": ["Step 1", "Step 2", "..."]
}

๐ŸŒŸ Advanced Features

Smart Framework Detection

  • React: For interactive UIs, SPAs, complex frontends
  • Node.js: For APIs, servers, backend services
  • Automatic: AI chooses the best framework based on requirements

Multiple Preview Modes

  • In-App Modal: Full-screen preview within the application
  • Popup Window: Separate browser window with embedded iframe
  • Live Reloading: Changes reflect immediately

Professional Code Editor

  • Syntax Highlighting: Multi-language support
  • IntelliSense: Auto-completion and error detection
  • VSCode Experience: Familiar editing environment

๐Ÿš€ Deployment

Frontend (Netlify/Vercel)

cd frontend
npm run build
# Deploy dist/ folder

Backend (Railway/Heroku)

cd be
npm install
npm run dev
# Set ANTHROPIC_API_KEY environment variable

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐ŸŽฏ What Makes CodeSnap Special?

Zero Setup Required

  • No local development environment needed
  • No dependencies to install
  • Works entirely in your browser

AI-First Approach

  • Natural language โ†’ Working code
  • Intelligent technology choices
  • Best practices built-in

Instant Gratification

  • See results immediately
  • Real-time preview
  • No waiting for builds

Professional Output

  • Production-ready code
  • Modern best practices
  • Deployment-ready projects

๐Ÿš€ Future Enhancements

  • Multiple Framework Support (Vue.js, Angular, Svelte)
  • Database Integration (Automatic backend with database)
  • Deployment Integration (One-click deploy to Vercel/Netlify)
  • Template Marketplace (Community-contributed templates)
  • Collaboration Features (Share and remix projects)
  • Version Control Integration
  • Advanced AI Models Support

๐Ÿ› Issues & Support

Found a bug or have a suggestion? Please open an issue on GitHub.

๐Ÿ“ง Contact

Siddik Sawani - @siddiksawani - siddikhacker@gmail.com

Project Link: https://github.com/siddiksawani/CodeSnap


CodeSnap AI - Where ideas become reality at the speed of thought โšก

Made with โค๏ธ by Siddik Sawani

โญ Star this repo | ๐Ÿ› Report Bug | โœจ Request Feature

About

AI coder

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

โšก