Skip to content

deekshith-b48/Buildify

Repository files navigation

🎨 Buildify - AI Website Generator

Buildify Next.js TypeScript Tailwind CSS

Generate, Edit, and Explore designs with AI. Export clean, responsive code.

πŸš€ Live Demo β€’ πŸ“– Documentation β€’ πŸ› Report Bug β€’ ✨ Request Feature


πŸ“‹ Table of Contents


✨ Features

🎯 Core Features

  • πŸ€– AI-Powered Generation - Generate complete website designs from text descriptions
  • 🎨 Real-time Preview - See your designs come to life instantly
  • πŸ“± Responsive Design - Mobile-first, responsive layouts out of the box
  • πŸ”§ Code Export - Export clean, production-ready HTML/CSS/React code
  • 🎭 Multiple Templates - Dashboard, forms, hero sections, and user profiles

πŸ” Authentication & User Management

  • πŸ”’ Secure Authentication - Powered by Clerk with social logins
  • πŸ‘€ User Profiles - Personalized workspaces and project management
  • πŸ’³ Credit System - Built-in credit system for AI generations
  • πŸ“Š Project Tracking - Save and manage multiple projects

🎨 Design Features

  • πŸ–ΌοΈ Frame Management - Organize designs in frames
  • πŸ’¬ Chat History - Keep track of all your design conversations
  • 🎨 Design Suggestions - Pre-built prompts for common design patterns
  • ⚑ Quick Actions - Fast access to frequently used features

πŸ› οΈ Tech Stack

Frontend

  • βš›οΈ React 19 - Latest React with concurrent features
  • ⬛ Next.js 15 - Full-stack React framework with App Router
  • 🎨 Tailwind CSS 4 - Utility-first CSS framework
  • 🧩 Radix UI - Headless, accessible UI components
  • πŸŒ™ Next Themes - Dark/light mode support
  • πŸ“Š Recharts - Beautiful charts and data visualization

Backend & Database

  • 🐘 PostgreSQL - Robust relational database
  • 🟒 Neon - Serverless PostgreSQL platform
  • πŸ—ƒοΈ Drizzle ORM - Type-safe database ORM
  • πŸ”„ Drizzle Kit - Database migrations and introspection

Authentication & Security

  • πŸ” Clerk - Complete authentication solution
  • πŸ”‘ JWT - Secure token-based authentication
  • πŸ›‘οΈ Middleware - Route protection and security

Development Tools

  • πŸ“˜ TypeScript - Type-safe JavaScript
  • πŸ” ESLint - Code linting and formatting
  • 🎯 Axios - HTTP client for API requests
  • πŸŽ‰ Sonner - Beautiful toast notifications
  • πŸ†” UUID - Unique identifier generation

πŸš€ Quick Start

Prerequisites

  • Node.js 18.17 or later
  • npm or yarn or pnpm
  • PostgreSQL database (Neon recommended)
  • Clerk account for authentication

1-Click Deploy

Deploy with Vercel


βš™οΈ Installation

1. Clone the Repository

git clone https://github.com/deekshith-b48/Buildify.git
cd Buildify

2. Install Dependencies

npm install
# or
yarn install
# or
pnpm install

3. Set Up Environment Variables

cp .env.example .env.local

4. Configure Database

# Push database schema
npx drizzle-kit push

5. Start Development Server

npm run dev

Visit http://localhost:3000 to see your application!


πŸ”§ Configuration

Environment Variables

Create a .env.local file in the root directory:

# Database Configuration
DATABASE_URL="postgresql://username:password@host:5432/database?sslmode=require"

# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="pk_test_your_key_here"
CLERK_SECRET_KEY="sk_test_your_key_here"

# Clerk URLs
NEXT_PUBLIC_CLERK_SIGN_IN_URL="/sign-in"
NEXT_PUBLIC_CLERK_SIGN_UP_URL="/sign-up"
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL="/workspace"
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL="/workspace"

Database Setup (Neon)

  1. Create a Neon Account at neon.tech
  2. Create a new project and database
  3. Copy the connection string to your .env.local
  4. Run migrations:
    npx drizzle-kit push

Authentication Setup (Clerk)

  1. Create a Clerk Account at clerk.com
  2. Create a new application
  3. Copy your keys from the API Keys section
  4. Add keys to your .env.local file

πŸ“± Usage

Creating Your First Design

  1. 🏠 Visit the Homepage - Open the application in your browser

  2. ✍️ Describe Your Design - Enter a description in the text area

    Example: "Create a modern dashboard with charts and user metrics"
    
  3. 🎯 Use Quick Suggestions - Or click on pre-made suggestions:

    • πŸ“Š Dashboard
    • πŸ“ SignUp Form
    • 🎭 Hero Section
    • πŸ‘€ User Profile Card
  4. πŸš€ Generate - Click the Generate button to create your design

  5. πŸ‘€ Review - View your generated design in the playground

  6. πŸ’Ό Save - Your project is automatically saved to your workspace

Managing Projects

  • πŸ“‹ Workspace View - Access all your projects from /workspace
  • πŸ’³ Credits System - Monitor your remaining generation credits
  • πŸ—‚οΈ Project Organization - Projects are organized by creation date
  • πŸ”„ Continue Editing - Resume work on any saved project

πŸ—οΈ Project Structure

ai-website-generator/
β”œβ”€β”€ πŸ“ app/                          # Next.js App Router
β”‚   β”œβ”€β”€ πŸ“ _components/              # Shared components
β”‚   β”‚   β”œβ”€β”€ Header.jsx               # Navigation header
β”‚   β”‚   └── Hero.tsx                 # Main hero section
β”‚   β”œβ”€β”€ πŸ“ api/                      # API routes
β”‚   β”‚   β”œβ”€β”€ πŸ“ projects/             # Project management
β”‚   β”‚   └── πŸ“ users/                # User management
β”‚   β”œβ”€β”€ πŸ“ workspace/                # Workspace pages
β”‚   β”‚   β”œβ”€β”€ πŸ“ _components/          # Workspace components
β”‚   β”‚   β”‚   β”œβ”€β”€ AppSidebar.tsx       # Main sidebar
β”‚   β”‚   β”‚   └── AppHeader.tsx        # Workspace header
β”‚   β”‚   β”œβ”€β”€ layout.tsx               # Workspace layout
β”‚   β”‚   └── page.tsx                 # Workspace page
β”‚   β”œβ”€β”€ globals.css                  # Global styles
β”‚   β”œβ”€β”€ layout.tsx                   # Root layout
β”‚   └── page.tsx                     # Homepage
β”œβ”€β”€ πŸ“ components/                   # Reusable UI components
β”‚   └── πŸ“ ui/                       # Shadcn/ui components
β”œβ”€β”€ πŸ“ config/                       # Configuration files
β”‚   └── schema.ts                    # Database schema
β”œβ”€β”€ πŸ“ context/                      # React contexts
β”‚   └── UserDetailContext.tsx        # User state management
β”œβ”€β”€ πŸ“ hooks/                        # Custom React hooks
β”œβ”€β”€ πŸ“ lib/                          # Utility libraries
β”‚   β”œβ”€β”€ drizzle.ts                   # Database connection
β”‚   └── utils.ts                     # Helper functions
β”œβ”€β”€ πŸ“ public/                       # Static assets
└── πŸ“„ Configuration files
    β”œβ”€β”€ tailwind.config.js           # Tailwind configuration
    β”œβ”€β”€ drizzle.config.ts            # Drizzle ORM config
    β”œβ”€β”€ next.config.ts               # Next.js configuration
    └── tsconfig.json                # TypeScript config

πŸ”Œ API Reference

Projects API

Create Project

POST /api/projects

Request Body:

{
  "projectId": "uuid-string",
  "frameId": "unique-frame-id", 
  "messages": [
    {
      "role": "user",
      "content": "Create a modern dashboard"
    }
  ]
}

Response:

{
  "success": true,
  "project": { /* project data */ },
  "frame": { /* frame data */ },
  "chats": [ /* chat history */ ]
}

Users API

Create/Get User

POST /api/users

Response:

{
  "success": true,
  "user": {
    "id": 1,
    "clerkId": "user_xxx",
    "name": "John Doe",
    "email": "john@example.com",
    "credits": 100
  },
  "created": true
}

🎨 UI Components

Built with Radix UI + Tailwind CSS

  • πŸ”² Button - Various button styles and states
  • πŸ“ Input - Form inputs with validation
  • πŸ“Š Progress - Progress bars and indicators
  • 🎭 Avatar - User profile pictures
  • πŸ“‹ Card - Content containers
  • 🎨 Badge - Status and category badges
  • πŸ“± Sidebar - Collapsible navigation
  • πŸ’¬ Toast - Notification system
  • 🎯 Tooltip - Helpful hover information
  • πŸ“Š Charts - Data visualization components

Theme Support

  • πŸŒ™ Dark Mode - Complete dark theme
  • β˜€οΈ Light Mode - Clean light theme
  • 🎨 Custom Themes - Easily customizable

πŸ—„οΈ Database Schema

Tables Overview

-- Users table
CREATE TABLE users (
  id SERIAL PRIMARY KEY,
  clerkId VARCHAR(255) UNIQUE NOT NULL,
  name VARCHAR(255) NOT NULL,
  email VARCHAR(255) UNIQUE NOT NULL,
  credits INTEGER DEFAULT 100,
  createdAt TIMESTAMP DEFAULT NOW()
);

-- Projects table  
CREATE TABLE projects (
  id SERIAL PRIMARY KEY,
  projectId VARCHAR(255) UNIQUE NOT NULL,
  createdBy VARCHAR REFERENCES users(clerkId),
  createdOn TIMESTAMP DEFAULT NOW()
);

-- Frames table
CREATE TABLE frames (
  id SERIAL PRIMARY KEY,
  frameId VARCHAR(255) UNIQUE NOT NULL,
  projectId VARCHAR REFERENCES projects(projectId),
  frameType VARCHAR(255) NOT NULL,
  createdOn TIMESTAMP DEFAULT NOW()
);

-- Chats table
CREATE TABLE chats (
  id SERIAL PRIMARY KEY,
  chatId VARCHAR(255) UNIQUE NOT NULL,
  chatMessage JSON,
  createdBy VARCHAR REFERENCES users(clerkId),
  createdOn TIMESTAMP DEFAULT NOW()
);

Relationships

  • Users β†’ Projects (One-to-Many)
  • Projects β†’ Frames (One-to-Many)
  • Users β†’ Chats (One-to-Many)

πŸ” Authentication

Clerk Integration

This application uses Clerk for authentication with the following features:

  • πŸ”‘ Multiple Sign-in Options - Email, Google, GitHub, etc.
  • πŸ‘€ User Management - Complete user profile management
  • πŸ›‘οΈ Route Protection - Automatic route protection
  • πŸ“± Responsive Auth UI - Mobile-friendly auth components
  • πŸ”„ Session Management - Automatic session handling

Protected Routes

  • /workspace - Requires authentication
  • /api/projects - Requires authentication
  • /api/users - Requires authentication

Middleware Protection

// middleware.ts
export default clerkMiddleware(async (auth, req) => {
  if (isProtectedRoute(req)) {
    await auth.protect()
  }
})

🌍 Environment Variables

Variable Description Required Example
DATABASE_URL PostgreSQL connection string βœ… postgresql://user:pass@host/db
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY Clerk publishable key βœ… pk_test_xxx
CLERK_SECRET_KEY Clerk secret key βœ… sk_test_xxx
NEXT_PUBLIC_CLERK_SIGN_IN_URL Sign in page URL βœ… /sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL Sign up page URL βœ… /sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL Redirect after sign in βœ… /workspace
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL Redirect after sign up βœ… /workspace

🀝 Contributing

We love contributions! Here's how you can help:

Getting Started

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch
    git checkout -b feature/amazing-feature
  3. πŸ’Ύ Commit your changes
    git commit -m 'Add some amazing feature'
  4. πŸ“€ Push to the branch
    git push origin feature/amazing-feature
  5. πŸ”„ Open a Pull Request

Development Guidelines

  • βœ… Follow TypeScript best practices
  • 🎨 Use Tailwind CSS for styling
  • πŸ§ͺ Add tests for new features
  • πŸ“ Update documentation
  • πŸ” Ensure code passes ESLint

Code Style

# Run linting
npm run lint

# Format code  
npm run format

# Type checking
npm run type-check

πŸ“Š Roadmap

🎯 Upcoming Features

  • πŸ€– Advanced AI Models - Integration with GPT-4 and Claude
  • 🎨 Design Templates - Pre-built industry templates
  • πŸ”„ Version Control - Git-like versioning for designs
  • πŸ‘₯ Team Collaboration - Multi-user project collaboration
  • πŸ“± Mobile App - Native mobile application
  • 🎯 A/B Testing - Built-in A/B testing tools
  • πŸ“Š Analytics - Design performance analytics
  • 🌐 Multi-language - Internationalization support

πŸ› Issues & Support

Reporting Issues

Found a bug? Please report it:

  1. πŸ” Check existing issues first
  2. πŸ“ Create detailed bug report
  3. 🏷️ Use appropriate labels
  4. πŸ“Έ Include screenshots if applicable

Getting Help

  • πŸ“– Documentation - Check this README first
  • πŸ’¬ Discussions - Join community discussions
  • πŸ“§ Email - Contact support team

πŸ“„ License

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


πŸ™ Acknowledgments

Built With Love Using

  • βš›οΈ React Team - For the amazing React framework
  • ⬛ Vercel - For Next.js and hosting platform
  • 🎨 Tailwind Labs - For the beautiful Tailwind CSS
  • πŸ” Clerk - For seamless authentication
  • 🐘 Neon - For serverless PostgreSQL
  • πŸ—ƒοΈ Drizzle Team - For type-safe ORM

Special Thanks

  • 🌟 Contributors - All the amazing contributors
  • πŸ› Bug Reporters - Helping improve the application
  • πŸ’‘ Feature Requesters - Driving innovation
  • πŸ“ Documentation Writers - Making it accessible

⭐ Star this repository if it helped you!

Made with ❀️ by Deekshith B

🌟 Star β€’ 🍴 Fork β€’ πŸ“ Issues β€’ πŸ”„ Pull Requests

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors