Start the Application ​
1. Start Backend (Terminal 1) ​
bash
cd g:\projects\tendsocial\apps\api
npm run dev✅ Backend should start on http://localhost:4000
2. Start Frontend (Terminal 2) ​
bash
cd g:\projects\tendsocial\apps\web
npm run dev✅ Frontend should start on http://localhost:5173 (or http://localhost:3000)
Test OAuth Flow ​
Open Browser
- Navigate to http://localhost:5173
- Open DevTools Console (F12) to watch for errors
Clear Previous Session
javascript// Run in browser console localStorage.clear(); location.reload();Login with Google
- Click "Get Started" or "Login"
- Click "Continue with Google"
- Select your Google account (marc.montecalvo@gmail.com)
- Grant permissions
Complete Onboarding
- Should see onboarding modal
- Enter company name (e.g., "TendSocial Inc")
- Enter your first/last name (optional)
- Click "Complete Setup"
Verify Success
- Should see the main app interface
- Top right should show your user info
- Refresh page - should stay logged in
View Database ​
bash
cd g:\projects\tendsocial\apps\api
# Set environment variable
$env:DATABASE_URL="postgresql://neondb_owner:npg_Qbx8ezZRFlk1@ep-broad-bird-aed9yqxq-pooler.c-2.us-east-2.aws.neon.tech/neondb?sslmode=require&channel_binding=require"
# Open Prisma Studio
pnpm exec prisma studio -- config=./prisma/prisma.config.tsOpens at http://localhost:5555
Check:
- ✅
Companytable has your company - ✅
Usertable has your user with correctsupabaseId
Expected Backend Logs ​
When auth is working correctly, you should see:
[info] GET /api/auth/me 200
[info] User lookup: supabaseId=51959998-85de-4710-9a2d-05f130022b807Or for new users:
[info] GET /api/auth/me 404
[info] POST /api/auth/onboarding 201
[info] Created company: TendSocial Inc
[info] Created user: marc.montecalvo@gmail.comTroubleshooting ​
Backend Won't Start ​
- Check that port 4000 is available
- Verify
.envfile exists with DATABASE_URL - Run
npm installif packages are missing
Frontend Won't Start ​
- Check that port 5173 is available
- Verify
apps/frontend/.envhasVITE_SUPABASE_URLandVITE_SUPABASE_PUBLISHABLE_KEY - Run
npm installif packages are missing
OAuth Redirects to URL with Tokens But Nothing Happens ​
- Check browser console for errors
- Verify frontend is calling
/api/auth/me - Check backend logs for the API call
- Ensure
SUPABASE_ANON_KEYis set in backend.env
Onboarding Modal Doesn't Appear ​
- Check that
/api/auth/meis returning 404 for new users - Verify the
needsOnboardingstate is being set - Check browser console for React errors
"User already onboarded" Error (409) ​
This means the user already exists. To reset:
- Open Prisma Studio
- Delete the user from
Usertable - Delete the company from
Companytable - Try OAuth flow again
Quick Commands Reference ​
bash
# Backend
cd apps/backend
npm run dev # Start dev server
npm run generate # Regenerate Prisma Client
npm run lint # Type check
# Frontend
cd apps/frontend
npm run dev # Start dev server
npm run build # Build for production
npm run lint # Run linter
# Database
cd apps/backend
pnpm exec prisma studio --config=./prisma/prisma.config.ts # Open GUI
pnpm exec prisma db push --config=./prisma/prisma.config.ts # Push schema changesSuccess Criteria ​
- ✅ User can click "Continue with Google"
- ✅ Google OAuth completes successfully
- ✅ Onboarding modal appears for new users
- ✅ User can enter company name and complete setup
- ✅ User is redirected to main app
- ✅ Session persists on page refresh
- ✅ Database has Company and User records
- ✅ User can logout and login again
If all the above work, OAuth login is fully functional! 🎉