尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證製作者的介紹僅有上面的一句話。 更多詳情請閱讀儲存庫 README。 儲存庫 README ↗
正在載入完整 README。
檢視完整 README ↗Real-time focus accountability built on Claude vision. Screen + camera analysis, live focus score, AI coaching report, study rooms with leaderboards, weekly wagers, and a real video lapse of every session.
npm run setup # installs deps, generates Prisma client, pushes schema, copies .env
# edit .env to add your ANTHROPIC_API_KEY and a NEXTAUTH_SECRET
npm run dev # Next.js on :3000 + socket server on :3001
Open http://localhost:3000, click Get started, and create an account at /signup. From there start a focus session at /session.
If the UI ever looks unstyled / "text-only", run
npm run setupagain. That regenerates the Prisma client and clears Next.js's stale cache — the two most common culprits.
The standalone planner files are focus-app.html, focus-app.css, focus-logic.js, focus-auth.js, and firebase-config.js. The planner now uses Firebase email/password auth and keeps timer runtime in local storage, so a refresh will restore an active timer.
To move an old local planner into a public account:
focus-app.html locally and go to Settings → Backup Data → Export backup.firebase-config.js.{
"rules": {
"users": {
"$uid": {
".read": "auth != null && auth.uid === $uid",
".write": "auth != null && auth.uid === $uid"
}
}
}
}
users/<firebase uid>/plannerState in Realtime Database and also keep a local browser cache.| Variable | Required? | What it does |
|---|---|---|
ANTHROPIC_API_KEY | Yes | Powers live focus analysis + the end-of-session coaching report. |
NEXTAUTH_SECRET | Yes | Encrypts the auth session cookie. openssl rand -base64 32 works. |
DATABASE_URL | Yes | Defaults to a local SQLite file. Swap for Postgres in production. |
GOOGLE_CLIENT_ID / GITHUB_CLIENT_ID | Optional | Only needed if you want Google / GitHub OAuth. Email + password works without them. |
Focus AI is a standard Next.js app and deploys cleanly to Vercel, Render, Railway, Fly, or anywhere that runs Node 20.
goat-app.vercel-build (prisma generate && prisma db push --accept-data-loss && next build).NEXTAUTH_URL = your Vercel URL.The Socket.io leaderboard server (server/index.js) is a separate process — deploy it on Render / Fly / Railway as a Node service and set NEXT_PUBLIC_SOCKET_URL to its public URL. The web app works without it; only live room leaderboards need it.
npm install
npx prisma generate
npx prisma db push --accept-data-loss # or `prisma migrate deploy` with migrations
npm run build
npm run start
# in another process:
npm run server
Put it behind a reverse proxy (Caddy / Nginx) with HTTPS — getDisplayMedia and getUserMedia only work on https:// (or localhost).
/session.runImmediateAnalysis():
/api/analyze-frame.focusScore, isFocused, distractions, behaviors, summary) updates Zustand state, the live ring score, and the action log..webm video lapse client-side via MediaRecorder (no upload, no storage cost). The session and AI report are persisted via PATCH /api/session.src/
├── app/
│ ├── login/, signup/ # Email + password auth
│ ├── session/page.tsx # The focus session UI
│ ├── api/analyze-frame/route.ts # Claude vision endpoint
│ ├── api/session/route.ts # Start / end + coaching report
│ ├── api/auth/register/route.ts # Account signup (PBKDF2 password)
│ └── api/auth/[...nextauth]/route.ts # NextAuth handler (credentials + OAuth)
├── components/session/FocusRuntimeProvider.tsx # The 4s analysis loop + alerts
├── lib/openai.ts # Claude prompts + robust JSON parsing
├── lib/auth.ts # NextAuth config + PBKDF2 helpers
├── lib/createTimelapse.ts # Side-by-side webm lapse builder
└── store/sessionStore.ts # Zustand session state
Prisma schema in prisma/schema.prisma. Every focus session stores a row in FocusSession, every AI-analyzed frame in FrameAnalysis, and the end-of-session coaching report in SessionReport. Raw screenshots and camera frames are never stored — only the AI's structured analysis. Timelapse video is built and held in the browser.
| Layer | Tool |
|---|---|
| Frontend | Next.js 14 (App Router), React, Tailwind CSS |
| State | Zustand |
| Real-time | Socket.io (rooms + leaderboards) |
| Auth | NextAuth credentials provider (PBKDF2) + optional Google / GitHub |
| Database | Prisma — SQLite for dev, Postgres for prod |
| AI | Claude Sonnet 4.5 (vision + reasoning) |
| Charts | Recharts |
| Video | Browser-native MediaRecorder + <canvas> |