How git-commit-shilpa/sudybuddy works
StudyBuddy is a local-first study companion: learners organize courses, upload learning materials, and generate grounded notes, quizzes, flashcards, and revision plans. The main workflow runs from the React course/materials interface through the API, document extraction and optional media reading, then background generation and persistent results. Course content and study artifacts are stored in SQLite; local Ollama and Whisper provide AI capabilities. The graph combines excerpted calls with README-documented behavior; some frontend-to-API and scheduling details are documented rather than directly visible in sampled source.
Main entry points: client.ts API client · App.tsx React routes · db.py Database access · media_processing.py Media reading
Components 28
Study interface
- React routes
frontend/src/App.tsx - Course workspace
frontend/src/pages/CoursePage.tsx - Materials
frontend/src/pages/MaterialsTab.tsx - Study content
frontend/src/pages/ContentTabs.tsx - Quiz player
frontend/src/pages/QuizPlay.tsx - Flashcard study
frontend/src/pages/FlashcardStudy.tsx - Notes viewer
frontend/src/pages/NotesViewer.tsx - Revision plan
frontend/src/pages/SchedulePage.tsx - AI settings
frontend/src/pages/SettingsPage.tsx - API client
frontend/src/api/client.ts
Course API
- REST endpoints
backend/app/routers/core.py - Content endpoints
backend/app/routers/content.py
Material reading
- Document parser
backend/app/ingestion/parsers.py - Media extraction
backend/app/ingestion/media.py - Media reading
backend/app/services/media_processing.py - Image preparation
backend/app/ingestion/imaging.py - Speech transcription
backend/app/ai/speech.py
Study generation
- Background generation
backend/app/services/generation.py - Citation grounding
backend/app/ai/grounding.py - Task prompts
backend/app/ai/prompts.py - Revision planner
backend/app/scheduler/planner.py - Ollama client
backend/app/ai/client.py
Local persistence
- Database access
backend/app/db.py - Study records
backend/app/models/__init__.py - SQLite database
Other components
- Learner
- Ollama
- Whisper model
Connections 38
- Learner → React routes: uses
frontend/src/App.tsx - React routes → Course workspace: routes to
frontend/src/App.tsx - React routes → Quiz player: routes to
frontend/src/App.tsx - React routes → Flashcard study: routes to
frontend/src/App.tsx - React routes → Notes viewer: routes to
frontend/src/App.tsx - React routes → Revision plan: routes to
frontend/src/App.tsx - React routes → AI settings: routes to
frontend/src/App.tsx - Course workspace → Materials: renders
frontend/src/pages/CoursePage.tsx - Course workspace → Study content: renders
frontend/src/pages/CoursePage.tsx - Materials → API client: requests
frontend/src/api/client.ts - Study content → API client: requests
frontend/src/api/client.ts - Quiz player → API client: requests
frontend/src/api/client.ts - Flashcard study → API client: requests
frontend/src/api/client.ts - Notes viewer → API client: requests
frontend/src/api/client.ts - Revision plan → API client: requests
frontend/src/api/client.ts - AI settings → API client: requests
frontend/src/api/client.ts - API client → REST endpoints: HTTP requests
frontend/src/api/client.ts - API client → Content endpoints: HTTP requests
- REST endpoints → Document parser: parses uploads
backend/app/routers/core.py - REST endpoints → Media reading: queues reading
backend/app/routers/core.py - Document parser → Media extraction: finds embedded media
backend/app/ingestion/parsers.py - Media reading → Image preparation: prepares images
backend/app/services/media_processing.py - Media reading → Speech transcription: transcribes audio
backend/app/services/media_processing.py - Media reading → Ollama client: requests image reading
backend/app/services/media_processing.py - Speech transcription → Whisper model: transcribes with
- Ollama client → Ollama: sends requests
backend/app/ai/client.py - Content endpoints → Background generation: starts jobs
backend/app/routers/content.py - Content endpoints → Revision planner: creates plans
backend/app/routers/content.py - Background generation → Task prompts: uses
backend/app/services/generation.py - Background generation → Citation grounding: validates output
backend/app/services/generation.py - Background generation → Ollama client: generates content
backend/app/services/generation.py - REST endpoints → Database access: reads and writes
backend/app/routers/core.py - Content endpoints → Database access: reads and writes
backend/app/routers/content.py - Background generation → Database access: reads and writes
backend/app/services/generation.py - Revision planner → Database access: persists plans
- Media reading → Database access: stores extracted text
backend/app/services/media_processing.py - Database access → Study records: maps records
backend/app/db.py - Database access → SQLite database: persists data
backend/app/db.py