A real-time web application for collecting and managing student questions during live classes. Students submit questions anonymously, vote on popular questions, and view instructor responses in real-time.
- Anonymous Question Submission - Students submit questions without revealing identity
- Real-time Upvoting - Questions with more votes appear higher in the list
- WebSocket Updates - New questions and votes appear instantly for everyone
- QR Code Access - Students scan QR codes to join sessions quickly
- Session Management - Instructors create, start, pause, and end question sessions
- Content Moderation - Three-state profanity filtering (approved/flagged/rejected)
- Markdown Support - Rich text formatting in instructor answers with WYSIWYG editor
- Presentation Mode - Full-screen view optimized for classroom projection
- Multi-monitor Support - Pop-out windows for QR codes and presentation view
- Written Answers - Instructors can write detailed responses with markdown formatting
- Session Statistics - Public stats page showing question activity
- Data Export - Download session data as JSON or CSV
- API Key Authentication - Secure instructor access via API keys
- Student View - Clean question submission and voting interface
- Instructor Dashboard - Real-time question monitoring with moderation tools
- Admin Panel - User management and API key creation
- Stats Page - Large-text presentation view for classroom displays
- Responsive Design - Works on desktop, tablet, and mobile devices
- Profanity Filter - Automatic detection using
better-profanitylibrary - Three-state Moderation - Clean (auto-approved), Flagged (needs review), Rejected (hidden)
- Server-side Filtering - Security enforcement at the API level
- Rate Limiting - DDoS protection and submission throttling
- CSRF Protection - Cross-site request forgery prevention
- JWT Authentication - Secure admin authentication with bcrypt password hashing
# Clone the repository
git clone <your-repo-url>
cd raisemyhand
# Configure environment
cp .env.example .env
echo "YourSecureAdminPassword" > secrets/admin_password.txt
# Build and start
docker compose up --build -dThe application will be available at http://localhost:8000
# Clone and setup virtual environment
git clone <your-repo-url>
cd raisemyhand
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env file and set ADMIN_PASSWORD=YourSecurePassword
# Initialize database and start server
python main.pyThe application will be available at http://localhost:8000
See GETTING_STARTED.md for a complete step-by-step walkthrough.
- Go to http://localhost:8000/admin-login
- Login with username
adminand your password from .env or secrets file - Create an API key for instructors in the admin dashboard
- Create Session: Enter your API key and session title at home page
- Share Access: Display QR code or share the generated student URL
- Monitor Questions: Watch questions appear in real-time, sorted by votes
- Moderate Content: Review flagged questions, approve or reject as needed
- Answer Questions: Mark questions as answered or write detailed responses
- Manage Session: Toggle voting, end session, download reports
- Join Session: Scan QR code or visit shared URL
- Submit Questions: Type questions and submit anonymously
- Vote on Questions: Upvote questions you want answered
- Real-time Updates: See new questions and instructor responses instantly
Backend (Python/FastAPI):
- FastAPI web framework with automatic OpenAPI documentation
- SQLAlchemy ORM with SQLite database (PostgreSQL-ready)
- WebSocket connections for real-time updates
- Pydantic data validation and serialization
- bcrypt password hashing and JWT authentication
- SlowAPI rate limiting and CSRF protection
Frontend (Vanilla JavaScript):
- WebSocket client for real-time communication
- EasyMDE markdown editor for instructor answers
- Marked.js and DOMPurify for safe markdown rendering
- Responsive CSS design without framework dependencies
- QR code generation and display
Database Schema:
class_meetings- Session information and settingsquestions- Student questions with moderation statusanswers- Instructor written responses with markdownquestion_votes- Upvote tracking per studentapi_keys- Instructor authentication tokens
Dependencies:
better-profanity- Content moderationqrcode[pil]- QR code generationpython-jose[cryptography]- JWT tokenspasslib[bcrypt]- Password hashing- CDN libraries: EasyMDE, Marked.js, DOMPurify
# Server Configuration
HOST=0.0.0.0
PORT=8000
BASE_URL=http://localhost:8000
# Database
DATABASE_URL=sqlite:///./data/raisemyhand.db
# Admin Authentication (choose one)
ADMIN_PASSWORD=YourSecurePassword # For development
# OR use Docker secrets: secrets/admin_password.txt
# Optional Settings
TIMEZONE=America/New_York
CREATE_DEFAULT_API_KEY=falseFor production, set BASE_URL to your actual domain and use Docker secrets:
# Production example
BASE_URL=https://questions.university.edu
echo "ProductionPassword123!" > secrets/admin_password.txt
docker compose up -dTo switch from SQLite to PostgreSQL:
# Update .env
DATABASE_URL=postgresql://user:password@host:5432/database
# Install driver
pip install psycopg2-binary
# Run normally - tables auto-created
python main.py- Content Moderation: Server-side profanity detection with three-state system
- Authentication: JWT tokens for admin, API keys for instructors
- Rate Limiting: Prevents spam and DDoS attacks
- CSRF Protection: Secure state-changing operations
- XSS Prevention: HTML sanitization with DOMPurify
- Password Security: bcrypt hashing with salt
- Session Isolation: Students only see approved content
Interactive API documentation is available at http://localhost:8000/docs when the server is running.
Session Management:
POST /api/meetings- Create new session (requires API key)GET /api/meetings/{meeting_code}- Get session details and questionsPOST /api/meetings/{instructor_code}/end- End sessionGET /api/meetings/{instructor_code}/flagged-questions- Review flagged content
Question Operations:
POST /api/meetings/{meeting_code}/questions- Submit questionPOST /api/questions/{question_id}/vote- Toggle upvotePOST /api/questions/{question_id}/approve- Approve flagged questionPOST /api/questions/{question_id}/reject- Reject flagged question
Answer Management:
POST /api/questions/{question_id}/answer- Create/update written answerPOST /api/questions/{question_id}/answer/publish- Make answer public
Real-time:
WS /ws/{meeting_code}- WebSocket for live updates
The included docker-compose.yml sets up:
- FastAPI application container
- Volume mounting for persistent data
- Environment variable configuration
- Docker secrets support for production
Container Structure:
/app/
βββ main.py (application entry point)
βββ data/ (SQLite database storage)
βββ static/ (CSS/JS assets)
βββ templates/ (HTML templates)
βββ secrets/ (password files)
raisemyhand/
βββ main.py # Application entry point
βββ models_v2.py # Database models (SQLAlchemy)
βββ schemas_v2.py # API schemas (Pydantic)
βββ routes_classes.py # Session management routes
βββ routes_questions.py # Question handling routes
βββ routes_answers.py # Answer management routes
βββ database.py # Database configuration
βββ logging_config.py # Logging setup
βββ static/
β βββ css/styles.css # Application styles
β βββ js/
β βββ shared.js # Common utilities
β βββ student.js # Student interface
β βββ instructor.js # Instructor dashboard
β βββ admin.js # Admin panel
βββ templates/
β βββ student.html # Student question interface
β βββ instructor.html # Instructor dashboard
β βββ stats.html # Presentation view
β βββ admin.html # Admin panel
β βββ *.html # Other UI templates
βββ requirements.txt # Python dependencies
βββ Dockerfile # Container definition
βββ docker-compose.yml # Container orchestration
βββ .env.example # Configuration template
# Start the server
python main.py
# Test workflow:
# 1. Create admin account at /admin-login
# 2. Create API key in admin dashboard
# 3. Start new session at home page
# 4. Open student URL in different browser/tab
# 5. Submit questions and test voting
# 6. Try content moderation with test profanityOpen multiple browser tabs/windows:
- Tab 1: Instructor dashboard (with API key)
- Tab 2+: Student views (different browsers to simulate multiple students)
- Test real-time updates by submitting questions and votes
Submit questions with profanity to test the three-state moderation system:
- Clean questions β Auto-approved and visible
- Flagged questions β Require instructor review
- Rejected questions β Hidden from students
The application logs all operations including:
- Database operations (CREATE, UPDATE, DELETE)
- WebSocket connections and disconnections
- Security events (authentication, rate limiting)
- Content moderation actions
Logs are structured for production monitoring and include timestamps, operation types, and success/failure status.
Common Issues:
- Port already in use: Change
PORTin .env file - Database errors: Check write permissions in
data/directory - WebSocket connection failed: Verify
BASE_URLmatches actual domain - QR code not loading: Check network connectivity and BASE_URL configuration
- Markdown not rendering: Ensure CDN libraries load (check browser console)
Development Issues:
- Changes not visible: Clear browser cache or hard refresh (Ctrl+Shift+R)
- API key authentication fails: Verify API key was created in admin panel
- Real-time updates not working: Check WebSocket connection in browser dev tools
This is educational software built for classroom use. The codebase follows professional standards with comprehensive error handling, security measures, and clean architecture.
Development Guidelines:
- Follow existing code structure and naming conventions
- Add tests for new features
- Update documentation for any changes
- Ensure mobile responsiveness for UI changes
MIT License - See LICENSE file for details.
Physics Classes: Students ask questions about complex topics during lectures
Computer Science: Debugging help and concept clarification during coding sessions
Mathematics: Step-by-step explanations and problem-solving guidance
General Education: Any classroom where anonymous question collection improves participation
The presentation mode and QR code features are specifically designed for classroom projection systems and student mobile device access.
Visit GitHub Repository β’ Report Issues β’ Documentation
Built for education with β€οΈ