How jaynik-s/focusarc works
FocusArc is a course-based study-time tracker. Users manage course timers, start and stop sessions, then review schedule/history views and daily or weekly analytics. The React app gates private pages through authentication and a shared API client; FastAPI routes delegate persistence and reporting to service modules backed by SQLAlchemy models and PostgreSQL. The README documents the major reporting and day-summary capabilities; where their exact internal wiring was not sampled, the graph shows documented boundaries without assuming implementation details.
Main entry points: router.py API router · App.tsx App routing · apiClient.ts API client · stats.py Stats services
Components 28
Web application
- App routing
frontend/src/App.tsx - Auth state
frontend/src/contexts/AuthContext.tsx - API client
frontend/src/api/apiClient.ts - Timer runtime
frontend/src/context/TimerRuntimeContext.tsx - Course timers
frontend/src/routes/TimersPage.tsx - Schedule view
frontend/src/routes/SchedulePage.tsx - Session history
frontend/src/routes/HistoryPage.tsx - Analytics view
frontend/src/routes/StatsPage.tsx - Timer data hook
frontend/src/hooks/useTimers.ts - Session data hook
frontend/src/hooks/useSessions.ts - Reporting hooks
frontend/src/hooks/useAverages.ts
API and services
- FastAPI app
backend/app/main.py - API router
backend/app/api/router.py - Access checks
backend/app/auth.py - Timer endpoints
backend/app/api/timers.py - Session endpoints
backend/app/api/sessions.py - End day
backend/app/api/end_day.py - Stats endpoints
backend/app/api/stats.py - Totals endpoints
backend/app/api/totals.py - Timer services
backend/app/services/timers.py - Session services
backend/app/services/sessions.py - Stats services
backend/app/services/stats.py - DB session
backend/app/db.py
Study data
- Course timers
backend/app/models/timer.py - Study sessions
backend/app/models/session.py - Day summaries
backend/app/models/day_summary.py - PostgreSQL
Other components
- Student
Connections 33
- Student → App routing: uses
- App routing → Auth state: gates pages
- App routing → Course timers: routes to
- App routing → Schedule view: routes to
- App routing → Session history: routes to
- App routing → Analytics view: routes to
- Auth state → API client: validates through
- Timer runtime → API client: requests
- Session data hook → API client: requests
- Reporting hooks → API client: requests
- Timer data hook → API client: requests
- API client → FastAPI app: HTTP requests
- FastAPI app → API router: mounts
- API router → Access checks: checks identity
- API router → Timer endpoints: dispatches
- API router → Session endpoints: dispatches
- API router → End day: dispatches
- API router → Stats endpoints: dispatches
- API router → Totals endpoints: dispatches
- Timer endpoints → Timer services: delegates
- Session endpoints → Session services: delegates
- End day → Session services: delegates
- Stats endpoints → Stats services: delegates
- Totals endpoints → Stats services: delegates
- Timer services → DB session: queries and writes
- Session services → DB session: queries and writes
- Stats services → DB session: aggregates data
- DB session → PostgreSQL: reads and writes
- Timer services → Course timers: uses
- Session services → Study sessions: uses
- Stats services → Study sessions: aggregates
- Stats services → Day summaries: upserts summaries
- Study sessions → Course timers: references