How seoh0711/gemini-antigravity-study works
Purpose and Topology
This repository builds a curriculum-driven learning and exam-practice application. It contains a React learner UI, two alternative backend implementations, and a staged content-production workspace. The deployable primary stack appears to be a Cloudflare Worker API plus static frontend; a Python backend provides a parallel FastAPI-style implementation.
Application Entry Points
• Frontend bootstraps from app/frontend/src/main.tsx, renders application routing in app/frontend/src/App.tsx, and defines page routes in app/frontend/src/router.tsx.
• Cloudflare API entry is app/worker/src/index.ts, with application wiring in app/worker/src/app.ts.
• Python API entry is app/backend/main.py; database and seed bootstrapping reside in app/backend/database.py and app/backend/seed.py.
• Worker deployment/runtime settings are defined in app/worker/wrangler.toml.
Learner Frontend
The Vite/React TypeScript client implements public/authenticated learning, quizzes, challenges, notes, and progress views. It centralizes API communication and domain types under app/frontend/src/api/client.ts and app/frontend/src/api/types.ts; authentication state and route protection are handled by app/frontend/src/auth/AuthContext.tsx and app/frontend/src/components/RequireAuth.tsx.
Core user journeys are represented by pages:
• Learning syllabus/topic delivery: app/frontend/src/pages/Learn.tsx, app/frontend/src/pages/LearnTopic.tsx
• Quiz execution: app/frontend/src/pages/Quiz.tsx
• Challenge discovery/detail: app/frontend/src/pages/Challenges.tsx, app/frontend/src/pages/ChallengeDetail.tsx
• Aggregated learner progress: app/frontend/src/pages/Stats.tsx
API and Domain Boundary
The Worker API separates HTTP route handlers by learner domain: app/worker/src/routes/content.ts, app/worker/src/routes/quiz.ts, app/worker/src/routes/progress.ts, and app/worker/src/routes/challenges.ts. Authentication is implemented independently in app/worker/src/auth.ts and exposed through app/worker/src/routes/auth.ts.
The Python backend mirrors this domain partition—app/backend/routers/content.py, app/backend/routers/quiz.py, app/backend/routers/progress.py, and app/backend/routers/auth.py—with shared models, request/response schemas, and serializers in app/backend/models.py, app/backend/schemas.py, and app/backend/serializers.py. This duplication is an important implementation boundary: clients should target one deployed API contract, not combine both backends.
Assessment and Progress Flow
A learner requests content or a question set, submits answers to quiz/challenge endpoints, then receives grading and persistence-backed progress/statistics updates. Grading logic is explicit in app/worker/src/grading.ts and app/backend/grading.py; questions, quizzes, challenges, and progress each have dedicated routes. The frontend’s app/frontend/src/pages/Quiz.tsx and app/frontend/src/components/QuestionCard.tsx form the main answer-capture and feedback surface.
Data and Infrastructure
The Cloudflare Worker uses database access through app/worker/src/db.ts, with schema initialization in app/worker/migrations/0001_init.sql. Seed data is generated for that runtime by app/worker/scripts/gen-seed.mjs. The Python alternative has its own persistence layer at app/backend/database.py. Cloudflare deployment guidance is present in DEPLOY.md and .claude/skills/cloudflare-deploy/SKILL.md.
Curriculum Content Pipeline
_workspace is a staged authoring/validation pipeline rather than application runtime code:
• Curriculum structure and plans: _workspace/00_architect/syllabus-tree.json, _workspace/00_architect/content-plan.md
• Authored lessons: _workspace/10_content/content.json
• Questions and challenges: _workspace/20_questions/questions.json, _workspace/20_questions/challenges.json
• Content and integration QA outputs: _workspace/30_qa/content-qa-report.md, _workspace/40_qa/integration-qa-report.md
This pipeline produces structured curriculum and assessment assets intended to seed or populate the application’s content-serving and assessment domains.
Main entry points: App.tsx App and routing · db.ts Worker database access · client.ts API client and types · index.ts Worker entry and app
Components 21
Learner Frontend
React client for learning and practice.
- Frontend bootstrap
app/frontend/src/main.tsx - App and routing
app/frontend/src/App.tsx - Auth guard
app/frontend/src/auth/AuthContext.tsx - API client and types
app/frontend/src/api/client.ts - Learning views
app/frontend/src/pages/Learn.tsx - Quiz interaction · Captures answers and presents feedback.
app/frontend/src/pages/Quiz.tsx - Progress views
app/frontend/src/pages/Stats.tsx
Primary Worker API
Cloudflare Worker deployment target.
- Worker entry and app
app/worker/src/index.ts - Authentication
app/worker/src/routes/auth.ts - Content, quiz and progress routes
app/worker/src/routes/content.ts - Grading
app/worker/src/grading.ts - Worker database access
app/worker/src/db.ts - Database schema
app/worker/migrations/0001_init.sql
Alternative Python API
Parallel FastAPI-style implementation.
- Python API
app/backend/main.py - Mirrored domain routers · Alternative content, quiz, progress, and auth contract implementation.
app/backend/routers/content.py - Python grading
app/backend/grading.py - Python persistence
app/backend/database.py
Curriculum Pipeline
Staged authored content and QA assets.
- Curriculum plan
_workspace/00_architect/syllabus-tree.json - Authored lessons
_workspace/10_content/content.json - Questions and challenges
_workspace/20_questions/questions.json - Content and integration QA
_workspace/30_qa/content-qa-report.md
Connections 23
- Frontend bootstrap → App and routing: renders
- App and routing → Auth guard: protects routes
- App and routing → Learning views: routes to
- App and routing → Quiz interaction: routes to
- App and routing → Progress views: routes to
- Learning views → API client and types: loads content
- Quiz interaction → API client and types: submits answers
- Progress views → API client and types: loads statistics
- API client and types → Worker entry and app: primary API contract
- Worker entry and app → Authentication: mounts
- Worker entry and app → Content, quiz and progress routes: mounts
- Content, quiz and progress routes → Grading: grades submissions
- Content, quiz and progress routes → Worker database access: reads and writes
- Grading → Worker database access: persists outcomes
- Database schema → Worker database access: initializes
- Python API → Mirrored domain routers: mounts
- Mirrored domain routers → Python grading: grades submissions
- Mirrored domain routers → Python persistence: reads and writes
- Curriculum plan → Authored lessons: guides
- Authored lessons → Questions and challenges: drives assessments
- Questions and challenges → Content and integration QA: validated by
- Authored lessons → Worker database access: seeds content
- Questions and challenges → Worker database access: seeds assessments