BikeControl (SwiftControl)
使用 Zwift Click、Zwift Play、Shimano Di2 或任何藍牙控制器,搭配 MyWhoosh、Rouvy、Zwift 等。iOS、Android、Windows、macOS 均可免費試用。
AI 翻译
尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证正在加载完整 README。 以下为已保存的摘录。
An in-depth fantasy football stats dashboard. Next.js, backed by Postgres via Prisma, on
Vercel — the same setup used by coaching-dash, board-game-night and
honeymoon-research in this folder. Rosters (which players are on which team) live in the
database, not the browser, so they survive a cleared cache or a new device. Player identity,
status/injury info, and weekly stats are synced from Sleeper, free, no API key.查看完整 README ↗An in-depth fantasy football stats dashboard. Next.js, backed by Postgres via Prisma, on
Vercel — the same setup used by coaching-dash, board-game-night and
honeymoon-research in this folder. Rosters (which players are on which team) live in the
database, not the browser, so they survive a cleared cache or a new device. Player identity,
status/injury info, and weekly stats are synced from Sleeper, free, no API key.
Sleeper has two relevant hosts:
api.sleeper.app/v1 — documented, stable public API. Used here for player identity/status
(/players/nfl, ~12k players) and the current NFL week (/state/nfl). Sleeper asks that the
players endpoint only be called about once a day, since it's a ~15MB payload.api.sleeper.com — undocumented (it's what Sleeper's own app calls), but it's the only place
that still serves weekly stats; Sleeper pulled the stats endpoint from the documented v1 API at
their data provider's request. GET /stats/nfl/{season}/{week}?season_type=regular returns
every stat category Sleeper tracks per player per week (passing/rushing/receiving/defense/
kicking/punting, snap counts, red zone usage, PPR/half-PPR/standard points — 200+ possible
fields), which is what "mirror Sleeper's stats" is built on.Both are free and need no auth, but api.sleeper.com is undocumented — if Sleeper ever changes
its shape, src/lib/sleeper.ts is the one place that would need updating.
Neither Sleeper host carries real kickoff times (their stats/projections payloads only have a bare
date). For that, the Matchups page calls ESPN's free public scoreboard API
(site.api.espn.com, also undocumented, also no key) — see src/lib/espn-schedule.ts. It's called
live per page view (cached 1 hour via Next's fetch cache), not synced into the database.
prisma/schema.prisma:
Team — a fantasy team.Player — one row per real NFL player, id = Sleeper's own player_id (so re-syncing is a
plain upsert). fantasyTeamId points at the team that currently rosters them; null means a
free agent.PlayerStatLine — one row per player per week. stats keeps Sleeper's entire raw stat blob
(it varies a lot by position) as JSON, with ptsStd/ptsPpr/ptsHalfPpr pulled out as columns
since every view needs to sort on those.SyncState — a singleton row tracking the last successful sync (season/week/timestamp), so
the UI knows what it's showing without calling Sleeper on every page load.src/lib/sleeper.ts — the Sleeper API client.src/lib/sync.ts — syncSleeperData(): pulls players + the current week's stats and bulk-
upserts both (raw SQL INSERT ... ON CONFLICT, batched, since Prisma has no native upsert-many).
Pass { backfillWeeks: true } once to pull every earlier week of the season too.src/app/api/sync/route.ts — the route the daily cron hits. Checks the CRON_SECRET header
Vercel sends on cron requests so randos can't trigger a sync.src/app/actions.ts — server actions for creating teams, reassigning a player to a different
team or free agency, and a manual runManualSync (used by the "Sync now" button on the page —
the same function the cron calls, just triggered by hand).vercel.json — the cron: once a day. Why daily, not hourly: Vercel's free Hobby plan caps
cron jobs at once per day; hourly needs the paid Pro plan. Keeping this free was the point.DATABASE_URL and DATABASE_URL_UNPOOLED automatically for all environments.
Note: creating the database alone isn't enough — click Connect to Project on the
database itself (Storage → your database) so it actually attaches to this Vercel project.CRON_SECRET. Project → Settings → Environment Variables → add CRON_SECRET with
a random value (openssl rand -hex 32), for Production (and Preview/Development if you want
the cron tested there too). Vercel automatically sends it as a header on cron-triggered
requests to /api/sync — you don't wire anything else up.prisma generate && prisma migrate deploy && next build, see package.json) creates the
tables on the first deploy by applying prisma/migrations/.vercel.json, currently 13:00 UTC) keeps the current week current
automatically — no more manual syncs needed.npm install
vercel env pull .env # once the project is linked + the database is attached
npm run dev
.env.example shows the shape of .env if you'd rather point at your own local Postgres instead.