Prerequisites
Before you begin, ensure you have:- Node.js 16.x or higher
- MongoDB (local or Atlas account)
- Google Cloud Console account (for OAuth)
- Git
Setup Steps
Set Up Google OAuth
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google+ API
- Navigate to Credentials → Create Credentials → OAuth client ID
- Configure the OAuth consent screen
- Set Authorized JavaScript origins:
http://localhost:5173 - Set Authorized redirect URIs:
http://localhost:5173 - Copy your Client ID for the next step
Save your Google Client ID - you’ll need it for environment configuration.
Configure Environment Variables
Create Frontend (
.env files in both backend and frontend directories:Backend (backend/.env):frontend/.env):Start MongoDB
If you’re running MongoDB locally:Alternatively, use MongoDB Atlas and update your
Terminal
MONGODB_URI accordingly.Verify Your Setup
- Frontend: Open
http://localhost:5173- you should see the MeetMates landing page - Backend: Check
http://localhost:3001- the server should be running - Database: Verify MongoDB is connected (check backend console output)
Test the Application
Sign in with Google
Sign in with Google
- Click the Sign in with Google button
- Select your Google account
- Grant the requested permissions
- You should be redirected to the main chat interface
Start a video chat
Start a video chat
- After signing in, click Start Chat
- Enable camera and microphone permissions
- You’ll enter the waiting room
- Open a second browser window (or incognito tab) and repeat
- Both users should be matched and connected
Common Issues
CORS Errors
CORS Errors
If you see CORS errors in the browser console:
- Verify
CORS_ORIGINinbackend/.envmatches your frontend URL - Restart the backend server after changing environment variables
Socket.IO Connection Failed
Socket.IO Connection Failed
If Socket.IO connection fails:
- Check that
VITE_BACKEND_URLinfrontend/.envis correct - Verify the backend server is running on port 3001
- Check for firewall blocking WebSocket connections
MongoDB Connection Error
MongoDB Connection Error
If MongoDB fails to connect:
- Verify MongoDB is running:
mongosh(should connect successfully) - Check
MONGODB_URIformat inbackend/.env - For Atlas: verify IP address is whitelisted
Google OAuth Not Working
Google OAuth Not Working
If Google sign-in fails:
- Verify
GOOGLE_CLIENT_IDmatches in both.envfiles - Check authorized JavaScript origins in Google Cloud Console
- Ensure OAuth consent screen is published (not in testing mode with restricted users)
Next Steps
Installation Details
Learn more about detailed installation and configuration options
API Reference
Explore the backend API endpoints and Socket.IO events