How sarraayed1809-max/ai-study-buddy-v1 works
StudyBuddy AI is a signed-in study companion: learners use a focus timer and study tools, build AI-generated plans and quizzes, and earn progress for a customizable virtual pet. The React app also provides a pet shop, streaks, and study history; account data is synchronized through Firebase, while AI generation is served by the Express backend using Gemini with fallback content. The principal UI responsibilities mostly live together in src/App.tsx. The excerpts do not show its API request code, so those backend links are marked unverified.
Main entry points: App.tsx Study dashboard · AuthContext.tsx Authentication · useCloudSync.ts Cloud synchronization · server.ts Study API
Components 20
Study experience
- Study dashboard
src/App.tsx - Focus timer
src/App.tsx - AI study planner
src/App.tsx - Quiz workflow
src/App.tsx - Pet progression
src/App.tsx - Pet shop
src/App.tsx - Pet renderer
src/components/PetVisual.tsx - Study data types
src/types.ts
Identity and data
- Sign-in form
src/components/Login.tsx - Authentication
src/contexts/AuthContext.tsx - Firebase setup
src/firebase.ts - Cloud synchronization
src/hooks/useCloudSync.ts - Firestore
- Browser local storage
AI services
- Study API
server.ts - Plan generation
server.ts - Quiz generation
server.ts - Gemini
App presentation
- React entry
src/main.tsx
Other components
- Learner
Connections 25
- Learner → React entry: opens app
- React entry → Study dashboard: renders
src/main.tsx - React entry → Authentication: provides context
src/main.tsx - Study dashboard → Focus timer: presents
src/App.tsx - Study dashboard → AI study planner: presents
src/App.tsx - Study dashboard → Quiz workflow: presents
src/App.tsx - Study dashboard → Pet progression: manages
src/App.tsx - Study dashboard → Pet shop: presents
src/App.tsx - Study dashboard → Pet renderer: renders
src/App.tsx - Study dashboard → Sign-in form: renders
src/App.tsx - Sign-in form → Authentication: calls sign-in
src/components/Login.tsx - Authentication → Firebase setup: uses services
src/contexts/AuthContext.tsx - Study dashboard → Cloud synchronization: uses sync hooks
src/App.tsx - Cloud synchronization → Firebase setup: uses database
src/hooks/useCloudSync.ts - Cloud synchronization → Firestore: loads and saves
src/hooks/useCloudSync.ts - Authentication → Firestore: uses Firebase services
- Study dashboard → Firestore: writes user data
src/App.tsx - Study dashboard → Browser local storage: reads and writes
src/App.tsx - Study dashboard → Study API: requests AI results
- Study API → Plan generation: routes plan requests
server.ts - Study API → Quiz generation: routes quiz requests
server.ts - Plan generation → Gemini: generates plan
server.ts - Quiz generation → Gemini: generates quiz
server.ts - Study dashboard → Study data types: uses data shapes
src/App.tsx - Pet renderer → Study data types: uses pet type
src/components/PetVisual.tsx