AI-powered collaborative study tracker - A modern, sleek web application built with Next.js 14+ that helps students and study groups track progress, manage flashcards, build habits, and collaborate effectively.
- π Authentication & RBAC - Google OAuth with role-based access control (OWNER/ADMIN/MEMBER)
- π₯ Group Management - Create/join study groups, invite by email, group selector
- π Smart Flashcards - AI-powered spaced repetition with difficulty adjustment
- β° Study Timer - Pomodoro-like timer with focus mode and fullscreen support
- π Analytics Dashboard - Weekly study hours, streaks, task completion tracking
- π¬ Real-time Chat - Per-group chat with Socket.IO integration
- π― Habit Tracker - Gamified habit building with streak tracking
- π€ AI Study Buddy - Intelligent study assistant with Cohere AI integration
- π³ Stripe Billing - Free/Premium tiers with subscription management
- Modern Glassmorphism Design - Sleek, minimalist black/white theme
- Smooth Animations - Hover effects, transitions, and micro-interactions
- Responsive Design - Works perfectly on desktop, tablet, and mobile
- Keyboard Shortcuts - Quick navigation with Ctrl+1/2/3
- Fullscreen Mode - Distraction-free study environment
- Dynamic Backgrounds - Animated gradient elements
- Next.js 14+ - App Router, Server Actions, TypeScript
- Tailwind CSS 4 - Utility-first styling with custom animations
- React Query - Data fetching and caching
- Socket.IO Client - Real-time communication
- Recharts - Data visualization
- Next.js API Routes - Server-side API endpoints
- NextAuth.js - Authentication with Google OAuth
- Prisma - Database ORM with PostgreSQL
- Zod - Runtime type validation
- Socket.IO - Real-time server with namespaces/rooms
- PostgreSQL - Primary database
- Stripe - Payment processing
- Cohere AI - AI study assistant
- SendGrid - Email invitations
- Docker - Containerization
- GitHub Actions - CI/CD pipeline
- Vitest - Unit testing
- Playwright - E2E testing
- ESLint & Prettier - Code quality
- Husky & lint-staged - Git hooks
- Node.js 18+
- PostgreSQL 14+
- Git
- Clone the repository
git clone https://github.com/yourusername/studysync.git
cd studysync- Install dependencies
npm install- Set up environment variables
cp .env.example .env.local- Configure environment variables
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/studysync"
# NextAuth
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-secret-key"
# Google OAuth
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
# AI Services
COHERE_API_KEY="your-cohere-api-key"
OPENAI_API_KEY="your-openai-api-key"
# Stripe
STRIPE_SECRET_KEY="your-stripe-secret-key"
STRIPE_PUBLISHABLE_KEY="your-stripe-publishable-key"
STRIPE_WEBHOOK_SECRET="your-stripe-webhook-secret"
# Email
SENDGRID_API_KEY="your-sendgrid-api-key"- Set up the database
npx prisma migrate dev
npx prisma db seed- Start the development server
npm run dev- Open your browser Navigate to http://localhost:3000
studysync/
βββ src/
β βββ app/ # Next.js App Router
β β βββ api/ # API routes
β β βββ dashboard/ # Dashboard pages
β β βββ groups/ # Group management
β β βββ layout.tsx # Root layout
β βββ components/ # React components
β β βββ SmartFlashcards.tsx
β β βββ HabitTracker.tsx
β β βββ AIStudyBuddy.tsx
β β βββ ...
β βββ server/ # Server-side utilities
β βββ styles/ # Global styles
βββ prisma/ # Database schema & migrations
βββ tests/ # Test files
βββ scripts/ # Utility scripts
βββ docker/ # Docker configuration
βββ .github/ # GitHub Actions workflows
βββ docs/ # Documentation
- Spaced Repetition Algorithm - Intelligent review scheduling
- Difficulty Adjustment - Automatic difficulty based on performance
- Category Filtering - Organize cards by subject
- Progress Tracking - Visual progress bars and statistics
- Streak Tracking - Daily habit completion with streak counters
- Gamification - Progress bars and achievement system
- Flexible Habits - Add, edit, and delete habits
- Visual Feedback - Color-coded progress indicators
- Cohere AI Integration - Intelligent responses to study questions
- Context Awareness - Understands study-related queries
- Real-time Chat - Instant AI assistance
- Study Tips - Personalized learning recommendations
- Role-based Access - OWNER/ADMIN/MEMBER permissions
- Email Invitations - Invite members via email
- Real-time Chat - Group communication
- Progress Sharing - Collaborative study tracking
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run lint:fix # Fix ESLint issues
npm run format # Format code with Prettier
npm run test # Run unit tests
npm run test:e2e # Run E2E tests
npm run db:reset # Reset database
npm run db:seed # Seed databasenpx prisma studio # Open Prisma Studio
npx prisma migrate dev # Run migrations
npx prisma generate # Generate Prisma client
npx prisma db push # Push schema changesnpm run test # Unit tests with Vitest
npm run test:e2e # E2E tests with Playwright
npm run test:coverage # Test coverage report# Build Docker image
docker build -t studysync .
# Run with docker-compose
docker-compose up -d- Connect your GitHub repository to Vercel
- Set environment variables in Vercel dashboard
- Deploy automatically on push to main branch
Ensure all required environment variables are set in your production environment:
- Database connection string
- Authentication secrets
- API keys for external services
- Stripe webhook endpoints
POST /api/auth/signin/google- Google OAuth sign-inGET /api/auth/session- Get current sessionPOST /api/auth/signout- Sign out
GET /api/dashboard/stats- Get dashboard statisticsPOST /api/groups- Create new study groupGET /api/groups/[id]- Get group detailsPOST /api/groups/[id]/invite- Invite member to group
POST /api/ai/huggingface- AI study assistant (Cohere)POST /api/ai/chat- OpenAI chat completion
POST /api/stripe/checkout- Create checkout sessionPOST /api/stripe/portal- Create customer portalPOST /api/stripe/webhook- Handle Stripe webhooks
npm run testTests are written with Vitest and cover:
- Component rendering
- State management
- API endpoints
- Utility functions
npm run test:e2eEnd-to-end tests cover:
- User authentication flow
- Study group creation
- Flashcard interactions
- Payment flows
- Session Protection - Secure session management with NextAuth
- Role-based Access Control - Granular permissions system
- Input Validation - Zod schema validation on all inputs
- Rate Limiting - API rate limiting for security
- CORS Configuration - Proper cross-origin resource sharing
- Environment Variables - Secure secret management
- 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
- Write tests for new features
- Update documentation as needed
- Follow the existing code style
- Ensure all tests pass before submitting
- β Core study tracking features
- β AI study assistant
- β Group management
- β Payment integration
- π Mobile app (React Native)
- π Advanced analytics
- π Study room scheduling
- π Integration with calendar apps
- π Machine learning recommendations
- π Video study sessions
- π Study material sharing
- π Advanced collaboration tools
Database Connection Issues
# Check if PostgreSQL is running
pg_ctl status
# Reset database
npm run db:resetAuthentication Issues
- Verify Google OAuth credentials
- Check NEXTAUTH_URL matches your domain
- Ensure NEXTAUTH_SECRET is set
Build Issues
# Clear Next.js cache
rm -rf .next
# Reinstall dependencies
rm -rf node_modules package-lock.json
npm installThis project is licensed under the MIT License - see the LICENSE file for details.
- Next.js Team - For the amazing framework
- Tailwind CSS - For the utility-first CSS framework
- Prisma - For the excellent database toolkit
- Cohere - For AI capabilities
- Stripe - For payment processing
- π§ Email: sivanp515@gmail.com
- π Documentation: docs.studysync.app
- π Issues: GitHub Issues
Built with β€οΈ by the StudySync Team
Empowering students to study smarter, not harder.