How williamjaackson/tanda-hackathon-learning works
Purpose and deployment shape
This is an AI-assisted learning-platform monorepo: a React frontend lets users authenticate, create and consume courses/modules, take tests, view leaderboards, and interact with an AI coach. A Python backend exposes the application API and content-generation pipeline, backed by PostgreSQL. Dockerized services are coordinated through docker-compose.yaml, with images defined in backend/Dockerfile and frontend/Dockerfile.
Application entry points
• Backend process entry point: backend/main.py; shared database integration is centralized in backend/database.py.
• Frontend browser entry point: frontend/src/main.tsx, mounting the application defined in frontend/src/App.tsx.
• Environment-supplied runtime settings are expected through .env.example; PostgreSQL persistence is represented by postgres/.
Frontend application shell and access boundary
The SPA owns routing, page composition, and authenticated user state. frontend/src/contexts/AuthContext.tsx provides authentication state, while frontend/src/components/ProtectedRoute.tsx gates private course and learner workflows. frontend/src/components/Layout.tsx provides the shared authenticated application layout.
Primary user journeys are implemented as pages: course discovery/creation in frontend/src/pages/Courses.tsx and frontend/src/pages/CoursesCreate.tsx; course/module consumption in frontend/src/pages/CourseDetail.tsx, frontend/src/pages/ModuleView.tsx, and frontend/src/pages/ModuleLesson.tsx.
API boundary and domain routes
The backend is organized as route modules rather than a separate domain-service layer:
• Identity and session operations: backend/api/auth.py.
• Course/module lifecycle: backend/api/course.py.
• Assessment delivery and results: backend/api/test.py.
• AI conversation: backend/api/chat.py.
• Ranking/progress-facing leaderboard endpoint: backend/api/leaderboard.py.
The frontend crosses this HTTP boundary through typed/domain-oriented service modules, including frontend/src/services/auth.ts, frontend/src/services/course.ts, frontend/src/services/test.ts, and frontend/src/services/leaderboard.ts.
AI course-generation pipeline
Course authoring is materially AI-driven. Backend utilities indicate a staged pipeline: source PDF ingestion/summarization (backend/utils/pdf_summarizer.py), learning-module creation (backend/utils/module_generator.py), question/test generation (backend/utils/question_generator.py), and Manim-based visual/animation generation (backend/utils/manim_generator.py). These utilities are likely invoked behind course APIs in backend/api/course.py; generated content then feeds learner pages and assessment routes.
Learning, assessment, and learner feedback flow
A typical control flow is: authenticated learner uses the SPA → frontend services call backend course/test endpoints → backend reads or persists state via backend/database.py and PostgreSQL → course/module/test data returns to the relevant pages. Assessment-specific screens are separated into frontend/src/pages/CourseTest.tsx and frontend/src/pages/ModuleTest.tsx. AI coaching is a distinct interactive UI component, frontend/src/components/AICoach.tsx, backed by backend/api/chat.py.
Completion and ranking outputs
Course completion is surfaced through certificate UI components (frontend/src/components/Certificate.tsx, frontend/src/components/CertificateDialog.tsx, frontend/src/components/QRCodeDialog.tsx) and comparative learner results through frontend/src/pages/Leaderboard.tsx. These are presentation boundaries over backend-owned progress, test, and ranking data rather than independent persistence systems.
Main entry points: main.py API process · Layout.tsx Authenticated layout · auth.ts Typed API services · database.py Database integration
Components 19
Frontend SPA
Browser application and learner workflows.
- Browser entry
frontend/src/main.tsx - App shell & routing
frontend/src/App.tsx - Auth state
frontend/src/contexts/AuthContext.tsx - Protected routes
frontend/src/components/ProtectedRoute.tsx - Authenticated layout
frontend/src/components/Layout.tsx - Course learning UI · Discovery, authoring, course, module, and lesson pages.
frontend/src/pages/Courses.tsx - Assessment UI · Course and module test screens.
frontend/src/pages/CourseTest.tsx - Leaderboard UI
frontend/src/pages/Leaderboard.tsx - AI Coach
frontend/src/components/AICoach.tsx - Typed API services · Domain clients for auth, courses, tests, and rankings.
frontend/src/services/auth.ts
Backend API
Python HTTP routes and persistence boundary.
- API process
backend/main.py - Identity routes
backend/api/auth.py - Course routes · Course and module lifecycle, including generation.
backend/api/course.py - Assessment routes
backend/api/test.py - Coach & rankings · Chat and leaderboard endpoints.
backend/api/chat.py - Database integration
backend/database.py
AI Content Pipeline
Staged course-generation utilities.
- Content generation · PDF summarization, module, question, and Manim generation.
backend/utils/pdf_summarizer.py
Deployment
Containerized runtime and database.
- PostgreSQL · Persistent application data.
- Docker Compose
docker-compose.yaml
Connections 26
- Browser entry → App shell & routing: mounts
- App shell & routing → Auth state: provides state
- App shell & routing → Protected routes: routes through
- Protected routes → Authenticated layout: admits users to
- Authenticated layout → Course learning UI: hosts
- Authenticated layout → Assessment UI: hosts
- Authenticated layout → Leaderboard UI: hosts
- Authenticated layout → AI Coach: hosts
- Auth state → Typed API services: authenticates calls
- Course learning UI → Typed API services: loads and creates
- Assessment UI → Typed API services: delivers tests
- Leaderboard UI → Typed API services: loads rankings
- AI Coach → Coach & rankings: chat HTTP
- Typed API services → API process: HTTP API
- API process → Identity routes: routes
- API process → Course routes: routes
- API process → Assessment routes: routes
- API process → Coach & rankings: routes
- Course routes → Content generation: generates content
- Course routes → Database integration: persists courses
- Assessment routes → Database integration: stores results
- Coach & rankings → Database integration: reads learner data
- Identity routes → Database integration: manages identity
- Database integration → PostgreSQL: connects to
- Docker Compose → API process: runs backend
- Docker Compose → PostgreSQL: runs database