A collaborative virtual study platform that brings students together to learn, focus, and grow. Join themed study rooms, use synchronized Pomodoro timers, chat with fellow students, interact with AI study companions, and track your progress through gamification.
- Create or join themed study rooms (Cozy Library, Rainy Night, Forest, Coffee Shop, etc.)
- Room capacity management (up to 8 users per room)
- Real-time participant tracking
- Browse available rooms with live participant counts
- Room-wide synchronized study/break sessions
- Customizable study (25 min) and break (5 min) durations
- Automatic session switching
- Session completion tracking for achievements
- In-room chat with fellow students
- Real-time message synchronization
- AI study buddies that send motivational messages
- Chat history per room
- Experience points (XP) and leveling
- 10 unique achievements to unlock
- Track focus time, streaks, and sessions
- Global leaderboard
- User statistics dashboard
- 7 audio options: Lo-fi, Classical, Rain, Forest, Cafรฉ, White Noise, Silence
- Advanced music player with controls
- Theme-specific ambient soundscapes
- Email/password authentication
- Google OAuth
- GitHub OAuth
- Discord OAuth
- Secure profile management
- AI students that join study rooms
- Motivational messages every 2 minutes
- Simulated study buddies for engagement
- Personal stats (focus time, streaks, level, XP)
- Achievement showcase
- Study session history
- Customizable avatars
- Node.js 18+ installed
- A Supabase account (free tier works!)
- Git installed
-
Clone the repository
git clone https://github.com/yourusername/studyflow.git cd studyflow -
Install dependencies
npm install
-
Set up Supabase
Follow the complete guide: SUPABASE_SETUP.md
Quick version:
- Create a Supabase project at supabase.com
- Run all 7 database migrations
- Configure authentication providers
-
Configure environment variables
cp .env.example .env
Edit
.envand add your Supabase credentials:VITE_SUPABASE_URL=https://your-project-id.supabase.co VITE_SUPABASE_ANON_KEY=your-anon-key-here VITE_APP_URL=http://localhost:5173
-
Start the development server
npm run dev
Open http://localhost:5173 in your browser.
| Document | Description |
|---|---|
| SUPABASE_SETUP.md | Complete Supabase setup guide with step-by-step instructions |
| DEPLOYMENT.md | Deploy to production (Vercel, Netlify) with custom domains |
| TROUBLESHOOTING.md | Solutions to common issues and error messages |
Frontend
- โ๏ธ React 18.3.1 - UI library
- ๐ TypeScript 5.5.3 - Type safety
- โก Vite 5.4.2 - Build tool & dev server
- ๐จ Tailwind CSS 3.4.1 - Styling
- ๐ญ Lucide React - Icon library
Backend & Database
- ๐๏ธ Supabase 2.57.4 - PostgreSQL database, authentication, real-time
- ๐ Row Level Security (RLS) - Database security
- ๐ก Supabase Real-time - WebSocket subscriptions
- โก Edge Functions - Serverless functions for AI features
State Management
- โ๏ธ React Context API - Global state
- ๐ช Custom Hooks - Business logic encapsulation
studyflow/
โโโ src/
โ โโโ components/ # React components
โ โ โโโ Audio/ # Music & ambient sounds
โ โ โโโ Auth/ # Authentication components
โ โ โโโ Layout/ # Header and layout
โ โ โโโ StudyRoom/ # Study room components
โ โ โโโ UI/ # Reusable UI components
โ โโโ context/ # React Context (AppContext)
โ โโโ hooks/ # Custom React hooks
โ โโโ lib/ # Service layer
โ โ โโโ auth.ts # Authentication service
โ โ โโโ roomService.ts # Room operations
โ โ โโโ chatService.ts # Chat functionality
โ โ โโโ profileService.ts # User profiles
โ โ โโโ aiStudentService.ts # AI companions
โ โโโ pages/ # Page components
โ โโโ types/ # TypeScript definitions
โ โโโ utils/ # Helper functions
โ โโโ App.tsx # Main app component
โ โโโ main.tsx # Entry point
โโโ supabase/
โ โโโ migrations/ # Database schema migrations (7 files)
โ โโโ functions/ # Edge Functions (AI, cleanup)
โโโ public/ # Static assets
โโโ .env.example # Environment variable template
โโโ vercel.json # Vercel deployment config
โโโ vite.config.ts # Vite configuration
Core Tables:
profiles- User profiles with stats and progressionstudy_rooms- Room metadata and timer stateroom_participants- Room membership trackingchat_messages- Chat historyachievements- Achievement definitions (10 default)user_achievements- Earned achievementsstudy_sessions- Study session trackinguser_settings- User preferencesai_students- AI companions
Key Features:
- Row Level Security (RLS) on all tables
- 5 stored procedures for atomic operations
- Auto-cleanup triggers for empty rooms
- Presence management with 2-minute timeout
See SUPABASE_SETUP.md for migration details.
Deploy StudyFlow to production in minutes!
- Push your code to GitHub
- Sign up at vercel.com with GitHub
- Import your repository
- Add environment variables:
VITE_SUPABASE_URLVITE_SUPABASE_ANON_KEYVITE_APP_URL
- Deploy!
Complete guide: DEPLOYMENT.md
StudyFlow also works great on:
- Netlify
- Render
- Railway
- Cloudflare Pages
See deployment guide for platform-specific instructions.
- Sign up or log in
- Click "Create Room"
- Choose a theme (Cozy Library, Rainy Night, etc.)
- Set study/break durations
- Select ambient music
- Start studying!
- Browse available rooms on the home page
- Click "Join" on any room with available space
- Automatically join the synchronized timer
- Chat with other participants
- Earn XP and achievements
- First Steps: Join your first study room
- Social Butterfly: Join 5 different rooms
- Focus Master: Complete 10 study sessions
- Night Owl: Study for 100 minutes total
- Marathon Runner: Complete a 50-minute session
- Streak Starter: Maintain a 3-day streak
- ... and 4 more!
Contributions are welcome! Here's how:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript best practices
- Use ESLint and Prettier for code formatting
- Write meaningful commit messages
- Test your changes locally before submitting
# Development
npm run dev # Start dev server at localhost:5173
# Build
npm run build # Build for production (outputs to dist/)
npm run preview # Preview production build locally
# Linting
npm run lint # Run ESLintHaving issues? Check out our comprehensive troubleshooting guide:
๐ TROUBLESHOOTING.md
Common issues:
Vercel Free Tier:
- โ Unlimited personal projects
- โ 100GB bandwidth/month
- โ Automatic SSL & global CDN
Supabase Free Tier:
- โ 500MB database storage
- โ 1GB file storage
- โ 50,000 monthly active users
โ ๏ธ Projects pause after 1 week of inactivity
Perfect for getting started! Upgrade when you need more.
- All database tables protected by Row Level Security (RLS)
- OAuth providers use industry-standard authentication
- Environment variables for sensitive data
- HTTPS enforced in production
- XSS and CSRF protection via security headers
This project is licensed under the MIT License - see the LICENSE file for details.
- Supabase - Backend infrastructure
- Vercel - Hosting platform
- Lucide Icons - Beautiful icons
- Tailwind CSS - Styling framework
Need help?
- ๐ Read the docs
- ๐ Report a bug
- ๐ฌ Join discussions
- ๐ง Email: [email protected]
If you found StudyFlow helpful, please consider giving it a star on GitHub!
Built with โค๏ธ for students who want to study better together
Start your focused study session today! ๐