How kubellingham/study-kube works
Studying Kube turns student-provided course materials into structured subjects for guided study. The main workflow is material intake, AI-assisted course building, then learning through lessons and practice; the README also describes exams, flashcards, glossary, mistakes review, and an in-lesson tutor. Billing, access control, and crew membership support those learning capabilities. Several UI and API paths are represented from the tree and README, but their implementation was not sampled; uncertain connections are omitted or marked unverified.
Main entry points: route.ts Course ingestion · page.tsx Course workspace · entitlement-server.ts Server access checks · admin.ts Server Firebase
Components 28
Course intake
- Add material
app/learn/components/AddMaterial.tsx - Course ingestion
app/api/course/ingest/route.ts - Material extraction
lib/ingest/client-extract.ts - Course generation
lib/course/generate.ts - Lesson verification
lib/course/verify.ts - Course model
lib/course/types.ts - Course registry
lib/course/index.ts
Learning experience
- Course shelf
app/learn/page.tsx - Course workspace
app/learn/[courseId]/page.tsx - Lessons and tutor
app/learn/[courseId]/lesson/[topicId]/page.tsx - Practice gym
app/learn/[courseId]/practice/page.tsx - Mock exams
app/learn/[courseId]/exam/page.tsx - Flashcards
app/api/course/flashcards/route.ts - Learning progress
lib/learn/progress.ts - Mistakes review
lib/learn/mistakes.ts - Glossary
lib/learn/glossary.ts - Tutor chat API
app/api/learn/chat/route.ts
Platform services
- OpenRouter client
lib/openrouter.ts - Client Firebase
lib/firebase/client.ts - Server Firebase
lib/firebase/admin.ts - API authentication
lib/api-helpers.ts - AI usage meter
lib/usage.ts - Spend limits
lib/spend.ts
Access and billing
- Server access checks
lib/entitlement-server.ts - Entitlement policy
lib/entitlement.ts - Subscription updates
app/api/stripe/webhook/route.ts - Crew membership
lib/crew.ts
Other components
- Student
Connections 28
- Student → Add material: provides materials
README.md - Add material → Course ingestion: submits upload
- Course ingestion → Course generation: builds course
app/api/course/ingest/route.ts - Course ingestion → Lesson verification: verifies lessons
app/api/course/ingest/route.ts - Course generation → OpenRouter client: calls model
lib/course/generate.ts - Course ingestion → Server Firebase: stores course
app/api/course/ingest/route.ts - Course ingestion → Material extraction: extracts content
- Course shelf → Client Firebase: reads courses
app/learn/page.tsx - Course shelf → Learning progress: loads progress
app/learn/page.tsx - Course workspace → Client Firebase: reads course data
app/learn/[courseId]/page.tsx - Course workspace → Learning progress: uses progress
app/learn/[courseId]/page.tsx - Course workspace → Mistakes review: uses review data
app/learn/[courseId]/page.tsx - Course workspace → Glossary: uses course terms
- Student → Practice gym: practices topics
README.md - Student → Mock exams: takes exams
README.md - Student → Flashcards: reviews cards
README.md - Student → Lessons and tutor: studies lessons
README.md - Student → Tutor chat API: asks tutor
README.md - Tutor chat API → Server access checks: checks access
app/api/learn/chat/route.ts - Tutor chat API → OpenRouter client: requests response
app/api/learn/chat/route.ts - Server access checks → API authentication: authenticates user
lib/entitlement-server.ts - Server access checks → Server Firebase: reads grants
lib/entitlement-server.ts - Server access checks → Entitlement policy: resolves tier
lib/entitlement-server.ts - Subscription updates → Server Firebase: updates records
app/api/stripe/webhook/route.ts - Subscription updates → Entitlement policy: updates access
app/api/stripe/webhook/route.ts - Subscription updates → Crew membership: updates crew
app/api/stripe/webhook/route.ts - Spend limits → Server Firebase: checks usage
lib/spend.ts - Spend limits → Entitlement policy: checks tier
lib/spend.ts