A comprehensive educational platform built with Flask that supports institution-based cohort management, live lecture sessions, quiz systems, and session recording.
- Multiple Institutions: Support for multiple educational institutions
- Cohort Organization: Students belong to one cohort with scoped access
- Teacher Multi-Cohort Access: Teachers can belong to multiple cohorts and select one upon login
- Proper Database Relationships: Institution β Cohorts β Users with proper foreign keys
- Welcome Emails: Automatic welcome emails upon student/teacher registration
- Cohort Notifications: Email notifications when students join cohorts
- Lecture Updates: Email notifications for lecture changes
- Quiz Notifications: Email alerts for new quizzes
- Configurable SMTP: Support for various SMTP providers
- Lecture Scheduling:
- Prevent scheduling lectures in the past
- Allow "now" lectures for immediate start
- Future scheduling with validation
- Lecture Expiry Logic: Lectures expire after ending, not joinable but logged
- Material Access: Students can access uploaded resources and past attended lectures
- File Compression: Automatic compression of audio, image, and PDF files
- Quiz Creation: Teachers can create quizzes within cohorts
- Multiple Choice Questions: Support for multiple-choice questions with correct answers
- Time Limits: Optional time limits for quizzes
- Multiple Attempts: Configurable maximum attempts per student
- Analytics Dashboard:
- Individual student performance tracking
- Aggregate performance metrics
- Graphical analytics with charts
- Question-level analytics
- Real-time Results: Dynamic results and performance tracking
- Live Session Recording: Record video, audio, and chat during live sessions
- Multiple Recording Types: Full recording, audio-only, or chat-only
- Participant Activity Logging: Track participant joins, leaves, and activities
- Chat Logging: Automatic logging of all chat messages during sessions
- Recording Management: Start, stop, and manage recordings
- File Organization: Organized storage of recording chunks and metadata
- Responsive Design: Modern, responsive design with Bootstrap/Tailwind
- Card-Based Layout: Replace lists/forms with modern cards
- Modal Popups: Modal popups for creating/editing lectures, materials, quizzes
- Toast Notifications: Real-time toast notifications for user feedback
- Cohort Selection: Dropdown for teachers to select active cohort
- Interactive Dashboards: Modern dashboard with cards for materials, lectures, quizzes
- Chart Integration: Quiz analytics with graphs and charts
- Cohort Scoping: Middleware for data access scoping by cohort
- Role-Based Access: Different access levels for students, teachers, and admins
- Session Management: Enhanced session security with proper expiration
- Row Level Security: Database-level security with RLS policies
Digi_Kul_TeachersPortal/
βββ main.py # Main application entry point
βββ config.py # Configuration settings
βββ supabase_schema.sql # Database schema
βββ middlewares/ # Authentication and cohort middleware
βββ services/ # Business logic services
βββ routes/ # API route blueprints
βββ utils/ # Utility functions
βββ templates/ # HTML templates
βββ static/ # Static assets
- CohortService: Institution and cohort management
- LectureService: Lecture scheduling and management
- QuizService: Quiz creation, taking, and analytics
- AdminService: Administrative operations
- SessionRecordingService: Live session recording
- EmailService: SMTP email notifications
- AuthMiddleware: Authentication decorators
- CohortMiddleware: Cohort-based access control
- Python 3.8+
- Supabase account
- SMTP email service (optional)
-
Clone the repository
git clone <repository-url> cd Digi_Kul_TeachersPortal
-
Install dependencies
pip install -r requirements.txt
-
Configure environment variables
# Copy example config cp config.example.py config.py # Edit config.py with your settings
-
Database setup
- Create a Supabase project
- Run the SQL schema from
supabase_schema.sql - Update your Supabase URL and key in config.py
-
Run the application
python main.py
- institutions: Educational institutions
- teachers: Teacher accounts with institution association
- students: Student accounts with institution association
- cohorts: Learning cohorts within institutions
- lectures: Lecture schedules and details
- materials: Teaching materials and resources
- quiz_sets: Quiz containers with metadata
- quizzes: Individual quiz questions
- quiz_attempts: Student quiz attempts
- quiz_responses: Individual question responses
- session_recordings: Recording metadata and statistics
- recording_chunks: Video/audio chunks for recordings
POST /api/auth/login- User loginPOST /api/auth/logout- User logoutPOST /api/auth/register/teacher- Teacher registration (admin only)POST /api/auth/register/student- Student registration (admin only)
GET /api/cohorts/- Get all cohortsPOST /api/cohorts/- Create cohort (admin only)GET /api/cohorts/teacher- Get teacher's cohortsPOST /api/cohorts/student/join- Join cohort with code
POST /api/lectures- Create lecturePOST /api/lectures/instant- Create instant lectureGET /api/lectures- Get user's lecturesPOST /api/lectures/<id>/materials- Upload material
POST /api/quiz/sets- Create quiz setPOST /api/quiz/sets/<id>/questions- Add quiz questionPOST /api/quiz/sets/<id>/start- Start quiz attemptGET /api/quiz/sets/<id>/analytics- Get quiz analytics
POST /api/recordings/start- Start recordingPOST /api/recordings/stop- Stop recordingGET /api/recordings/status/<session_id>- Get recording statusGET /api/lectures/<id>/recordings- Get lecture recordings
# Supabase Configuration
SUPABASE_URL = "your-supabase-url"
SUPABASE_KEY = "your-supabase-key"
# SMTP Configuration
SMTP_HOST = "smtp.gmail.com"
SMTP_PORT = 587
SMTP_USERNAME = "your-email@gmail.com"
SMTP_PASSWORD = "your-app-password"
SMTP_SENDER_EMAIL = "your-email@gmail.com"
# Application Configuration
SECRET_KEY = "your-secret-key"
UPLOAD_FOLDER = "uploads"
COMPRESSED_FOLDER = "compressed"join_session- Join a live sessionleave_session- Leave a live sessionchat_message- Send chat messagewebrtc_offer/answer- WebRTC signalingice_candidate- ICE candidate exchange
start_recording- Start session recordingstop_recording- Stop session recordingrecording_chunk- Send video/audio chunkget_recording_status- Get recording status
// Create a scheduled lecture
fetch('/api/lectures', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Mathematics 101',
description: 'Introduction to algebra',
scheduled_time: '2024-01-15T10:00:00Z',
duration: 60,
cohort_id: 'cohort-uuid'
})
});// Start a quiz attempt
fetch('/api/quiz/sets/quiz-uuid/start', {
method: 'POST',
headers: {'Content-Type': 'application/json'}
});// Start session recording
socket.emit('start_recording', {
session_id: 'session-uuid',
lecture_id: 'lecture-uuid',
recording_type: 'full'
});- Row Level Security (RLS): Database-level access control
- Cohort Scoping: Users can only access data from their cohorts
- Session Security: Enhanced session management with proper expiration
- Input Validation: Comprehensive input validation and sanitization
- File Upload Security: Secure file handling with type validation
- Environment Variables: Set all required environment variables
- Database: Use production Supabase instance
- File Storage: Configure proper file storage (AWS S3, etc.)
- SMTP: Use production SMTP service
- SSL: Enable HTTPS for production
- Monitoring: Set up logging and monitoring
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 5000
CMD ["python", "main.py"]- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the repository
- Check the documentation
- Review the API endpoints
- Added institution-based cohort management
- Implemented comprehensive quiz system
- Added session recording functionality
- Enhanced UI/UX with modern design
- Added SMTP email notifications
- Implemented cohort scoping middleware
- Basic lecture management
- Simple user authentication
- File upload functionality
- Live session support