Installation & Setup
This guide covers everything you need to set up Study Sync locally for development or deploy it to production.Prerequisites: Basic knowledge of Next.js, MongoDB, and Firebase
Prerequisites
Before you begin, ensure you have the following installed and configured:Node.js
Version 18 or higher
Package Manager
One of:
- npm (comes with Node.js)
- yarn
- pnpm
MongoDB
MongoDB Atlas (recommended) or local MongoDB 7.0+Create free cluster →
Firebase Project
Installation Steps
Environment Configuration
Complete .env.local Setup
Configuration Details
MongoDB Setup
Create MongoDB Atlas Cluster
- Go to MongoDB Atlas
- Create a free cluster (M0 Sandbox)
- Create a database user with read/write permissions
- Whitelist your IP address (or use 0.0.0.0/0 for development)
Get Connection String
- Click “Connect” on your cluster
- Choose “Connect your application”
- Copy the connection string
- Replace
<username>,<password>, and<database_name>
Firebase Configuration
Create Firebase Project
- Go to Firebase Console
- Click “Add project”
- Follow the setup wizard
Enable Authentication
- In Firebase Console, go to Authentication
- Click “Get Started”
- Enable these sign-in methods:
- Email/Password
- Google (optional but recommended)
Get Client Configuration
- Go to Project Settings (gear icon)
- Scroll to “Your apps” section
- Click the web app icon (
</>) - Register your app and copy the config:
src/lib/firebase.js
YouTube API Setup (Optional)
Enable YouTube Data API v3
- Go to Google Cloud Console
- Create a new project or select existing
- Navigate to APIs & Services → Library
- Search for “YouTube Data API v3”
- Click “Enable”
Create API Key
- Go to APIs & Services → Credentials
- Click “Create Credentials” → “API Key”
- Copy the key and add to
.env.local:
Gmail SMTP Setup (Optional)
Enable 2-Factor Authentication
- Go to your Google Account
- Navigate to Security
- Enable 2-Step Verification
Generate App Password
- Go to Security → 2-Step Verification
- Scroll to App passwords
- Select “Mail” and “Other (Custom name)”
- Name it “Study Sync”
- Copy the 16-character password
Email notifications are optional. The app works fully without them, but users won’t receive deadline reminders or daily study notifications.
Run Development Server
Verify Setup
Open your browser and check:
- Homepage loads successfully
- You can create an account
- Firebase authentication works
- MongoDB connection is established (check terminal logs)
Project Structure
Troubleshooting
MongoDB Connection Error
MongoDB Connection Error
Error:
MongoServerError: bad auth : Authentication failedSolutions:- Verify username and password in connection string
- Check IP whitelist in MongoDB Atlas
- Ensure database user has read/write permissions
- Try encoding special characters in password
Firebase Authentication Not Working
Firebase Authentication Not Working
Error:
Firebase: Error (auth/configuration-not-found)Solutions:- Verify all
NEXT_PUBLIC_FIREBASE_*variables are set - Check that Authentication is enabled in Firebase Console
- Ensure you’ve enabled Email/Password sign-in method
- Clear browser cache and cookies
YouTube API Quota Exceeded
YouTube API Quota Exceeded
Error:
quotaExceeded: The request cannot be completed because you have exceeded your quotaSolutions:- YouTube API has a free quota of 10,000 units/day
- Each video metadata fetch costs ~3 units
- Request quota increase in Google Cloud Console
- Implement caching to reduce API calls
Email Notifications Not Sending
Email Notifications Not Sending
Error:
Error: Invalid login: 535-5.7.8 Username and Password not acceptedSolutions:- Ensure 2FA is enabled on your Google account
- Generate a new App Password (not your regular password)
- Remove spaces from the 16-character app password
- Verify
GMAIL_USERmatches the account that generated the app password
Next Steps
Quick Start Guide
Create your first study plan and instance
API Reference
Explore the REST API endpoints
Configuration
Set up environment variables and services
Database Schema
Understand the MongoDB collections
Need help? Check the GitHub Issues or create a new one.