Firebase Setup
Firebase is another popular backend option with a different approach.
Supabase is an open-source Firebase alternative built on PostgreSQL. It provides a database, authentication, file storage, and real-time subscriptions. If your app needs a backend — user accounts, data persistence, file uploads — Supabase is a solid choice.
Create a Supabase project
Sign up at supabase.com and create a new project. Pick a region close to your users and set a database password.
Copy your credentials
Go to Settings → API in your Supabase dashboard. Copy the Project URL and the anon key (the public API key).
Tell Primio to set up Supabase
In the chat, send: “Set up Supabase with this URL: [your-project-url] and anon key: [your-anon-key]”
The AI will add the Supabase Flutter package, configure the client, and initialize it in your app.
Once Supabase is set up, you can add authentication. Ask Primio for the login method you need:
Supabase uses PostgreSQL’s Row Level Security to control who can read and write data. When the AI sets up auth, it should also create appropriate RLS policies on your tables.
You can be explicit about this: “Only let users read and update their own profile data” or “Make the recipes table readable by everyone but only writable by the author.”
If you skip RLS, your tables may be accessible to anyone with your anon key. Always verify that RLS is enabled on tables that contain user data.
Supabase gives you a full PostgreSQL database. You create tables in the Supabase dashboard (not in Primio), then ask Primio to connect your app to them via Supabase’s API.
Step 1: Create tables in Supabase
Go to your Supabase dashboard → Table Editor and create the tables you need. For example, a recipes table with columns: id, title, description, image_url, user_id, created_at.
Step 2: Ask Primio to connect
recipes table and display all recipes on the home screen in a grid”The AI writes the Dart code to call Supabase’s REST API — fetching, creating, updating, and deleting rows.
Supabase Storage lets users upload and retrieve files. Common uses:
Set up services incrementally. Start with the Supabase client configuration, then add auth, then database, then storage. Test each piece before moving on.
Be specific about table structure. Give the AI exact column names and types. Vague requests like “add a database” produce generic results.
Check your RLS policies. After the AI creates tables, verify in the Supabase dashboard that RLS is enabled and the policies make sense. This is a security concern — don’t skip it.
Firebase Setup
Firebase is another popular backend option with a different approach.
REST APIs
Connect to any REST API — your own backend, third-party services, or public data sources.