Docs/Supabase

Supabase

Connect a database, authentication, file storage, and real-time features to your Codunk app.

Why Supabase?

Codunk can build the frontend and preview of a SaaS, marketplace, dashboard, or internal tool without Supabase connected. If your app needs real user accounts, database persistence, file uploads, SQL migrations, or real-time updates, Supabase provides the backend.

When Supabase is connected, Codunk can generate working backend code — authentication forms, database queries, file upload components, SQL migrations, and real-time subscriptions — against your own project.

Supabase is optional. If it is not connected, Codunk should still create a high-quality working preview with mock data and tell you what to connect later for production.

Step 1: Create a Supabase project

  1. Go to supabase.com and create a free account.
  2. Click "New project" and choose a name and password.
  3. Wait about 2 minutes for the project to be provisioned.

Step 2: Get your API keys

  1. In your Supabase dashboard, go to Settings → API.
  2. Copy the Project URL (looks like https://xxxxx.supabase.co).
  3. Copy the anon public key (the long string starting with eyJhbG...).

⚠️ Use the anon key, not the service_role key. The anon key is safe to use in the browser. The service_role key bypasses Row Level Security and should never be exposed.

Step 3: Connect in Codunk

  1. In the Codunk Studio, click Integrations in the top bar.
  2. Click Supabase.
  3. Connect with Supabase OAuth, or use the manual API keys fallback.
  4. Select the Supabase project Codunk should use. A green checkmark confirms the connection.

What the AI can generate

🔐 Authentication

Sign up, sign in, password reset, protected pages, user profiles.

🗄️ Database

CRUD operations, data tables, filters, pagination, real-time updates.

📁 Storage

File uploads, image galleries, drag-and-drop, public URLs.

⚡ Realtime

Live data sync, chat apps, notifications, collaborative features.

Example: Todo app

With Supabase connected, try this prompt:

Build a todo app with user authentication. Users can sign up, log in, and manage their own todos. Each todo has a title, description, and completed status. Include a dashboard showing stats.

The AI will generate a complete app with sign-up forms, login pages, a todo CRUD interface, and real database queries — all connected to your Supabase project.

When OAuth is connected, Codunk can run the SQL migrations for you. With manual keys, it will provide the exact SQL to run in your Supabase dashboard.

Next steps