How giakhangcode/sql-uit works
UIT-SQL is a SQL-learning platform for students, instructors, and administrators. Users enter through role-aware routes, authenticate, then practice SQL problems or work on assignments and contests; instructors manage problems, classes, and assessments, while administrators manage users and classes. The backend exposes these capabilities through FastAPI routers and persists domain data through SQLAlchemy. The graph preserves the documented frontend and backend feature areas; unsampled route implementations and most frontend-to-backend endpoint mappings are not asserted.
Main entry points: database.py Database session · main.py FastAPI application · models.py Domain models · App.tsx App routing
Components 28
Web application
- App routing
frontend/src/app/App.tsx - Auth context
frontend/src/context/AuthContext.tsx - Auth service
frontend/src/services/authService.ts - Browser storage
frontend/src/services/storage.ts - API client
frontend/src/services/apiClient.ts
Student learning
- Student pages
frontend/src/pages/student - SQL workspace
frontend/src/pages/student/WorkspacePage.tsx - Student API service
frontend/src/services/studentApi.ts
Instructor tools
- Teacher pages
frontend/src/pages/teacher - Assessment builder
frontend/src/pages/teacher/BuilderPages.tsx - Teacher service
frontend/src/services/teacherService.ts
Administration
- Admin pages
frontend/src/pages/admin/AdminPages.tsx - Admin service
frontend/src/services/adminService.ts
API and domain
- FastAPI application
backend/app/main.py - Authentication
backend/app/routers/auth.py - Problems and grading
backend/app/routers/problems.py - Assignments and contests
backend/app/routers/assignments.py - Student assignments
backend/app/routers/student_assignments.py - Submissions
backend/app/routers/submissions.py - AI assistance
backend/app/routers/ai.py - Classes
backend/app/routers/classes.py - Admin operations
backend/app/routers - Domain models
backend/app/models.py - API schemas
backend/app/schemas.py - SQL sandbox
backend/app/services/sandbox.py - Database session
backend/app/database.py - SQL Server
Other components
- User
Connections 45
- User → App routing: uses
- App routing → Auth context: reads session
frontend/src/app/App.tsx - Auth context → Auth service: delegates to
frontend/src/context/AuthContext.tsx - Auth service → API client: sends requests
frontend/src/services/authService.ts - Auth service → Browser storage: persists session
frontend/src/services/authService.ts - API client → Browser storage: reads token
frontend/src/services/apiClient.ts - App routing → Student pages: routes to
frontend/src/app/App.tsx - App routing → Teacher pages: routes to
frontend/src/app/App.tsx - App routing → Admin pages: routes to
frontend/src/app/App.tsx - Student pages → Student API service: loads data
frontend/src/pages/student/ContestsPage.tsx - SQL workspace → Student API service: loads data
frontend/src/pages/student/WorkspacePage.tsx - SQL workspace → Browser storage: saves drafts
frontend/src/pages/student/WorkspacePage.tsx - SQL workspace → Student pages: uses chat panel
frontend/src/pages/student/WorkspacePage.tsx - Assessment builder → Teacher service: manages assessments
frontend/src/pages/teacher/BuilderPages.tsx - Teacher pages → Teacher service: loads data
frontend/src/pages/teacher/TeacherLandingPages.tsx - Teacher service → API client: sends requests
frontend/src/services/teacherService.ts - Admin pages → Admin service: loads admin data
frontend/src/pages/admin/AdminPages.tsx - Admin service → API client: sends requests
frontend/src/services/adminService.ts - FastAPI application → Authentication: registers routes
backend/app/main.py - FastAPI application → Problems and grading: registers routes
backend/app/main.py - FastAPI application → Assignments and contests: registers routes
backend/app/main.py - FastAPI application → Student assignments: registers routes
backend/app/main.py - FastAPI application → Submissions: registers routes
backend/app/main.py - FastAPI application → AI assistance: registers routes
backend/app/main.py - FastAPI application → Classes: registers routes
backend/app/main.py - FastAPI application → Admin operations: registers routes
backend/app/main.py - FastAPI application → Database session: creates tables
backend/app/main.py - Domain models → Database session: uses base
backend/app/models.py - Authentication → Database session: queries via
backend/app/routers/auth.py - Authentication → Domain models: reads and writes
backend/app/routers/auth.py - Authentication → API schemas: validates with
backend/app/routers/auth.py - Problems and grading → Database session: queries via
backend/app/routers/problems.py - Problems and grading → Domain models: uses entities
backend/app/routers/problems.py - Problems and grading → SQL sandbox: evaluates SQL
backend/app/routers/problems.py - Assignments and contests → Database session: queries via
backend/app/routers/assignments.py - Assignments and contests → Domain models: uses entities
backend/app/routers/assignments.py - Student assignments → Assignments and contests: reuses logic
backend/app/routers/student_assignments.py - Student assignments → Database session: queries via
backend/app/routers/student_assignments.py - Submissions → Database session: queries via
backend/app/routers/submissions.py - Submissions → Domain models: uses entities
backend/app/routers/submissions.py - AI assistance → Database session: queries via
backend/app/routers/ai.py - AI assistance → Domain models: uses entities
backend/app/routers/ai.py - Classes → Database session: queries via
- Admin operations → Database session: queries via
backend/app/routers/auth.py - Database session → SQL Server: connects to
backend/app/database.py