- A Supabase account (https://supabase.com)
- Node.js installed
- Go to https://supabase.com and sign in
- Click "New Project"
- Fill in:
- Name: DealFlow-AI
- Database Password: (choose a strong password)
- Region: (choose closest to your users)
- Wait for project to be created
- In your Supabase project dashboard, go to Settings → API
- Copy the following:
- Project URL (under "Project URL")
- anon/public key (under "Project API keys" → "anon public")
-
In the
frontenddirectory, create a.env.localfile:cp .env.local.example .env.local
-
Edit
.env.localand add your Supabase credentials:NEXT_PUBLIC_SUPABASE_URL=https://your-project-ref.supabase.co NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key-here NEXT_PUBLIC_API_URL=http://localhost:8000
- In Supabase dashboard, go to SQL Editor
- Click "New Query"
- Copy the contents of
supabase_schema.sqlfrom the project root - Paste into the SQL editor
- Click "Run" to execute the schema
This will create:
user_profilestable- Row Level Security policies
- Indexes for performance
- In Supabase dashboard, go to Authentication → Providers
- Find "Google" in the list and click on it
- Enable the provider
- You'll need to set up Google OAuth credentials:
- Go to Google Cloud Console
- Create a new project or select existing one
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- Configure consent screen if not done already
- Choose Web application
- Add authorized redirect URIs:
https://your-project-ref.supabase.co/auth/v1/callback - Copy the Client ID and Client Secret
- Paste Google Client ID in Supabase
- Paste Google Client Secret in Supabase
- Click "Save"
cd frontend
npm installnpm run devVisit http://localhost:3000/login to test the authentication.
- Go to
/login - Select your role (Founder or Investor)
- Click "Continue with Google"
- Authorize with your Google account
- You'll be redirected back and logged in
- Your role is locked to your account
- Check "Remember me for 30 days" to stay logged in
- Once a user selects a role (founder/investor) and signs in, that role is permanently assigned to their account
- Users cannot switch between roles without creating a new account
- This is enforced in the database and auth callback
- When enabled, users stay logged in for 30 days
- The expiry is stored in the
remember_me_expirescolumn - On each app load, the system checks if remember me is still valid
- If expired or not set, users must log in again
- Row Level Security (RLS) is enabled on user_profiles table
- Users can only access their own profile data
- Auth tokens are stored securely in localStorage
- Sessions are validated on the server side
- Check that the SQL schema was run successfully
- Verify RLS policies are enabled
- Check Supabase logs in dashboard
- Verify redirect URI matches exactly in Google Console
- Check that Google OAuth is enabled in Supabase
- Ensure client ID and secret are correct
- This means the user already has an account with a different role
- They need to sign out and create a new account or use a different email
- Check if remember me was enabled during login
- Verify
remember_me_expiresis set in database - Check browser console for errors