Skip to content

About

BiLearnHub is an AI-powered LMS built with Next.js, FastAPI, and Firebase, delivering adaptive learning, intelligent tutoring, and gamified education — built for a hackathon.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BiLearnHub - AI-Powered Learning Platform

Next.js FastAPI Firebase Android Python Pinecone Groq RAG System

🚀 Overview

BiLearnHub is a comprehensive AI-powered Learning Management System (LMS) that revolutionizes education through intelligent tutoring, adaptive assessments, and personalized learning paths. The platform supports dual user roles - teachers who create interactive courses and students who learn at their own pace while earning BiPoints and certificates.

🌟 Key Features

  • 🎓 Multi-Role Support: Teachers create courses, students learn and earn certificates
  • 🤖 AI-Powered Tutoring: Context-aware chatbot with RAG (Retrieval Augmented Generation)
  • 📊 Adaptive Quizzes: Dynamic assessments that adapt to student performance
  • 💰 BiPoints Rewards: Gamified learning currency system
  • 📱 Cross-Platform: Next.js web app + Android mobile app
  • ☁️ Cloud Integration: Firebase, Cloudinary, and Pinecone vector database
  • 📄 Smart Certificates: Auto-generated PDF certificates with verification
  • 🎯 Personalized Onboarding: 4-question flow for customized recommendations

🏗️ Architecture

Platform Components

📱 Frontend Applications
├── 🌐 Student Web App (Next.js) - Course consumption, quizzes, notes
├── 🎓 Teacher Web App (Next.js) - Course creation and management  
└── 📱 Android App (Kotlin) - Mobile learning experience

🔧 Backend Services
├── ⚡ FastAPI Backend - AI/ML features, certificates, RAG system
├── 🔥 Firebase Services - Authentication, Firestore, Realtime DB
├── 🌤️ Cloudinary - Media storage and delivery
└── 🧠 Pinecone - Vector database for RAG

🤖 AI/ML Stack
├── 🦾 Groq API - LLM inference (llama-3.3-70b-versatile)
├── 🔍 Sentence Transformers - Text embeddings
└── 📚 RAG System - Context-aware intelligent tutoring

📁 Project Structure

Debug-Dynasty/
├── 🎓 teach-frontend/          # Teacher portal (Next.js)
│   ├── app/                    # App router pages
│   ├── components/             # Reusable UI components
│   ├── lib/                    # Services and utilities
│   └── public/                 # Static assets
├── 👨‍🎓 frontend/                  # Student portal (Next.js)
│   ├── app/                    # App router pages
│   ├── components/             # UI components + AI features
│   ├── lib/                    # Firebase services
│   └── contexts/               # React contexts
├── ⚡ backend/                  # FastAPI Python backend
│   ├── main.py                 # API endpoints
│   ├── rag_service.py         # RAG implementation
│   ├── config.py              # Configuration
│   └── templates/             # Certificate templates
└── 📱 android/                 # Android Kotlin app
    ├── app/src/main/          # Android source code
    └── app/build.gradle.kts   # Android dependencies

🛠️ Technology Stack

Frontend Technologies

  • Framework: Next.js 15.5.2 with App Router
  • UI Library: Radix UI + Tailwind CSS + Shadcn/ui
  • Rich Text: TipTap editor with advanced extensions
  • Drag & Drop: dnd-kit for course organization
  • Authentication: Firebase Auth with Google Sign-in
  • State Management: React Context + Custom hooks

Backend Technologies

  • API Framework: FastAPI 0.104.1 with async support
  • AI/ML: Groq API, Sentence Transformers, BeautifulSoup4
  • PDF Generation: ReportLab + WeasyPrint
  • Vector Search: Pinecone vector database
  • Cloud Storage: Cloudinary for media assets

Database & Services

  • Primary Database: Firebase Firestore
  • Real-time Features: Firebase Realtime Database
  • Vector Storage: Pinecone (course-isolated namespaces)
  • Authentication: Firebase Auth
  • File Storage: Cloudinary CDN

Mobile Development

  • Platform: Android with Kotlin
  • Minimum SDK: API 27 (Android 8.1)
  • Target SDK: API 36
  • Build Tool: Gradle with Kotlin DSL

🚀 Core Features

For Teachers 👩‍🏫

  • Course Creation: Rich text editor with media embedding
  • Content Organization: Drag-and-drop chapters and lessons
  • Course Management: Publishing, editing, and analytics
  • Media Upload: Cloudinary integration for images/videos
  • Student Analytics: Track progress and engagement

For Students 👨‍🎓

  • Course Discovery: AI-powered recommendations
  • Interactive Learning: Video lessons, rich text content
  • AI Tutoring: Context-aware chatbot assistance
  • Adaptive Quizzes: Dynamic assessments with explanations
  • BiNotes Sharing: Upload and share study materials
  • Progress Tracking: Streaks, BiPoints, certificates
  • Smart Onboarding: Personalized learning path setup

AI-Powered Features 🤖

  • RAG System: Course-specific knowledge retrieval
  • Adaptive Quizzes: Dynamic question generation
  • Content Summarization: Auto-generated flashcards
  • Smart Tutoring: Contextual hints and explanations
  • Personalized Recommendations: ML-based course suggestions

📊 Data Models

User Schema

{
  uid: string,                    // Firebase Auth UID
  email: string,                  // User email
  firstName: string,              // First name
  lastName: string,               // Last name
  user_type: string,              // "is_admin" | "is_teacher" | "is_student"
  bipoints: number,               // Reward currency
  profilePictureUrl: string,      // Cloudinary URL
  createdAt: timestamp,
  updatedAt: timestamp
}

Course Schema

{
  id: string,                     // Course ID
  userId: string,                 // Creator's UID
  title: string,                  // Course title
  description: string,            // Rich text description
  category: string,               // Course category
  difficultyLevel: string,        // "beginner" | "intermediate" | "advanced"
  heroImageUrl: string,           // Cloudinary URL
  tags: array,                    // Searchable keywords
  bipointsCost: number,           // Enrollment cost
  published: boolean,             // Publication status
  createdAt: timestamp,
  updatedAt: timestamp
}

Chapter & Lesson Schema

// Chapters
{
  id: string,
  courseId: string,               // Parent course
  title: string,
  order: number,                  // Display order
  createdAt: timestamp
}

// Lessons
{
  id: string,
  chapterId: string,              // Parent chapter
  courseId: string,               // For easier querying
  title: string,
  type: string,                   // "text" | "video" | "quiz"
  content: string,                // Rich text content
  videoUrl: string,               // YouTube URL
  order: number,
  createdAt: timestamp
}

🔧 Installation & Setup

Prerequisites

  • Node.js 18+ and npm/yarn
  • Python 3.9+
  • Android Studio (for mobile development)
  • Firebase project
  • Cloudinary account
  • Pinecone account
  • Groq API key

1. Clone Repository

git clone https://github.com/InterAsianHack025/Debug-Dynasty.git
cd Debug-Dynasty

2. Frontend Setup (Student Portal)

cd frontend
npm install
cp .env.example .env.local
# Add Firebase, Cloudinary configs
npm run dev

3. Teacher Portal Setup

cd teach-frontend
npm install
cp .env.example .env.local
# Add Firebase, Cloudinary configs
npm run dev

4. Backend Setup

cd backend
pip install -r requirements.txt
cp .env.example .env
# Add API keys: GROQ_API_KEY, PINECONE_API_KEY, etc.
uvicorn main:app --reload

5. Android Setup

cd android
# Open in Android Studio
# Add google-services.json
# Build and run

🔑 Environment Variables

Frontend (.env.local)

NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_domain
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=your_cloud_name
NEXT_PUBLIC_BACKEND_URL=http://localhost:8000

Backend (.env)

GROQ_API_KEY=your_groq_api_key
PINECONE_API_KEY=your_pinecone_api_key
PINECONE_ENVIRONMENT=your_environment
FIREBASE_TYPE=service_account
FIREBASE_PROJECT_ID=your_project_id
FIREBASE_PRIVATE_KEY_ID=your_key_id
FIREBASE_PRIVATE_KEY=your_private_key
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_secret

🌐 API Endpoints

Certificate Generation

POST /generate-certificate
Content-Type: application/json

{
  "userId": "user_id",
  "courseId": "course_id", 
  "studentName": "John Doe",
  "courseName": "Python Basics"
}

AI Tutoring (RAG)

POST /lesson_query
Content-Type: application/json

{
  "courseId": "course_id",
  "query": "Explain variables in Python",
  "highlightedText": "def variable = 5",
  "lessonContext": "Python fundamentals lesson"
}

Quiz Generation

POST /generate-quiz
Content-Type: application/json

{
  "courseId": "course_id",
  "difficulty": "medium",
  "questionCount": 10
}

Course Vectorization

POST /vectorize-course/{course_id}

🎯 BiPoints Economy

Earning BiPoints 💰

  • Course Completion: 50-200 BiPoints
  • Quiz Success: 10-50 BiPoints
  • Daily Streak: 5-25 BiPoints
  • BiNotes Sharing: 10-30 BiPoints
  • Peer Helping: 15-40 BiPoints

Spending BiPoints 💸

  • Course Enrollment: 20-500 BiPoints
  • Premium Features: 10-100 BiPoints
  • Certificate Generation: 25 BiPoints
  • AI Tutoring: 5 BiPoints per query

🔒 User Roles & Permissions

Students (is_student)

  • ✅ Browse and enroll in courses
  • ✅ Access AI tutoring and quizzes
  • ✅ Upload BiNotes and earn BiPoints
  • ✅ Generate completion certificates
  • ❌ Create or manage courses

Teachers (is_teacher)

  • ✅ Create and manage own courses
  • ✅ Upload media and organize content
  • ✅ View student analytics
  • ✅ Access AI features for content creation
  • ❌ Access admin panel

Admins (is_admin)

  • ✅ Full course management access
  • ✅ User management and analytics
  • ✅ System configuration
  • ✅ Content moderation
  • ✅ Financial reporting

🧠 AI & Machine Learning Features

RAG System Architecture

  1. Content Vectorization: Course content → embeddings
  2. Namespace Isolation: Each course = separate Pinecone namespace
  3. Semantic Search: Query → relevant content retrieval
  4. LLM Generation: Context + query → intelligent response
  5. User Context: Learning history → personalized answers

Adaptive Quiz System

  • Dynamic Generation: RAG-based question creation
  • Difficulty Scaling: Performance-based question selection
  • Explanation Generation: AI-powered answer explanations
  • Progress Tracking: Adaptive learning path adjustments

Personalization Engine

  • Onboarding Analysis: 4-question preference capture
  • Behavior Tracking: Learning patterns and engagement
  • Content Recommendations: ML-based course suggestions
  • Path Optimization: Personalized learning sequences

📱 Mobile Application (Android)

Features

  • Native Kotlin Development: Smooth performance
  • Firebase Integration: Cross-platform data sync
  • Offline Support: Download content for offline access
  • Push Notifications: Learning reminders and updates
  • Responsive Design: Tablet and phone optimization

Architecture

  • MVVM Pattern: Clean architecture implementation
  • Jetpack Compose: Modern UI toolkit
  • Firebase SDK: Authentication and data services
  • Retrofit: HTTP client for API communication

🔮 Future Roadmap

Phase 1: Enhanced AI (Q1 2025)

  • Multi-modal AI (image + text questions)
  • Advanced personalization algorithms
  • Real-time collaboration features
  • Voice-based interactions

Phase 2: Social Learning (Q2 2025)

  • Student study groups
  • Peer tutoring marketplace
  • Live virtual classrooms
  • Community-driven content

Phase 3: Enterprise Features (Q3 2025)

  • Organization management
  • Advanced analytics dashboard
  • Custom branding options
  • Integration APIs

Phase 4: Gamification Plus (Q4 2025)

  • Achievement system
  • Leaderboards and competitions
  • NFT certificates
  • BiPoints marketplace

🤝 Contributing

Development Workflow

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

Code Standards

  • Frontend: ESLint + Prettier + TypeScript
  • Backend: Black + isort + mypy
  • Mobile: Kotlin coding conventions
  • Documentation: Clear README updates

📄 License

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

👥 Team

  • Frontend Development: Pratik Joshi - Next.js + React specialists
  • Backend Development: Biplov Gautam, Roshan Jaishi - FastAPI + AI/ML engineers
  • Mobile Development: Dikshanta Chapagain - Android + Kotlin developers
  • AI/ML Research: Biplov Gautam - RAG + LLM optimization team
  • DevOps: Biplov Gautam - Firebase + Cloud infrastructure

🙏 Acknowledgments

  • Firebase: Authentication and database services
  • Cloudinary: Media storage and optimization
  • Pinecone: Vector database for semantic search
  • Groq: High-performance LLM inference
  • Radix UI: Accessible component primitives
  • TipTap: Extensible rich text editor

Built with ❤️ by Debug Dynasty Team

🌟 Star this repo if you find it helpful!

About

BiLearnHub is an AI-powered LMS built with Next.js, FastAPI, and Firebase, delivering adaptive learning, intelligent tutoring, and gamified education — built for a hackathon.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages