An opinionated starter kit for building ChaiBuilder apps with Next.js (App Router) and Supabase.
⚡️ Fully Online Setup: You can complete the entire deployment process in your browser. No local environment or coding is required to get your site live.
Gather these from your Supabase Dashboard before clicking deploy.
- Create a new project and save your Database Password immediately. Supabase only shows this once.
- Schema: Run the DB Schema SQL in the SQL Editor.
- User: Go to Authentication > Add User. Note the Email/Password for login and copy the generated User ID.
- App Key: Run the App Key Script in the SQL Editor.
- Note: Replace
YOUR_USER_IDwith the ID from the previous step before running. - Copy the generated App Key.
- Note: Replace
- Go to Storage in your Supabase project.
- Create a new bucket named
dam-assets. - Set the bucket to Public.
💡 The "Connect" button is located in the top bar of the Supabase dashboard.
| Variable | Location |
|---|---|
NEXT_PUBLIC_SUPABASE_URL |
Connect > App Frameworks |
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY |
Connect > App Frameworks |
SUPABASE_SECRET_KEY |
Project Settings > API Keys > Secret keys Section |
CHAIBUILDER_DATABASE_URL |
Connect > ORMs > Drizzle (Replace [YOUR-PASSWORD] with your DB password. Copy without quotes.) |
CHAIBUILDER_APP_KEY |
Result from Step B.3 |
Click the button below and paste the variables collected above into the Vercel deployment form:
Navigate to /editor on your deployed URL and log in with the email/password you created in Step B.2.
If you prefer to develop or customize the starter kit locally:
- Clone the repository:
git clone https://github.com/chaibuilder/chaibuilder-next-supabase-starter.git
- Set Environment Variables: Create a .env file in the root and add the keys collected in Step 1.D.
- Install & Run:
npm install
npm run dev- Access the local editor at http://localhost:3000/editor.
To enable AI-powered features (UI generation, SEO, and translation), add your Vercel AI Gateway API key to your environment variables:
Code snippet
AI_GATEWAY_API_KEY=your-vercel-ai-gateway-key💡 Get your Vercel AI Gateway key from the Vercel Dashboard.
- Database: PostgreSQL (Supabase)
- Auth: Supabase Auth
- Storage: Supabase Storage
- Realtime: Supabase Realtime (for multi-user with page lock)
💡 Multi-site support: You can run unlimited sites on the same database instance. No need to create separate databases for each site.
- Missing environment variables: Ensure
.envexists and contains the Supabase keys before starting the dev server. - Authentication errors: Confirm the admin user exists and you copied the correct UUID.
- Database connection issues: Reset the database password in Supabase and update
CHAIBUILDER_DATABASE_URLaccordingly. - Do not have access to edit website: Ensure the records in
app_userstable have the correct entry foruserandappcolumns.
Happy building! ☕️