This guide will help you set up Supabase authentication and database for the Inquizzitive quiz application.
- Node.js and npm installed
- A Supabase account (sign up at https://supabase.com)
- Go to https://supabase.com and sign in
- Click "New Project"
- Choose your organization
- Enter project name:
inquizzitive - Enter a strong database password
- Choose a region close to your users
- Click "Create new project"
- In your Supabase dashboard, go to Settings > API
- Copy the following values:
- Project URL
- Project API Key (anon public)
- DB Connection URI from Supabase > Project > Settings > Database > Connection Info
Your .env file should already contain:
VITE_SUPABASE_URL=https://xyz.supabase.co
VITE_SUPABASE_ANON_KEY=.....
DB_URI=
If you need to update these values with your own Supabase project:
- Replace
VITE_SUPABASE_URLwith your Project URL - Replace
VITE_SUPABASE_ANON_KEYwith your anon public key - Replace
DB_URIwith your DB URI
- Hit the command:
npm run initial-db-setup
This will create the required schemas
- In your Supabase dashboard, go to Authentication > Settings
- Under "Site URL", add your local development URL:
http://localhost:5173 - Under "Redirect URLs", add:
http://localhost:5173 - Enable email confirmations if desired (optional for development)
- Start your development server by hitting the below command in separate terminal:
npm run client
npm run server-
Open your browser and navigate to
http://localhost:5173 -
Test the authentication:
- Click "Sign In" button
- Try creating a new account
- Verify email confirmation
- Sign in with your credentials
-
Test quiz functionality:
- Take a quiz while signed in
- Check that the quiz results are saved to your database
- Verify in Supabase dashboard under Database > Tables > quiz_history