A modern, gamified e-learning platform where courses are visualized as interactive skill trees. Users progress through levels by completing nodes, with AI-powered quizzing and auto-grading capabilities.
- 🎮 Interactive Skill Trees: Courses visualized as node maps using ReactFlow
- 🎯 Level-Based Progression: Complete levels to unlock new nodes
- 📚 Three-Stage Learning: Learn → MCQ Quiz → AI Challenge
- 🤖 AI-Powered Quizzing: Google Gemini API generates and grades open-ended questions
- 🎨 Modern UI: Beautiful, responsive design with Tailwind CSS
- 🔐 Authentication: Firebase Authentication with role-based access
- 📊 Progress Tracking: Track completion across all courses
- 🎓 Course Creation: Full course creation portal for creators
- Framework: Next.js 14 (App Router, TypeScript)
- Database & Auth: Firebase (Firestore, Firebase Authentication)
- Backend: Firebase Functions (TypeScript)
- AI: Google Gemini API
- Styling: Tailwind CSS
- UI Library: ReactFlow
- Node.js 18+ installed
- Firebase account and project
- Google Gemini API key
- Clone and install dependencies:
npm install-
Set up Firebase:
- Create a Firebase project at Firebase Console
- Enable Firestore Database
- Enable Firebase Authentication (Email/Password and Google providers)
- Copy your Firebase config to
.env.local(already included)
-
Set up Firebase Functions:
cd functions
npm install
cd ..-
Configure Gemini API Key:
For local development, add your Gemini API key to Firebase Functions config:
firebase functions:config:set gemini.api_key="YOUR_GEMINI_API_KEY"Or set it as an environment variable in your deployment.
- Deploy Firebase Functions:
cd functions
npm run build
firebase deploy --only functions
cd ..- Deploy Firestore Security Rules:
firebase deploy --only firestore:rules-
Seed Initial Data:
Visit
/api/seed(POST request) or use a tool like Postman to seed the platform with 4 official courses.Alternatively, you can create a simple script:
// seed.js (run with node)
const seedData = require('./lib/seedData');
seedData.default().then(() => {
console.log('Seeded!');
process.exit(0);
});- Run the development server:
npm run devOpen http://localhost:3000 in your browser.
AlgoArena/
├── app/ # Next.js App Router pages
│ ├── course/[courseId]/ # Course detail page with skill tree
│ ├── learn/[courseId]/[levelId]/ # Level experience page
│ ├── create-course/ # Course creation portal
│ ├── login/ # Authentication pages
│ └── api/ # API routes
├── components/ # React components
│ ├── CourseMap.tsx # ReactFlow skill tree visualization
│ ├── GraphEditor.tsx # Course creation graph editor
│ └── ui/ # Reusable UI components
├── lib/ # Utilities and Firebase setup
│ ├── firebase.ts # Firebase initialization
│ ├── auth.ts # Authentication helpers
│ ├── firestore.ts # Firestore operations
│ └── seedData.ts # Seed data script
├── functions/ # Firebase Functions
│ └── src/
│ └── index.ts # AI Functions (Gemini integration)
└── types/ # TypeScript type definitions
Each course is visualized as a node map where:
- Green nodes: Completed levels
- Blue nodes: Unlocked/current level
- Gray nodes: Locked (prerequisites not met)
Clicking an unlocked node navigates to the level page.
Each level has three progressive rounds:
- Learn: Study materials (YouTube videos, articles, documents)
- Creator Quiz: Multiple-choice questions (must score 80%+ to proceed)
- AI Challenge: AI-generated open-ended questions, auto-graded by Gemini
Creators can:
- Define course details
- Build interactive skill trees using ReactFlow
- Configure levels with study materials, MCQs, and AI context
Two Firebase Functions power the AI features:
generateAiQuestions: Generates 3-5 questions based on level contextgradeAiAnswers: Grades student answers and provides feedback
See firestore.rules for security rules. Key points:
- Users can read courses and their own progress
- Only creators/admins can create courses
- Course creators can edit their courses
Deploy functions with:
cd functions
npm run build
firebase deploy --only functionsEnsure .env.local contains:
NEXT_PUBLIC_FIREBASE_API_KEY=...
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=...
NEXT_PUBLIC_FIREBASE_PROJECT_ID=...
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=...
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=...
NEXT_PUBLIC_FIREBASE_APP_ID=...
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=...
- Push to GitHub
- Import project in Vercel
- Add environment variables
- Deploy
cd functions
npm run build
firebase deploy --only functionsfirebase deploy --only firestore:rulesThe platform includes 4 seed courses:
- Intro to Machine Learning
- Foundations of Quantum Mechanics
- Database Management Systems (DBMS)
- Principles of Aerodynamics
To seed, make a POST request to /api/seed or run the seed script.
This is a complete production-ready platform. Feel free to extend it with additional features like:
- User profiles and achievements
- Discussion forums
- Certificates
- Advanced analytics
- Social features
- Chat bot integration
MIT License - feel free to use this project for your own purposes!