How rat-sh/focus_discussion works
Focus Lock is a study-room product for group study and teaching, with social/library features and an on-device attention-tracked focus timer. The primary journey is to enter the app, choose a room or configure a focus session, then use live-room collaboration or track session quality and review results. The graph includes documented capabilities whose detailed implementation was not sampled; those branches are intentionally not connected where call relationships cannot be verified. Backend and some feature internals are only partially evidenced.
Main entry points: App.tsx App routes and shell · app.ts HTTP API application · routes.ts Rooms API · mediapipeEngine.ts On-device vision
Components 34
Client app
- App routes and shell
src/app/App.tsx - Sign-in and identity
src/shared/context/auth.tsx - Rooms and sessions
src/features/rooms/RoomsPage.tsx - Live room
src/features/room/RoomPage.tsx - Live connection
src/features/room/useLiveRoomConnection.ts - Friends and profiles
src/features/friends/FriendsPage.tsx - Study library
src/features/materials/MaterialsPage.tsx - Scheduling
src/features/schedule/SchedulePage.tsx - Recap and stats
src/features/recap/RecapPage.tsx
Focus Lock
- Focus setup
src/features/focus/FocusSetupPage.tsx - Focus session UI
src/features/focus/FocusSessionPage.tsx - Session orchestration
src/features/focus/useFocusSession.ts - On-device vision
src/features/focus/engine/mediapipeEngine.ts - Attention classifier
src/features/focus/engine/classify.ts - Mock detector
src/features/focus/engine/mockEngine.ts - Quality scoring
src/domain/focus.ts
Backend services
- HTTP API application
server/src/app.ts - Authentication API
server/src/features/auth/routes.ts - Authentication service
server/src/features/auth/service.ts - Rooms API
server/src/features/rooms/routes.ts - Room workflows
server/src/features/rooms/service.ts - Room persistence
server/src/features/rooms/repo.ts - Focus API
server/src/features/focus/routes.ts - Focus workflows
server/src/features/focus/service.ts - Friends API
server/src/features/friends/routes.ts - Materials API
server/src/features/materials/routes.ts - Schedule API
server/src/features/schedule/routes.ts - Profiles API
server/src/features/profiles/routes.ts - YouTube search API
server/src/features/youtube/routes.ts - Request throttling
server/src/middleware/rateLimit.ts
Data and integrations
- Product domain types
src/domain/types.ts - UI data contract
src/data/repositories.ts - Supabase repositories
src/data/supabase/repos.ts
Other components
- Learner or host
Connections 36
- Learner or host → App routes and shell: opens
src/app/App.tsx - App routes and shell → Sign-in and identity: provides identity
src/app/App.tsx - App routes and shell → Rooms and sessions: routes to
src/app/App.tsx - App routes and shell → Live room: routes to
src/app/App.tsx - App routes and shell → Friends and profiles: routes to
src/app/App.tsx - App routes and shell → Study library: routes to
src/app/App.tsx - App routes and shell → Scheduling: routes to
src/app/App.tsx - App routes and shell → Recap and stats: routes to
src/app/App.tsx - App routes and shell → Focus setup: routes to
src/app/App.tsx - App routes and shell → Focus session UI: routes to
src/app/App.tsx - Live connection → Live room: supports
src/features/room/useLiveRoomConnection.ts - Focus setup → Focus session UI: starts
- Session orchestration → Quality scoring: scores sessions
src/features/focus/useFocusSession.ts - Session orchestration → On-device vision: selects engine
src/features/focus/useFocusSession.ts - On-device vision → Attention classifier: classifies signals
src/features/focus/engine/mediapipeEngine.ts - Mock detector → Product domain types: implements contract
src/features/focus/engine/mockEngine.ts - On-device vision → Product domain types: implements contract
src/features/focus/engine/mediapipeEngine.ts - Quality scoring → Product domain types: uses domain types
src/domain/focus.ts - App routes and shell → HTTP API application: serves feature APIs
server/src/app.ts - Authentication API → Authentication service: delegates to
server/src/features/auth/routes.ts - Authentication service → Authentication API: returns results
server/src/features/auth/service.ts - Rooms API → Room workflows: delegates to
server/src/features/rooms/routes.ts - Rooms API → Room persistence: checks membership
server/src/features/rooms/routes.ts - Room workflows → Room persistence: uses persistence
server/src/features/rooms/service.ts - Focus API → Focus workflows: delegates to
server/src/features/focus/routes.ts - Friends API → HTTP API application: mounted by
server/src/app.ts - Materials API → HTTP API application: mounted by
server/src/app.ts - Schedule API → HTTP API application: mounted by
server/src/app.ts - Profiles API → HTTP API application: mounted by
server/src/app.ts - YouTube search API → HTTP API application: mounted by
server/src/app.ts - YouTube search API → Learner or host: searches YouTube
server/src/features/youtube/routes.ts - Authentication API → Request throttling: throttles requests
server/src/features/auth/routes.ts - Rooms API → Request throttling: throttles requests
server/src/features/rooms/routes.ts - Focus API → Request throttling: throttles writes
server/src/features/focus/routes.ts - Learner or host → UI data contract: requests product data
- UI data contract → Supabase repositories: can use live data