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