How vamsienduri/s_g_1 works
This is a small Streamlit/FastAPI application for student and trainer account registration and login. Users submit credentials or registration details; the Streamlit app sends them to FastAPI, which reads or writes Supabase’s users table. Successful login stores the returned identity in session state and routes to a role-specific dashboard, where session and role checks run before dashboard content is shown. The sampled code supports these flows; the trainer dashboard’s role check is hard-coded and does not actually validate the session role.
Main entry points: app.py Login form · main.py Login endpoint · StudentDashboard.py Student access checks · TrainerDashboard.py Trainer access checks
Components 10
Streamlit frontend
- Login form
project/app.py - Registration form
project/app.py - Student access checks
project/pages/StudentDashboard.py - Student dashboard
project/pages/StudentDashboard.py - Trainer access checks
project/pages/TrainerDashboard.py - Trainer dashboard
project/pages/TrainerDashboard.py
FastAPI backend
- Login endpoint
project/main.py - Registration endpoint
project/main.py
User persistence
- Supabase users
Other components
- User
Connections 11
- User → Login form: enters credentials
project/app.py - User → Registration form: enters details
project/app.py - Login form → Login endpoint: posts credentials
project/app.py - Login endpoint → Supabase users: queries users
project/main.py - Login endpoint → Login form: returns login result
project/app.py - Registration form → Registration endpoint: posts user
project/app.py - Registration endpoint → Supabase users: inserts user
project/main.py - Login form → Student access checks: routes by role
project/app.py - Login form → Trainer access checks: routes by role
project/app.py - Student access checks → Student dashboard: allows display
project/pages/StudentDashboard.py - Trainer access checks → Trainer dashboard: allows display
project/pages/TrainerDashboard.py