Real-time application for monitoring student learning progress. Teachers can create groups with learning goals, students join via QR codes, and the system tracks progress through chat interactions.
✅ Authentication & Authorization
- Google OAuth2 sign-in
- Role-based access control (Teacher/Student)
- Backend authorization enforcement
✅ Teacher Features
- Create and manage learning groups
- Define learning goals for each group
- Generate QR codes for group joining
- Monitor student progress in real-time
- View live chat activity
✅ Student Features
- Join groups via QR code
- Text-based chat interface
- Real-time progress feedback
- Device-based join restrictions (localStorage)
✅ Real-time Communication
- WebSocket-based chat
- Live progress updates
- Instant message delivery
- Python 3.x with FastAPI
- SQLAlchemy ORM + SQLite database
- Google OAuth2 authentication
- WebSocket support for real-time features
- JWT token-based authorization
- React 18 with TypeScript
- Vite build tool
- React Router for navigation
- WebSocket client for real-time updates
- QR code generation and display
📖 New User? See WEBAPP_VERIFICATION.md for a visual guide on verifying role changes in the webapp.
🔍 Requirements Verification: See REQUIREMENTS_TRACKING.md for detailed requirement tracking and run python scripts/verify_requirements.py for automated verification.
To quickly explore the application with sample data:
# Run the quick demo setup
./scripts/quick_demo.shThis creates test users and groups. Then follow the on-screen instructions to start the servers.
- Python 3.9+
- Node.js 18+
- Google Cloud project with OAuth2 credentials
- Navigate to backend directory:
cd backend- Create virtual environment and install dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt- Configure environment:
cp .env.example .env
# Generate a secure SECRET_KEY
python3 -c "import secrets; print(secrets.token_urlsafe(32))"
# Copy the output and update SECRET_KEY in .env
# Also add your Google OAuth2 credentials to .env- Run the server:
uvicorn main:app --reload --host 0.0.0.0 --port 8000API docs: http://localhost:8000/docs
- Navigate to frontend directory:
cd frontend- Install dependencies:
npm install- Run development server:
npm run devThe checked-in vercel.json deploys the frontend only. This project's backend uses SQLite persistence and FastAPI WebSockets, so it should be deployed on a stateful platform instead of Vercel.
-
Create a Render account and connect your GitHub account in the Render dashboard.
-
In Render, click New → Blueprint.
-
Select this repository and the branch you want to deploy. Render reads the root
render.yamlautomatically. -
Review the detected service:
- Service name:
scio-assignment-2026-backend - Runtime: Python
- Root directory:
backend - Plan:
starter - Persistent disk mounted at
/var/datafor the SQLite database
- Service name:
-
Enter the environment variables Render prompts you for:
GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRET
SECRET_KEYis generated automatically by Render.DATABASE_URL,FRONTEND_URL, andENVIRONMENTare already set byrender.yaml. -
Click Create Blueprint and wait for the deploy to finish.
-
Open the new Render service and copy its public URL, for example
https://scio-assignment-2026-backend.onrender.com.
- In Google Cloud Console, open your OAuth client and add this authorized redirect URI:
{backend-origin}/auth/google/callback
- In Vercel, open the
scio-assignment-2026project settings and add:VITE_API_URL={backend-origin}
- Redeploy the Vercel frontend.
If your frontend will not live at https://scio-assignment-2026.vercel.app, update FRONTEND_URL in the Render service settings to match the real frontend origin.
- Go to Google Cloud Console
- Create a new project or select existing
- Configure the OAuth consent screen (APIs & Services → OAuth consent screen)
- Create an OAuth 2.0 Client ID (Web application) under APIs & Services → Credentials
- In the client configuration, add the authorized redirect URI:
http://localhost:8000/auth/google/callback- For production, add your deployed backend callback too:
https://<your-render-service>.onrender.com/auth/google/callback
- For production, add your deployed backend callback too:
- Copy the Client ID and Client Secret into the backend
.envfile
- Sign in with Google account
- Set your role to "teacher" using one of these methods:
- Quick script:
./scripts/make_teacher.sh your@email.com - Database directly:
python scripts/set_user_role.py your@email.com teacher - API endpoint: See "Setting User Roles" section below
- Quick script:
- Refresh your browser (F5 or Cmd+R) to see the Teacher Dashboard
- Create a new group with name and learning goal
- Share the QR code with students
- Monitor real-time progress on the group page
Note: After changing your role, simply refresh the browser - no logout/login needed!
- Sign in with Google account (default role is "student")
- Scan teacher's QR code or use join link
- Start chatting to demonstrate progress
- See your progress percentage update in real-time
By default, all users who sign in are assigned the "student" role. To use teacher features, you need to set your role to "teacher".
After signing in at least once with Google OAuth:
# List all registered users
python scripts/list_users.py
# Set a user's role to teacher
./scripts/make_teacher.sh your@email.comVerifying in the Webapp:
- After running the script, simply refresh your browser (F5 or Cmd+R)
- The webapp will reload and fetch your updated user information
- You should now see the Teacher Dashboard instead of Student Dashboard
- Teacher features will be available:
- "Create New Group" button
- Access to group management and monitoring
- QR code generation for student enrollment
# Set role to teacher
python scripts/set_user_role.py your@email.com teacher
# Set role back to student
python scripts/set_user_role.py your@email.com studentVerifying in the Webapp: After running the script, refresh your browser to see the updated role reflected in the UI.
cd backend
sqlite3 student_monitor.db
UPDATE users SET role = 'teacher' WHERE email = 'your@email.com';
.quitVerifying in the Webapp: Refresh your browser after making the database change to see the new role take effect.
For development/testing, you can enable self-service role changes:
-
Add to your
backend/.env:DEMO_ALLOW_SELF_ROLE_CHANGE=true -
Restart the backend server
-
Use the API endpoint:
# Get your user ID curl -H "Authorization: Bearer YOUR_JWT_TOKEN" http://localhost:8000/auth/me # Set your role to teacher curl -X POST "http://localhost:8000/auth/set-role/YOUR_USER_ID?role=teacher" \ -H "Authorization: Bearer YOUR_JWT_TOKEN"
Or use the interactive API docs at http://localhost:8000/docs
Note: The API endpoint method is disabled by default for security. Use database or script methods in production.
Verifying in the Webapp: After setting your role via any method, simply refresh your browser to see the changes take effect immediately.
Here's the complete flow to verify your role change in the webapp:
-
Sign in with Google OAuth at http://localhost:3000
- You'll initially see the Student Dashboard (default role)
- Your email will be registered in the database
-
Change your role using any method above
- Example:
./scripts/make_teacher.sh your@email.com - You'll see confirmation in the terminal
- Example:
-
Refresh the webapp (browser refresh, F5, or Cmd+R)
- The page will reload
- Your user data will be fetched from the backend
- You'll now see the Teacher Dashboard with these features:
- "Create New Group" button visible
- Title shows "Teacher Dashboard"
- Ability to create and manage groups
- Access to QR code generation
-
No re-login required - the role change is immediate upon refresh
Issue: After refreshing, still seeing Student Dashboard
Solutions:
-
Verify the role was changed:
python scripts/list_users.py
Check that your email shows
Role: teacher -
Clear browser cache and localStorage:
- Open browser DevTools (F12)
- Go to Application tab → Local Storage
- Clear all items or just the
auth_token - Sign in again
-
Check backend logs:
- Ensure the backend server is running
- Look for any errors in the terminal
-
Verify you're changing the correct user:
- Make sure the email matches exactly what Google OAuth provides
- Check
python scripts/list_users.pyfor the exact email
├── backend/
│ ├── main.py # FastAPI application
│ ├── database.py # Database models & setup
│ ├── schemas.py # Pydantic schemas
│ ├── auth_utils.py # JWT utilities
│ ├── dependencies.py # Auth dependencies
│ ├── routers/
│ │ ├── auth.py # Authentication endpoints
│ │ ├── groups.py # Group management
│ │ └── chat.py # Chat & WebSocket
│ └── requirements.txt
│
├── frontend/
│ ├── src/
│ │ ├── pages/ # Page components
│ │ ├── hooks/ # Custom hooks
│ │ ├── services/ # API services
│ │ ├── types/ # TypeScript types
│ │ ├── utils/ # Utilities
│ │ └── App.tsx # Main app
│ └── package.json
│
└── README.md
- JWT token-based authentication
- Role-based access control enforced on backend
- Device-based join restrictions
- CORS configuration
- Secure WebSocket connections
- Authorization checks on all protected endpoints
The current implementation uses a simple heuristic (message count) for progress estimation. In a production system, this would be replaced with:
- Natural Language Processing to analyze message content
- AI/ML models to assess understanding
- Teacher-defined criteria matching
- Multi-dimensional progress metrics
cd backend
uvicorn main:app --reloadcd frontend
npm run devnpm run type-checkAGPL-3.0-or-later License - See LICENSE file for details
This is a prototype/MVP. Contributions welcome for:
- Enhanced progress estimation algorithms
- UI/UX improvements
- Additional features (file sharing, video, etc.)
- Performance optimizations
- Test coverage