WhiteBox-Ai Tailwind Templates

Whitebox Ai

Next.js, React.js, tailwind, shadcn, TypeScript, Auth, openai, gemini, deepseek, firebase, Neon postgres SQL, drizzle db, SandPack for code editor...

✨ Image to Code Converter (WhiteBox AI) 🖼️➡️💻

License: MIT

A project that converts uploaded images (UI designs, mockups, screenshots) into corresponding frontend code.

🎯 Overview

This application allows users to upload an image of a user interface design or a wireframe. The backend then processes this image, potentially using an AI model (like Grizzle), to generate HTML, CSS, and JavaScript code, React.js or components for frameworks like Next.js.

🌟 Features

  • 🖼️ Image Upload: Users can easily upload image files (e.g., JPG, PNG) of UI designs.
  • ⚙️ Code Generation: Converts the visual elements from the image into structured code.
  • 🖥️ Interactive Preview (Optional): Display the generated code rendered as a webpage.
  • 📋 Code Copying: Easily copy the generated HTML, CSS, or JavaScript.

🛠️ Tech Stack

  • Frontend: Next.js (React Framework)
  • 🎨 Styling: (e.g., Tailwind CSS, CSS Modules - Specify what you're using)
  • Backend Logic/API: Next.js API Routes
  • 🗄️ Database: Neon (Serverless PostgreSQL)
  • 🔑💾 Authentication & Storage (Optional): Firebase (e.g., Firebase Auth for users, Firebase Storage for images)
  • 🤖 AI/ML Model for Image-to-Code: Grizzle (Assuming Grizzle is the service for this - adjust if it's different or a custom model)
  • ☁️ Deployment (Optional): (e.g., Vercel, Netlify - Specify where you plan to deploy)

✅ Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (LTS version recommended)
  • npm or yarn
  • Access to Firebase, Neon, and Grizzle services (and their respective API keys/credentials).

🚀 Getting Started

Follow these instructions to set up the project locally.

📦 Installation

  1. Clone the repository:

    git clone <your-repository-url>
    cd WhiteBox-AI 
    
  2. Install dependencies:

    npm install
    # or
    yarn install
    

Environment Variables

Create a .env file in the root of your project and add the necessary environment variables. Refer to .env.example if you create one.

# Next.js
NEXT_PUBLIC_APP_URL=http://localhost:3000

# Firebase (Update with your Firebase project config)
NEXT_PUBLIC_FIREBASE_API_KEY=your_firebase_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_firebase_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_firebase_storage_bucket
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_firebase_messaging_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_firebase_app_id

# Neon (PostgreSQL Database URL)
DATABASE_URL=your_neon_database_url

# Grizzle AI (or other image-to-code service)
GRIZZLE_API_KEY=your_grizzle_api_key

Running the Application

  1. Run database migrations (if applicable with Neon): (Add command if you are using a migration tool like Prisma or Drizzle ORM migrations)

    # Example: npx prisma migrate dev
    
  2. Start the development server:

    npm run dev
    # or
    yarn dev
    

    The application should now be running on http://localhost:3000.

Usage

  1. Navigate to the application in your browser.
  2. Upload an image of the UI you want to convert.
  3. Wait for the processing to complete.
  4. View and copy the generated code.

(Add more specific steps or screenshots if possible)

🤝 Contributing

Contributions are welcome! Please open an issue first to discuss what you would like to change or add.

📜 License

This project is licensed under the MIT License.

Top categories

Loading Svelte Themes