Skip to content

mmc03-ucb/Lec-Recall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ Lec-Recall

Your intelligent learning companion with AI-powered question detection and real-time student engagement

Lec-Recall transforms traditional lectures into interactive, engaging experiences by automatically detecting questions in speech, generating real-time quizzes, and providing comprehensive analytics for both lecturers and students.

✨ Features

For Lecturers

  • 🎀 Real-time Speech Transcription - Powered by Deepgram API for accurate voice-to-text conversion
  • πŸ€– AI Question Detection - Google Gemini AI automatically identifies questions in your lecture
  • ⚑ Instant Quiz Generation - Convert detected questions into multiple-choice quizzes automatically
  • πŸ“Š Live Analytics Dashboard - Monitor student engagement, quiz performance, and confusion levels
  • πŸ€” Confusion Meter - Real-time feedback on student understanding levels
  • πŸ“ˆ Session Analytics - Detailed post-session reports with performance insights
  • 🎯 Review Recommendations - Identifies topics that need reinforcement based on student performance

For Students

  • πŸ”— Easy Session Joining - Join lectures with simple 6-character codes
  • πŸ“ Interactive Quizzes - Participate in real-time quizzes generated from lecture content
  • πŸ€” Anonymous Feedback - Signal confusion levels without revealing identity
  • πŸ“Š Personal Analytics - View your performance, correct/incorrect answers, and improvement areas
  • πŸ“š Lecture Summaries - AI-generated summaries of lecture content for review
  • πŸŒ™ Dark Mode Support - Comfortable viewing in any lighting condition
  • β™Ώ Full Accessibility - WCAG 2.1 AA compliant with screen reader support

πŸ—οΈ Architecture

The application follows a modern client-server architecture with real-time communication:

Technology Stack

  • Frontend: React 19, Socket.IO Client, CSS3 with custom properties
  • Backend: Node.js, Express.js, Socket.IO Server
  • Database: SQLite with structured schema
  • AI Services: Google Gemini AI for content processing
  • Speech Recognition: Deepgram API for real-time transcription
  • Real-time Communication: WebSocket connections via Socket.IO

System Architecture

graph TB
    subgraph "Frontend (React)"
        A[Student Interface<br/>- Join sessions<br/>- Answer quizzes<br/>- Confusion meter<br/>- View results]
        B[Lecturer Interface<br/>- Create sessions<br/>- Voice recording<br/>- Real-time analytics<br/>- Session management]
        C[Shared Components<br/>- Quiz renderer<br/>- Session creator<br/>- Student join]
    end

    subgraph "Backend (Node.js + Express)"
        D[API Server<br/>Port 5001]
        E[Socket.IO<br/>Real-time communication]
        F[Database Layer<br/>SQLite]
    end

    subgraph "External Services"
        G[Deepgram API<br/>Speech-to-text]
        H[Google Gemini AI<br/>Question detection<br/>Quiz generation<br/>Content summarization]
    end

    subgraph "Data Storage"
        I[(SQLite Database<br/>- Sessions<br/>- Students<br/>- Questions<br/>- Answers<br/>- Transcripts)]
    end

    A -->|Socket.IO| E
    B -->|Socket.IO| E
    A -->|HTTP Requests| D
    B -->|HTTP Requests| D
    
    D --> F
    E --> F
    F --> I
    
    B -->|Audio Stream| G
    D -->|Transcript Text| H
    
    E -->|Real-time Events<br/>- Quiz creation<br/>- Answer submission<br/>- Session updates<br/>- Confusion signals| A
    E -->|Real-time Events<br/>- Student joins<br/>- Analytics<br/>- Confusion metrics| B
Loading

πŸš€ Quick Start

Prerequisites

  • Node.js (version 16 or higher) - Download here
  • npm (comes with Node.js)
  • API Keys (see Environment Setup below)

1. Clone and Install

# Clone the repository
git clone https://github.com/yourusername/lec-recall.git
cd lec-recall

# Install frontend dependencies
npm install

# Install backend dependencies
cd lec-recall-backend
npm install
cd ..

2. Environment Setup

Create environment files with your API keys:

Frontend (.env in root directory):

REACT_APP_DEEPGRAM_API_KEY=your_deepgram_api_key_here
REACT_APP_BACKEND_URL=http://localhost:5001

Backend (lec-recall-backend/.env):

GEMINI_API_KEY=your_gemini_api_key_here
PORT=5001

Getting API Keys:

3. Start the Application

# Terminal 1: Start the backend server
cd lec-recall-backend
npm start

# Terminal 2: Start the frontend (in new terminal)
cd lec-recall
npm start

The application will be available at:

πŸ“ Project Structure

lec-recall/
β”œβ”€β”€ 🎨 Frontend (React Application)
β”‚   β”œβ”€β”€ public/                     # Static assets
β”‚   β”‚   β”œβ”€β”€ index.html             # Main HTML template
β”‚   β”‚   └── manifest.json          # PWA configuration
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/            # Reusable React components
β”‚   β”‚   β”‚   β”œβ”€β”€ Quiz.js           # Interactive quiz component
β”‚   β”‚   β”‚   β”œβ”€β”€ SessionCreator.js # Lecturer session setup
β”‚   β”‚   β”‚   └── StudentJoin.js    # Student session joining
β”‚   β”‚   β”œβ”€β”€ App.js                # Main application component
β”‚   β”‚   β”œβ”€β”€ App.css               # Global styles and design system
β”‚   β”‚   └── index.js              # React application entry point
β”‚   β”œβ”€β”€ package.json              # Frontend dependencies
β”‚   └── .env                      # Frontend environment variables
β”‚
β”œβ”€β”€ πŸ”§ Backend (Node.js Server)
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   └── database.js           # Database configuration
β”‚   β”œβ”€β”€ controllers/              # Business logic controllers
β”‚   β”‚   β”œβ”€β”€ analyticsController.js
β”‚   β”‚   β”œβ”€β”€ questionController.js
β”‚   β”‚   └── sessionController.js
β”‚   β”œβ”€β”€ database/
β”‚   β”‚   β”œβ”€β”€ lec_recall.db         # SQLite database file
β”‚   β”‚   └── schema.sql            # Database schema
β”‚   β”œβ”€β”€ middleware/               # Express middleware
β”‚   β”‚   β”œβ”€β”€ cors.js
β”‚   β”‚   └── errorHandler.js
β”‚   β”œβ”€β”€ routes/                   # API route definitions
β”‚   β”‚   β”œβ”€β”€ analytics.js
β”‚   β”‚   β”œβ”€β”€ questions.js
β”‚   β”‚   └── sessions.js
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   └── geminiService.js      # AI service integration
β”‚   β”œβ”€β”€ socket/
β”‚   β”‚   └── socketHandlers.js     # Real-time event handlers
β”‚   β”œβ”€β”€ server.js                 # Main server entry point
β”‚   β”œβ”€β”€ package.json              # Backend dependencies
β”‚   └── .env                      # Backend environment variables
β”‚
└── πŸ“š Documentation
    β”œβ”€β”€ README.md                 # This file
    └── instructions.md           # Additional setup instructions

πŸ”„ How It Works

  1. Lecturer Setup

    • Create a session with a name and time limit
    • Start recording your lecture using your microphone
    • The system automatically detects questions you ask
    • Students join using a simple 6-character code
  2. Real-Time Interaction

    • Questions are converted into multiple-choice quizzes instantly
    • Students answer on their devices in real-time
    • Monitor student understanding through the confusion meter
    • See live analytics of student performance
  3. Session Completion

    • End the session to generate comprehensive analytics
    • Review which topics need reinforcement
    • Students receive personalized performance reports
    • AI-generated lecture summaries help with review

Data Flow

  1. Speech Processing: Deepgram API converts lecturer audio to text
  2. AI Analysis: Gemini AI processes transcripts to detect questions
  3. Quiz Generation: Detected questions are converted to multiple-choice format
  4. Real-time Distribution: Socket.IO broadcasts quizzes to connected students
  5. Response Collection: Student answers are stored and analyzed in real-time
  6. Analytics Generation: Performance metrics and insights are calculated

Key Technologies

  • WebRTC/MediaRecorder: Browser audio capture
  • Socket.IO: Bidirectional real-time communication
  • SQLite: Lightweight, serverless database
  • React Hooks: Modern state management
  • CSS Custom Properties: Theming and design system
  • ARIA: Accessibility compliance

πŸ”Œ API Endpoints

REST API

  • GET /health - Server health check
  • GET /api - API documentation
  • GET /api/sessions/:id/analytics - Session analytics
  • POST /api/sessions - Create new session
  • POST /api/questions - Create quiz question

Socket.IO Events

  • create-session - Lecturer creates new session
  • join-session - Student joins existing session
  • quiz-created - New quiz available for students
  • submit-answer - Student submits quiz answer
  • signal-confusion - Student signals understanding level
  • stop-session - Lecturer ends session
  • session-ended - Session termination notification

πŸ› οΈ Development

Running in Development Mode

# Backend with auto-reload
cd lec-recall-backend
npm run dev

# Frontend with hot reload
cd lec-recall
npm start

Environment Variables

Ensure you have the following environment variables configured:

Frontend (.env)

  • REACT_APP_DEEPGRAM_API_KEY - Deepgram API key for speech recognition
  • REACT_APP_BACKEND_URL - Backend server URL (default: http://localhost:5001)

Backend (.env)

  • GEMINI_API_KEY - Google Gemini AI API key
  • PORT - Server port (default: 5001)

Database Schema

The SQLite database includes tables for:

  • sessions - Lecture session metadata
  • students - Student information and session participation
  • questions - Generated quiz questions and metadata
  • answers - Student responses and performance data
  • transcripts - Speech-to-text transcription data

🎨 Design Features

Modern UI/UX

  • Glass morphism design with backdrop blur effects
  • Responsive layout that works on desktop, tablet, and mobile
  • Dark/light mode with system preference detection
  • Smooth animations and micro-interactions
  • Color-coded feedback for different states and actions

Accessibility (WCAG 2.1 AA Compliant)

  • Screen reader support with proper ARIA labels
  • Keyboard navigation for all interactive elements
  • High contrast ratios for text readability
  • Skip links for efficient navigation
  • Semantic HTML structure
  • Focus indicators for better usability

πŸ”’ Security & Privacy

  • Environment variables for secure API key management
  • Anonymous student participation - no personal data required
  • Local data storage - all session data stays on your server
  • CORS protection for secure cross-origin requests
  • Input validation and error handling

πŸš€ Deployment

Production Build

# Build frontend for production
npm run build

# Start backend in production mode
cd lec-recall-backend
NODE_ENV=production npm start

Environment Setup for Production

  • Set up environment variables on your server
  • Configure proper CORS settings
  • Set up SSL certificates for HTTPS
  • Configure firewall rules for ports 3000 and 5001

🀝 Contributing

We welcome contributions! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes and test thoroughly
  4. Commit your changes: git commit -m 'Add amazing feature'
  5. Push to your branch: git push origin feature/amazing-feature
  6. Open a Pull Request with a detailed description

Development Guidelines

  • Follow the existing code style and patterns
  • Add comments for complex logic
  • Test your changes with both lecturer and student flows
  • Ensure accessibility standards are maintained
  • Update documentation for new features

πŸ“‹ Troubleshooting

Common Issues

Backend won't start:

  • Check if port 5001 is available: lsof -i :5001
  • Verify environment variables are set correctly
  • Check API key validity

Frontend connection issues:

  • Ensure backend is running on port 5001
  • Check browser console for WebSocket connection errors
  • Verify CORS settings in backend

Audio not working:

  • Grant microphone permissions in your browser
  • Check Deepgram API key and quota
  • Test with different browsers (Chrome recommended)

AI features not working:

  • Verify Gemini API key is valid and has quota
  • Check network connectivity to Google AI services
  • Review backend logs for API errors

πŸ“„ License

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


Built with ❀️ for educators and learners everywhere

Transform your lectures, engage your students, and enhance learning outcomes with Lec-Recall.

About

Finalist for Hack Melbourne 2025

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors