Build a desktop-first study focus platform for college students with:
- Pomodoro sessions and anti-distraction controls
- AI-assisted learning support
- O2O incentive loop: focus points -> print coupons
- User register/login with region/school/college binding
- Pomodoro session creation, completion, interruption
- Point ledger and balance tracking
- School/college leaderboards (daily/monthly/yearly)
- Daily question and AI chat (basic version)
- Coupon redeem order + QR verification simulation
- Frontend MVP dashboard for the full user flow
- Desktop guard skeleton for medium-strength anti-distraction
- Current frontend MVP: static SPA in
frontend/ - Desktop shell: Electron in
desktop/ - Backend: FastAPI
- Database: MySQL 8
- Cache: Redis (optional in MVP)
- AI adapter: OpenAI-compatible + Anthropic-compatible providers
Completed core schema in db/schema.sql:
app_userfocus_sessionpoint_ledgerdict_region,dict_school,dict_collegeredeem_order
Completed in backend/app:
- Auth APIs: register/login
- Dictionary APIs: region/school/college queries
- User APIs: get/update current profile
- Focus session APIs: start/complete/interrupt/abandon/list
- Point APIs: balance and ledger list
- Leaderboard API: day/month/year + school/college
- Learning APIs: daily question + AI chat adapter
- Redeem APIs: create/list/get/verify/cancel
- JWT auth dependency and SQLAlchemy session management
Completed in frontend/:
- Login form with quick-fill helper
- Register form with quick-fill helper
- User profile and summary metrics
- Focus session controls and active timer
- Session history panel
- Point balance and point ledger panel
- Leaderboard panel with period switching
- Daily question panel
- AI chat panel
- Redeem order create/verify/list panel
- Desktop guard status and event panel
- Local API base configuration and token persistence
Completed in desktop/:
- Electron shell bootstrap (
main.js,preload.js) - Medium-strength guard service (
guard/focusGuard.js) - Windows site-block script (
scripts/windows/siteBlock.ps1) - Frontend bridge hooks for guard events and auto-interrupt behavior
- Milestone A: Completed
- Milestone B: Completed
- Milestone C: Completed
- Milestone D: Completed
- Milestone E: Frontend MVP Completed
- Milestone F: Desktop Guard Skeleton Completed
- Schema migration scripts validated on MySQL 8
- Compile checks passed for backend modules
- End-to-end flow validated: register -> login -> focus -> points -> redeem -> verify
- End-to-end flow validated: register -> login -> learning/daily-question -> learning/ai-chat
- Frontend static delivery validated:
index.html,app.js,styles.cssreturn200 - Desktop JS syntax validated:
main.js,preload.js,guard/focusGuard.js - Windows site-block PowerShell script parsed successfully
- bcrypt for password hashing
- JWT with expiration and secret rotation support
- Server-side point calculation only
- Idempotency guard for redeem verification
- Audit-ready point ledger for deduction/refund events
- Frontend stores only token and lightweight UI state in
localStorage - Desktop site-block editing is isolated to a managed hosts section
backend/DEPLOYMENT.mdas runbook- systemd template in
backend/deploy/systemd/ - nginx template in
backend/deploy/nginx/ - bootstrap scripts in
backend/scripts/ - Frontend local runbook in
frontend/README.md - Desktop local runbook in
desktop/README.md
- Install Electron locally and run the first real desktop session test
- Add merchant role and permission boundaries for verify endpoint
- Add automated API tests and frontend smoke tests
- Add stronger desktop protections such as foreground-window checks and optional terminate-on-violation mode
- Upgrade the frontend MVP into Vue 3 + Electron packaging when the flow is frozen
- The project now supports two parallel focus-monitor modes:
- Website mode: detect leaving the study page, switching tabs, or switching windows after user consent
- Desktop mode: Electron-based app/site monitoring after user consent
- Website mode is the deployable cloud path for the Tencent Cloud web release.
- Desktop mode remains the stronger local option for demonstrations or stricter anti-distraction checks.
- Both modes now require explicit user permission before monitoring starts.
- The renamed Learning page remains the primary working surface after login.
- Learning page is being reduced to the essentials: core question content plus AI chat, without extra quiz chrome.
- Feedback copy is being simplified to shorter teacher-demo wording.
- The local plan notebook is now treated as a lightweight session checklist with completion and deletion actions.
- The website-mode leave-page grace window is now set to 15 seconds for less aggressive interruption during manual testing.
- Website mode now uses an explicit abandon popup on return so browser-side violations are visible in demos instead of relying only on background toasts.
- The renamed Learning page no longer exposes a public
Lock Modeselector; web demos now start with the default lock behavior behind the scenes to keep the form simpler. - The former daily-question page is now presented as Break Space so the main work surface can own the
Learningname without duplicate navigation labels. - AI chat now needs a stability layer on top of the provider integration so temporary empty-response failures do not immediately break the web demo.
- The Learning page should prefer automatic completion when the timer reaches zero, so the demo flow does not depend on an extra manual completion button.
- Ranking demos now need richer seed data so the leaderboard is visually convincing during local testing and cloud deployment.
- The default demo seed path should populate every major business table, not just users, focus sessions, and point ledger rows.
- The deployment runbook should explicitly mention the showcase seeding path so Tencent Cloud can be refreshed without manual SQL guessing.