Skip to content

byessilyurt/studyflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

25 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

StudyFlow ๐Ÿ“š

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.

Built with React TypeScript Vite Supabase License

โœจ Features

๐Ÿ  Virtual Study Rooms

  • 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

โฑ๏ธ Synchronized Pomodoro Timer

  • Room-wide synchronized study/break sessions
  • Customizable study (25 min) and break (5 min) durations
  • Automatic session switching
  • Session completion tracking for achievements

๐Ÿ’ฌ Real-time Chat

  • In-room chat with fellow students
  • Real-time message synchronization
  • AI study buddies that send motivational messages
  • Chat history per room

๐ŸŽฎ Gamification System

  • Experience points (XP) and leveling
  • 10 unique achievements to unlock
  • Track focus time, streaks, and sessions
  • Global leaderboard
  • User statistics dashboard

๐ŸŽต Music & Ambient Sounds

  • 7 audio options: Lo-fi, Classical, Rain, Forest, Cafรฉ, White Noise, Silence
  • Advanced music player with controls
  • Theme-specific ambient soundscapes

๐Ÿ” Authentication

  • Email/password authentication
  • Google OAuth
  • GitHub OAuth
  • Discord OAuth
  • Secure profile management

๐Ÿค– AI Study Companions

  • AI students that join study rooms
  • Motivational messages every 2 minutes
  • Simulated study buddies for engagement

๐Ÿ‘ค User Profiles

  • Personal stats (focus time, streaks, level, XP)
  • Achievement showcase
  • Study session history
  • Customizable avatars

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+ installed
  • A Supabase account (free tier works!)
  • Git installed

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/studyflow.git
    cd studyflow
  2. Install dependencies

    npm install
  3. 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
  4. Configure environment variables

    cp .env.example .env

    Edit .env and 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
  5. Start the development server

    npm run dev

    Open http://localhost:5173 in your browser.

๐Ÿ“– Documentation

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

๐Ÿ› ๏ธ Tech Stack

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

๐Ÿ“ Project Structure

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

๐Ÿ—„๏ธ Database Schema

Core Tables:

  • profiles - User profiles with stats and progression
  • study_rooms - Room metadata and timer state
  • room_participants - Room membership tracking
  • chat_messages - Chat history
  • achievements - Achievement definitions (10 default)
  • user_achievements - Earned achievements
  • study_sessions - Study session tracking
  • user_settings - User preferences
  • ai_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.

๐Ÿšข Deployment

Deploy StudyFlow to production in minutes!

Deploy to Vercel (Recommended)

  1. Push your code to GitHub
  2. Sign up at vercel.com with GitHub
  3. Import your repository
  4. Add environment variables:
    • VITE_SUPABASE_URL
    • VITE_SUPABASE_ANON_KEY
    • VITE_APP_URL
  5. Deploy!

Complete guide: DEPLOYMENT.md

Other Platforms

StudyFlow also works great on:

  • Netlify
  • Render
  • Railway
  • Cloudflare Pages

See deployment guide for platform-specific instructions.

๐ŸŽฏ Usage

Creating a Study Room

  1. Sign up or log in
  2. Click "Create Room"
  3. Choose a theme (Cozy Library, Rainy Night, etc.)
  4. Set study/break durations
  5. Select ambient music
  6. Start studying!

Joining a Room

  1. Browse available rooms on the home page
  2. Click "Join" on any room with available space
  3. Automatically join the synchronized timer
  4. Chat with other participants
  5. Earn XP and achievements

Earning 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!

๐Ÿค Contributing

Contributions are welcome! Here's how:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow TypeScript best practices
  • Use ESLint and Prettier for code formatting
  • Write meaningful commit messages
  • Test your changes locally before submitting

๐Ÿ“ Scripts

# 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 ESLint

๐Ÿ› Troubleshooting

Having issues? Check out our comprehensive troubleshooting guide:

๐Ÿ‘‰ TROUBLESHOOTING.md

Common issues:

๐Ÿ“Š Free Tier Limits

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.

๐Ÿ”’ Security

  • 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

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

๐Ÿ“ž Support

Need help?

โญ Show Your Support

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! ๐Ÿš€

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •