While JustCopy.ai comes with a powerful built-in database, some developers prefer using Supabase for additional flexibility, real-time features, or to leverage their existing Supabase infrastructure. This guide walks you through the complete integration process.
JustCopy.ai provides everything you need to build and deploy applications, including a built-in database. However, integrating Supabase offers additional benefits for specific use cases:
Get instant updates across all connected clients without polling. Perfect for chat apps, live dashboards, and collaborative tools.
Access the full power of PostgreSQL including advanced queries, stored procedures, triggers, and extensions like PostGIS.
Fine-grained access control at the database level. Define who can read, write, or delete specific rows based on user identity.
Run serverless TypeScript functions globally. Great for webhooks, custom APIs, and background processing.
Complete authentication system with 20+ OAuth providers, magic links, phone auth, and MFA out of the box.
S3-compatible object storage for files, images, and videos with automatic CDN distribution and transformations.
Note: If you do not need these specific features, the JustCopy.ai built-in database is simpler to use and requires no additional setup. Choose Supabase when you need real-time capabilities, complex PostgreSQL features, or want to use an existing Supabase project.
Combining JustCopy.ai rapid development with Supabase backend capabilities enables you to build sophisticated applications:
Project management tools, CRM systems, analytics dashboards, team collaboration platforms
Chat applications, live notifications, collaborative editors, multiplayer games
E-commerce stores, booking platforms, service marketplaces, auction sites
Community forums, social networks, content sharing apps, review platforms
Admin dashboards, inventory management, employee portals, reporting systems
Blogs with comments, news aggregators, documentation sites, learning management systems
Sign up for Supabase and create a new project with your desired region and database settings
Instructions:
Locate your Supabase project URL and anon/service role keys from the project settings
Where to find your keys:
Security Note: Never expose your service_role key in client-side code. Use it only in server-side functions or Edge Functions.
Add your Supabase credentials to your JustCopy.ai project configuration
Configuration:
# Environment Variables
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Create your database schema using Supabase Table Editor or SQL commands
Creating tables:
-- Example: Create a tasks table
CREATE TABLE tasks (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
user_id UUID REFERENCES auth.users(id),
title TEXT NOT NULL,
completed BOOLEAN DEFAULT false,
created_at TIMESTAMPTZ DEFAULT now()
);
Configure Supabase Auth with email/password, OAuth providers, or magic links
Authentication setup:
// Sign up a new user
const { data, error } = await supabase.auth.signUp({
email: 'user@example.com',
password: 'secure-password'
});
// Sign in with OAuth
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'google'
});
Verify your integration by performing CRUD operations and testing auth flows
Testing your connection:
// Test CRUD operations
// Create
const { data } = await supabase.from('tasks').insert({ title: 'Test task' });
// Read
const { data } = await supabase.from('tasks').select('*');
// Update
const { data } = await supabase.from('tasks').update({ completed: true }).eq('id', taskId);
// Delete
const { data } = await supabase.from('tasks').delete().eq('id', taskId);
Let us put it all together by building a simple task manager with user authentication and real-time updates.
-- Users table is handled by Supabase Auth
-- Create tasks table
CREATE TABLE tasks (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
title TEXT NOT NULL,
description TEXT,
completed BOOLEAN DEFAULT false,
due_date DATE,
created_at TIMESTAMPTZ DEFAULT now(),
updated_at TIMESTAMPTZ DEFAULT now()
);
-- Enable RLS
ALTER TABLE tasks ENABLE ROW LEVEL SECURITY;
-- Users can only see their own tasks
CREATE POLICY "Users can view own tasks"
ON tasks FOR SELECT
USING (auth.uid() = user_id);
-- Users can insert their own tasks
CREATE POLICY "Users can create tasks"
ON tasks FOR INSERT
WITH CHECK (auth.uid() = user_id);
// Subscribe to real-time updates
const channel = supabase
.channel('tasks-channel')
.on('postgres_changes', {
event: '*',
schema: 'public',
table: 'tasks'
}, (payload) => {
console.log('Change received:', payload);
// Update your UI here
})
.subscribe();
Ask JustCopy.ai to "Create a task manager with Supabase integration" and it will generate the complete UI with authentication, CRUD operations, and real-time updates.
Features included:
Once you have the basic integration working, explore these advanced Supabase features:
Deploy serverless TypeScript functions that run close to your users. Use them for webhooks, scheduled tasks, or custom API endpoints.
// Deploy with: supabase functions deploy my-function
export async function handler(req: Request) {
return new Response(JSON.stringify({ success: true }));
}Upload files and images with automatic CDN distribution. Apply real-time transformations for thumbnails and responsive images.
const { data } = await supabase.storage
.from("avatars")
.upload("user-123.jpg", file);
// Get transformed image
const url = supabase.storage
.from("avatars")
.getPublicUrl("user-123.jpg", {
transform: { width: 200, height: 200 }
});Create PostgreSQL functions for complex business logic. Call them from your app like regular API endpoints.
-- Create a function
CREATE FUNCTION get_user_stats(user_uuid UUID)
RETURNS TABLE (total_tasks INT, completed INT) AS $$
SELECT COUNT(*), COUNT(*) FILTER (WHERE completed)
FROM tasks WHERE user_id = user_uuid;
$$ LANGUAGE SQL;
// Call from app
const { data } = await supabase.rpc("get_user_stats", {
user_uuid: userId
});Track online users and their state in real-time. Perfect for collaborative features, typing indicators, or live cursors.
const channel = supabase.channel("room-1");
channel.on("presence", { event: "sync" }, () => {
const state = channel.presenceState();
console.log("Online users:", state);
});
channel.subscribe(async (status) => {
if (status === "SUBSCRIBED") {
await channel.track({ user: "user-123", online_at: new Date() });
}
});Verify your SUPABASE_URL is correct and includes the https:// prefix. Check if your IP is allowlisted in Supabase settings if you have IP restrictions enabled.
Ensure your Site URL and Redirect URLs are configured correctly in Supabase Auth settings. For OAuth providers, verify the callback URL matches exactly.
Check your RLS policies in the Supabase dashboard. Use the SQL editor to test queries with auth.uid() to debug. Make sure users are authenticated before making requests.
Enable Realtime for your table in Supabase dashboard (Database > Replication). Verify your subscription filter matches the changes you are making.
Supabase handles CORS automatically. If you see CORS errors, check that your request URL is correct and you are using the anon key for client-side requests.
Add indexes to columns used in WHERE clauses. Use the Supabase Query Performance dashboard to identify slow queries. Consider using database functions for complex operations.
Yes, JustCopy.ai includes a built-in database for your applications. Supabase integration is optional and provides additional flexibility for users who prefer to manage their own database infrastructure or need specific Supabase features like real-time subscriptions.
Supabase offers a generous free tier that includes 500MB database storage, 1GB file storage, 50,000 monthly active users, and unlimited API requests. This is sufficient for most projects built with JustCopy.ai.
Absolutely! Once connected, you can leverage Supabase real-time subscriptions for live updates, presence detection, and broadcast messaging in your JustCopy.ai applications.
You configure RLS policies directly in Supabase. JustCopy.ai respects these policies when making database queries. We recommend enabling RLS on all tables and creating appropriate policies for your use case.
Yes, you can export your data from JustCopy.ai built-in database and import it into Supabase. We provide export tools in CSV and JSON formats for easy migration.
Supabase supports email/password, magic links, phone auth, and OAuth providers including Google, GitHub, Discord, Twitter, Facebook, Apple, and many more. All of these work seamlessly with JustCopy.ai.
Yes. Supabase uses enterprise-grade security with SSL encryption, SOC2 Type 2 compliance, and runs on AWS infrastructure. Combined with Row Level Security policies, your data is well-protected.
Yes, Supabase Edge Functions can be called from your JustCopy.ai application for serverless backend logic. This is useful for custom business logic, third-party API integrations, and scheduled tasks.
Combine the rapid development power of JustCopy.ai with the flexibility of Supabase to build production-ready full-stack applications.