A comprehensive educational platform with role-based access for teachers and students, featuring real-time progress tracking, quiz management, and gamified learning experiences.
# Clone the repository
git clone https://github.com/CodeByDeepankar/hackthon-sih.git
cd hackthon-sih
# Run automated setup
start.bat# Clone the repository
git clone https://github.com/CodeByDeepankar/hackthon-sih.git
cd hackthon-sih
# Make script executable and run
chmod +x start.sh
./start.sh# Clone and install dependencies
git clone https://github.com/CodeByDeepankar/hackthon-sih.git
cd hackthon-sih
# Next.js app setup
cd frontend
cp .env.local.example .env.local
# Edit .env.local with your Supabase and API credentials
npm install
npm run dev- Node.js v18 or higher
- Supabase account with a project (URL and Service Role key)
- Git for cloning the repository
- Sign in to Supabase and create a new project
- Copy the Project URL and Service Role key from Project Settings โ API
- Update
frontend/.env.localwith these values (SUPABASE_URL,SUPABASE_SERVICE_ROLE_KEYand optional anon key) - (Optional) Generate an anon key for browser usage if you call Supabase directly from the client
The backend expects relational tables such as
subjects,quizzes,questions,student_progress,quiz_responses,achievements, and supporting reference tables. Use the SQL editor in Supabase to create tables that match the application's data model.
- Subject Management: Create and organize educational subjects
- Quiz Creation: Build interactive quizzes with multiple choice questions
- Student Progress: Monitor individual and class-wide performance
- Analytics: Real-time insights into student engagement
- School Management: Track students within the same school
- Take Quizzes: Interactive quiz-taking experience with timers
- Progress Tracking: View personal performance and improvement
- Daily Streaks: Gamified learning with streak tracking
- Subject Exploration: Browse and access quizzes by subject
- Achievement System: Track accomplishments and milestones
- Daily Streaks: Encourage consistent learning
- Progress Visualization: Visual progress bars and statistics
- Achievement Badges: Reward system for milestones
- Leaderboards: Friendly competition between students
- Real-time Feedback: Instant quiz results and explanations
- RESTful endpoints served from
/api/* - Supabase data layer on PostgreSQL
- Role-based access control
- Server-Sent Events and WebSocket broadcasting
- Comprehensive error handling
- Modern React with App Router
- Responsive design with Tailwind CSS
- Clerk authentication
- Progressive Web App (PWA) features
- API client abstraction for Supabase-backed services
- Managed PostgreSQL with realtime channels
- Row-Level Security (RLS) ready policies
- Built-in authentication, storage, and edge functions
- SQL editor and dashboard for data exploration
GET /health
GET /users/:userId/role
POST /users/role
GET /subjects
POST /subjects
PUT /subjects/:id
DELETE /subjects/:id
GET /quizzes
POST /quizzes
GET /quizzes/:id
GET /questions/quiz/:quizId
GET /students/school/:schoolId
GET /students/:studentId/progress
GET /progress/school/:schoolId
POST /responses
Next.js (.env.local)
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
# Optional if you call Supabase directly from the browser
# NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
# NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
CLERK_WEBHOOK_SECRET=your-clerk-webhook-secret
GEMINI_API_KEY=your-google-gemini-api-keynpm run dev # Start development server
npm run build # Build for production
npm start # Serve the production build- Set
NODE_ENV=production - Use HTTPS for all URLs
- Configure proper CORS origins
- Set up database backups
- Enable rate limiting
Container templates will be updated to reflect the unified Next.js API layer. Deployments can target any Node.js hosting that supports Next.js.
"Failed to fetch" Error
- Ensure the Next.js dev server is running on port 3000
- Verify Supabase credentials in
.env.local - Check browser console and server logs for detailed errors
Database Connection Failed
- Confirm
SUPABASE_URLandSUPABASE_SERVICE_ROLE_KEYin.env.local - Regenerate keys from Supabase dashboard if rotated
- Check Supabase project status page for outages
Authentication or CORS Issues
- Confirm the site URL configured in Clerk matches the dev origin
- Ensure all requests target the same origin (
http://localhost:3000during development) - Clear cached credentials or restart the dev server after env changes
- Health check: http://localhost:3000/api/health
- Supabase dashboard: https://app.supabase.com/
- Browser developer tools for frontend issues
- Deployment Guide - Comprehensive deployment instructions
- Deployment Checklist - Step-by-step checklist
- Full Stack Guide - Technical architecture details
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter issues:
- Check the troubleshooting section above
- Review the deployment checklist
- Check server logs for errors
- Create an issue on GitHub with detailed information
- Advanced analytics dashboard
- Video lesson integration
- Mobile app development
- Multi-language support
- Advanced gamification features
- Integration with external LMS systems
Made with โค๏ธ for gamified STEM education