An AI-powered comprehensive study platform that helps students prepare for both academic exams and job placement interviews. Built with Next.js, FastAPI, and powered by advanced LLM technology.
- AI-Powered Study Plans: Generate personalized study schedules based on your exam date and syllabus
- Smart Practice Sessions: MCQ and written questions with instant AI feedback
- Progress Tracking: Comprehensive dashboard to monitor your learning journey
- Spaced Repetition: Intelligent review scheduling for optimal retention
- Weak Topic Analysis: Identify and focus on areas that need improvement
- Exam Day Preparation: Last-minute revision and confidence boost features
- Voice-Enabled Chatbot: Interactive AI assistant with text-to-speech capabilities
- Company-Specific Plans: Tailored preparation roadmaps for top tech companies (Google, Amazon, Microsoft, etc.)
- Round-Wise Preparation: Structured guidance for aptitude, coding, and interview rounds
- DSA Practice: Data structures and algorithms questions with difficulty progression
- System Design: Learn and practice system design concepts
- Mock Interviews: Simulate real interview experiences
- Study Groups: Form and join study groups with peers
- Doubt Resolution: Ask and answer questions within the community
- Study Partners: Find and connect with study partners
- Group Challenges: Participate in collaborative learning challenges
- Study Sessions: Schedule and track group study sessions
- Framework: Next.js 16.0 with React 19.2
- Language: TypeScript
- Styling: Tailwind CSS 4.1
- State Management: Zustand
- Icons: Lucide React
- HTTP Client: Axios
- Form Handling: React Hook Form
- Framework: FastAPI 0.104
- Database: SQLite (default) / PostgreSQL with SQLAlchemy ORM
- Authentication: JWT with python-jose
- File Processing: PyPDF2 for document extraction
- AI/LLM: Multi-provider support (Mistral, Groq, Google GenAI)
- Server: Uvicorn
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- Python (v3.9 or higher)
- npm or yarn package manager
- pip (Python package manager)
- PostgreSQL (v14 or higher) - Optional, only needed for production deployments
Note: PostgreSQL is optional. The application works with SQLite by default, which requires no additional installation.
git clone https://github.com/GamerBhai02/StudyBuddy.git
cd StudyBuddy# Navigate to backend directory
cd backend
# Create a virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Set up environment variables
# Copy the template and configure your settings:
cp .env.template .env
# Edit .env file with your preferred text editor
# For quick start with SQLite (default):
# DATABASE_URL=sqlite:///./exam_prep_db.db
# Add your AI API keys (at minimum, GEMINI_API_KEY)
# For PostgreSQL (optional, production):
# DATABASE_URL=postgresql://username:password@localhost:5432/studybuddy
# Initialize the database
python init_db.py
# Start the backend server
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000The backend API will be available at http://localhost:8000
API documentation will be at http://localhost:8000/docs
# Open a new terminal and navigate to frontend directory
cd frontend
# Install dependencies
npm install
# Set up environment variables
# Create a .env.local file in the frontend directory with:
# NEXT_PUBLIC_API_URL=http://localhost:8000
# Start the development server
npm run devThe application will be available at http://localhost:3000
For production deployment with separate frontend and backend hosting, see our comprehensive DEPLOYMENT.md guide.
Architecture: Separate deployment of frontend (Vercel) and backend (Render)
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ Vercel (Free) โ โ Render (Free) โ
โ Next.js โ โโโโโโโบ โ FastAPI โ
โ Frontend โ HTTPS โ Backend + DB โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
Key Features:
- โ Free hosting for both frontend and backend
- โ Automatic HTTPS and SSL certificates
- โ Continuous deployment from GitHub
- โ Environment variable management
- โ PostgreSQL database support
Deploy in 3 steps:
- Deploy Backend โ Render (10 minutes)
- Deploy Frontend โ Vercel (5 minutes)
- Connect & Configure โ Update CORS settings
๐ Read Full Deployment Guide
DATABASE_URL=sqlite:///./exam_prep_db.db # or PostgreSQL URL
PORT=10000 # Render default
CORS_ORIGINS=https://your-app.vercel.app,http://localhost:3000
FRONTEND_URL=https://your-app.vercel.app
SECRET_KEY=your-secret-key
GEMINI_API_KEY=your-gemini-key
MISTRAL_API_KEY=your-mistral-key # Optional
GROQ_API_KEY=your-groq-key # OptionalNEXT_PUBLIC_API_URL=https://your-backend.onrender.comRender Free Tier:
- Services spin down after 15 minutes of inactivity
- First request after sleep takes 30-60 seconds (cold start)
- 750 hours/month (enough for 24/7 operation)
Workaround: Use UptimeRobot to ping your backend every 10 minutes to prevent cold starts.
Want to deploy instantly without any setup? Use Replit!
-
Fork on Replit
- Visit Replit
- Import this repository:
https://github.com/GamerBhai02/StudyBuddy - Click "Run" - that's it! Everything is configured automatically.
-
What Happens Automatically
- โ All dependencies installed (Node.js, Python, PostgreSQL)
- โ Backend and Frontend servers start together
- โ Environment files created with templates
- โ Database initialized
- โ Both servers running on correct ports
-
Configure Your API Keys
- Open
backend/.envin Replit editor - Add your API keys:
MISTRAL_API_KEY=your-actual-key-here GROQ_API_KEY=your-actual-key-here GOOGLE_API_KEY=your-actual-key-here - Click "Stop" and then "Run" again
- Open
-
Access Your Application
- Frontend: Click the "Open website" button in Replit
- Backend API: Available at your-repl-name.repl.co:8000
- API Docs: your-repl-name.repl.co:8000/docs
The repository includes:
.replit- Replit configurationreplit.nix- System dependenciesstart.sh- Startup script that runs both servers
- โ No local setup required
- โ Works on any device (even Chromebooks!)
- โ Automatic HTTPS
- โ Built-in code editor
- โ Easy collaboration
- โ Free tier available
StudyBuddy/
โโโ frontend/ # Next.js frontend application
โ โโโ src/
โ โ โโโ app/ # Next.js app directory
โ โ โ โโโ dashboard/ # Dashboard pages
โ โ โ โโโ exam-day/ # Exam day preparation
โ โ โ โโโ onboarding/ # Onboarding flow
โ โ โ โโโ peer/ # Peer learning features
โ โ โ โโโ placement/ # Placement preparation
โ โ โ โโโ practice/ # Practice sessions
โ โ โ โโโ lesson/ # Lesson pages
โ โ โโโ components/ # Reusable React components
โ โ โโโ lib/ # Utilities and API clients
โ โโโ public/ # Static assets
โ โโโ package.json
โ
โโโ backend/ # FastAPI backend application
โ โโโ app/
โ โ โโโ data/ # Static data (companies, resources)
โ โ โโโ models/ # Database models
โ โ โโโ routes/ # API routes
โ โ โโโ services/ # Business logic
โ โ โโโ main.py # Application entry point
โ โโโ uploads/ # Uploaded files storage
โ โโโ requirements.txt # Python dependencies
โ โโโ init_db.py # Database initialization
โ
โโโ README.md # This file
-
Create a Study Plan
- Click on "Exam Preparation" from the home page
- Upload your syllabus (PDF format)
- Set your exam date
- Let AI generate a personalized study plan
-
Daily Study
- Check your dashboard for today's tasks
- Complete practice sessions
- Review weak topics
- Track your progress
-
Practice & Review
- Access practice questions for any topic
- Get instant AI feedback
- Follow spaced repetition schedule
- Use exam day prep for last-minute revision
-
Select Target Company
- Choose from top tech companies
- Set your interview date
- Get a customized preparation roadmap
-
Follow the Roadmap
- Complete aptitude round preparation
- Practice DSA problems
- Study system design concepts
- Prepare for HR rounds
-
Track Progress
- Monitor completion of each phase
- Practice with difficulty progression
- Review weak areas
The platform includes a global AI chatbot with:
- Context-aware responses based on current page
- Voice input (speech-to-text)
- Voice output (text-to-speech) with customizable settings
- Support for multiple voice profiles
- Quick question suggestions
The application supports two database options:
- โ No installation required - Comes with Python
- โ Zero configuration - Works out of the box
- โ Perfect for Replit - File-based, no server needed
- โ Local development - Easy to set up and reset
- โ Automatic fallback - Used if PostgreSQL connection fails
DATABASE_URL=sqlite:///./exam_prep_db.db- โ Better performance - Handles concurrent users
- โ Production ready - Advanced features and reliability
- โ Scalable - Better for large deployments
DATABASE_URL=postgresql://username:password@localhost:5432/studybuddyAutomatic Fallback: If PostgreSQL is configured but connection fails, the application automatically falls back to SQLite to ensure startup success.
Issue: Connection refused or could not connect to server
- Solution: If you see these errors with PostgreSQL, the app will automatically fall back to SQLite. You can also explicitly switch to SQLite in your
.envfile.
Issue: Database tables not created
- Solution: Run
python init_db.pyfrom the backend directory
Issue: Want to switch databases
- Solution: Update
DATABASE_URLin.envand restart the server. All data will be fresh in the new database.
Issue: Want to reset database
- SQLite: Delete the
.dbfile and runpython init_db.py - PostgreSQL: Drop and recreate the database, then run
python init_db.py
# Local development
NEXT_PUBLIC_API_URL=http://localhost:8000
# Production (Vercel)
# NEXT_PUBLIC_API_URL=https://your-backend.onrender.com# Database (choose one)
DATABASE_URL=sqlite:///./exam_prep_db.db # For development
# DATABASE_URL=postgresql://username:password@localhost:5432/studybuddy # For production
# Deployment Configuration
PORT=8000 # Use 10000 for Render
CORS_ORIGINS=http://localhost:3000 # Add production URL: https://your-app.vercel.app
FRONTEND_URL=http://localhost:3000 # Update for production
# Security
SECRET_KEY=your-secret-key-here
ALGORITHM=HS256
# AI/LLM API Keys (required)
GEMINI_API_KEY=your-gemini-api-key
MISTRAL_API_KEY=your-mistral-api-key
GROQ_API_KEY=your-groq-api-key
GOOGLE_API_KEY=your-google-api-key# Frontend
cd frontend
npm run lint
# Backend
cd backend
# Add your Python linting commands# Frontend
cd frontend
npm run build
npm start
# Backend
cd backend
uvicorn app.main:app --host 0.0.0.0 --port 8000Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- GamerBhai02 - Initial work - GitHub Profile
- Next.js team for the amazing framework
- FastAPI for the high-performance backend framework
- OpenAI, Mistral, Groq, and Google for AI capabilities
- All contributors who have helped shape this project
If you have any questions or need help, please:
- Open an issue on GitHub
- Check the documentation at
/docsendpoint of the API
- Mobile app development
- Advanced analytics dashboard
- Real-time collaborative study sessions
- Integration with more learning platforms
- Advanced AI tutoring features
- Gamification and achievement system
Made with โค๏ธ for students, by students