This guide will help you set up Google Sign-In for your Drag & Drop Lists app.
- Go to Google Cloud Console
- Click "Select a Project" → "New Project"
- Enter project name:
Drag Drop Lists(or your choice) - Click "Create"
- In your project, go to "APIs & Services" → "Library"
- Search for "Google+ API"
- Click on it and click "Enable"
- Go to "APIs & Services" → "OAuth consent screen"
- Select "External" (unless you have a Google Workspace)
- Click "Create"
- App name:
Drag & Drop Lists - User support email: Your email
- App logo: (optional)
- App domain: (leave blank for now, add later when deployed)
- Developer contact: Your email
- Click "Save and Continue"
- Scopes: Click "Save and Continue" (no additional scopes needed)
- Test users: Add your Gmail address for testing
- Click "Save and Continue"
- Review and click "Back to Dashboard"
- Go to "APIs & Services" → "Credentials"
- Click "Create Credentials" → "OAuth client ID"
- Select "Web application"
Name: Drag Drop Lists Web Client
Authorized JavaScript origins:
- For local development:
http://localhost:5173 - For production (Vercel):
https://your-app.vercel.app
Authorized redirect URIs:
- For local:
http://localhost:5173 - For production:
https://your-app.vercel.app
- Click "Create"
- COPY YOUR CLIENT ID - it will look like:
123456789-abc123def456.apps.googleusercontent.com
- Create a
.envfile in thefrontend/directory:
cd frontend
cp .env.example .env- Edit
.envand add your Client ID:
VITE_GOOGLE_CLIENT_ID=YOUR_CLIENT_ID_HERE.apps.googleusercontent.com
VITE_API_URL=http://localhost:4000/api- In Vercel dashboard, go to your project settings
- Navigate to "Environment Variables"
- Add:
- Name:
VITE_GOOGLE_CLIENT_ID - Value: Your Google Client ID
- Name:
VITE_API_URL - Value: Your backend API URL (e.g.,
https://your-backend.herokuapp.com/api)
- Name:
After deploying to Vercel:
- Go back to Google Cloud Console
- "APIs & Services" → "Credentials"
- Click on your OAuth 2.0 Client ID
- Add your Vercel URL to:
- Authorized JavaScript origins:
https://your-app.vercel.app - Authorized redirect URIs:
https://your-app.vercel.app
- Authorized JavaScript origins:
- Click "Save"
-
Start your backend:
cd backend && npm run dev
-
Start your frontend:
cd frontend && npm run dev
-
Open
http://localhost:5173 -
You should see a "Sign in with Google" button
-
Click it and sign in
-
Your profile picture and name should appear
-
You can now save/load lists to the server!
- Make sure your Client ID is correct in
.env - Restart the dev server after adding
.env
- Make sure
http://localhost:5173is in Authorized redirect URIs - Check for typos (http vs https, port number)
- Check browser console for errors
- Make sure
.envfile exists and has the correct variable name - Restart the dev server
- Add your email to Test users in OAuth consent screen
- Make sure the app is in "Testing" mode
- Never commit
.envto Git (it's in.gitignore) - Keep your Client ID safe (it's not a secret, but don't abuse it)
- The OAuth token is stored in localStorage
- Each user's data is stored separately on the backend
- User clicks "Sign in with Google"
- Google popup appears for authentication
- User grants permission
- App receives a JWT token with user info
- Token is sent with each API request
- Backend stores data in
user_{googleId}.json - Each user only sees their own lists
You're all set! Users can now sign in and have their own private lists! 🎉