Airsc is free for everyone. If it helps you, support it with $2–$20.

Support
Cursor ruleSafeBuilding web & mobile appsBeginner friendly

lovable-boilerplate

chihebnabil · chihebnabil/lovable-boilerplate

This React boilerplate is inspired by Lovable AI's no-code generation, providing a clean, customizable codebase structured for seamless integration with GitHub Copilot and other AI coding assistants.

A Lovable-inspired React boilerplate that brings no-code AI UI generation into clean code. Fully open, customizable, and structured to work seamlessly with GitHub Copilot

65 stars30License: MITUpdated 3 months ago0 opens

Preview

▍

What you can do with it

  • Quickly start a new React project with a modern tech stack and AI coding assistant integration.
  • Generate UI components with shadcn/ui and Tailwind CSS using AI prompts.
  • Extend a no-code AI-generated app with custom code and developer control.

Safety check

Safe

No risky patterns found in the files we scanned.

Automated scan of the repo files. Always review code you run.

From the README

Lovable Boilerplate

Reverse-engineered Lovable AI app builder turned into a developer-friendly React boilerplate with comprehensive AI coding assistant instructions.

One-Click Setup

What is this?

This boilerplate reverse-engineers the magic behind Lovable's no-code AI app builder into a traditional React codebase that developers can understand, modify, and extend. It bridges the gap between no-code AI generation and developer control.

💡 Built something with Lovable or using this boilerplate?
Upgrade to a fullstack Next.js app in minutes with NextLovable.com
Get production-ready performance, better SEO, and full control.

Tech Stack

TechnologyPurposeVersion
ReactUI Library19.2.0
TypeScriptType Safety5.9.3
ViteBuild Tool7.1.12
shadcn/uiComponent LibraryLatest
Tailwind CSSStyling3.4.18
React RouterNavigation7.9.5
TanStack QueryData Fetching5.90.6
React Hook FormForm Handling7.66.0
ZodSchema Validation4.1.12
SupabaseBackend & Database2.80.0

Features

  • ⚡ Lightning Fast Development with Vite and React 19
  • 🎨 40+ Pre-built Components from shadcn/ui
  • 🎯 Type-Safe with TypeScript 5.9
  • 🗄️ Backend Ready with Supabase integration
  • 📱 Responsive Design with Tailwind CSS
  • 🔄 Smart Data Fetching with TanStack Query
  • 📋 Form Validation with React Hook Form + Zod
  • 🤖 AI-Optimized with comprehensive coding instructions

Getting Started

Prerequisites

  • Node.js 18+ or Bun
  • Git

Installation

# Clone the repository
git clone https://github.com/chihebnabil/lovable-boilerplate.git
cd lovable-boilerplate

# Install dependencies (npm, yarn, or bun)
npm install
# or
bun install

# Set up environment variables
cp .env.example .env
# Edit .env with your Supabase credentials

# Start development server
npm run dev
# or
bun dev

Your app will be running at http://localhost:8080

Supabase Integration

This boilerplate comes with Supabase pre-configured for backend functionality including authentication, database, and real-time features.

Setup Supabase

  1. Create a Supabase Project

    • Visit supabase.com and create a new project
    • Wait for your database to be provisioned
  2. Configure Environment Variables

    cp .env.example .env
    

    Add your Supabase credentials to .env:

    VITE_SUPABASE_URL=https://your-project.supabase.co
    VITE_SUPABASE_PUBLISHABLE_KEY=your-anon-key
    

Using Supabase in Your App

// Import the Supabase client
import { supabase } from "@/integrations/supabase/client";
import type { Tables } from "@/integrations/supabase/types";

// Example: Fetch data
const { data, error } = await supabase
  .from('posts')
  .select('*')
  .eq('published', true);

// Example: Insert data
const { data, error } = await supabase
  .from('posts')
  .insert({
    title: 'My Post',
    slug: 'my-post',
    content: 'Post content',
    user_id: userId
  });

// Example: Real-time subscription
supabase
  .channel('posts')
  .on('postgres_changes', 
    { event: '*', schema: 'public', table: 'posts' },
    (payload) => {
      console.log('Change received!', payload);
    }
  )
  .subscribe();

Type Safety

All database types are automatically generated in src/integrations/supabase/types.ts:

import type { Tables, TablesInsert, TablesUpdate } from "@/integrations/supabase/types";

// Use generated types
type Post = Tables<'posts'>;
type NewPost = TablesInsert<'posts'>;
type UpdatePost = TablesUpdate<'posts'>;

Authentication Example

// Sign up
const { data, error } = await supabase.auth.signUp({
  email: 'user@example.com',
  password: 'password'
});

// Sign in
const { data, error } = await supabase.auth.signInWithPassword({
  email: 'user@example.com',
  password: 'password'
});

// Get current user
const { data: { user } } = await supabase.auth.getUser();

// Sign out
await supabase.auth.signOut();

Best Practices

  • Environment Variables: Never commit .env files. Use .env.example as a template
  • Row Level Security: Enable RLS on your Supabase tables for security
  • Type Generation: Regenerate types when your database schema changes
  • Error Handling: Always handle errors from Supabase operations
  • Real-time: Use Supabase real-time for live updates without polling

Local Development with Supabase CLI

The boilerplate includes Supabase CLI configuration for local development:

# Initialize Supabase (already done)
npx supabase init

# Start Supabase locally (requires Docker)
npx supabase start

# Stop local Supabase
npx supabase stop

# Generate TypeScript types from your database
npx supabase gen types typescript --local > src/integrations/supabase/types.ts

# Create a new migration
npx supabase migration new migration_name

# Push migrations to remote database
npx supabase db push

The supabase/ folder contains:

  • config.toml: Supabase CLI configuration
  • migrations/: Database migration files (version-controlled SQL)
  • .gitignore: Excludes temporary files from version control

AI Coding Assistant Instructions

This boilerplate is optimized for AI coding assistants like GitHub Copilot and Cursor. All comprehensive instructions are located in:

.github/instructions/global.instructions.md

These instructions include:

  • Modern Design Guidelines - Create premium, contemporary interfaces
  • Architecture Patterns - Project structure and best practices
  • Component Usage - How to use shadcn/ui components effectively
  • Development Workflow - Adding features, pages, and functionality
  • Styling System - Color palettes, spacing, typography, and a
View source on GitHub