Underground 2 Revived
Play Need for Speed: Underground 2 (2004) in Chrome and Firefox with WebGPU graphics, Web Audio, up to 120 fps widescreen, controller support, free roam and Online races with friends. Fan project, not
翻譯準備中
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Web-based Home Run Derby Pick 'Em League for John
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗A web app for running a fantasy baseball Home Run Derby league. Owners pick players from tiered groups, and the site tracks every team's home runs all season: standings, monthly races, player rankings, optimal lineups, win odds, and a monthly standings workbook emailed to each owner.
Scoring comes straight from MLB StatsAPI game logs, refreshed nightly, so the app matches the league host's own workbook game for game.
/{league}: overall and monthly standings, player rankings by group, optimal lineups, win odds, rules, and a page for every team. Past seasons are available with ?season=YYYY./admin: league and season settings, owner emails, entry status, exports, manual sync, and batch ingest.| Layer | Details |
|---|---|
| Framework | Next.js 16 (App Router), React 19, TypeScript |
| Database | PostgreSQL with Prisma 7 (@prisma/adapter-pg) |
| Styling and UI | Tailwind CSS 4, Arc UI components (src/components/arc/), lucide-react, motion |
| Validation | Zod |
| Spreadsheets | ExcelJS |
| Resend | |
| Data | MLB StatsAPI game logs |
| Tests | Vitest |
| Hosting | Vercel (with Vercel Cron) |
git clone https://github.com/aplaceforfacts/HRD4WEB.git
cd HRD4WEB
cp .env.example .env # then fill in the values below
npm install # also runs `prisma generate` (client goes to src/generated/)
npx prisma db push # fresh database: builds the schema from prisma/schema.prisma
npm run prisma:seed # creates league `hrd` for the current MLB season
npm run dev
Open http://localhost:3000, then run npm test to check everything works.
The migrations in
prisma/migrations/are incremental changes to a database that already existed, soprisma migrate deployonly works against an existing production database. Useprisma db pushfor a new one. Prisma 7 no longer loads.envby itself;prisma.config.tsandsrc/lib/prisma.tsload it throughdotenv.
| Variable | Required | Purpose |
|---|---|---|
DATABASE_URL | Yes | PostgreSQL connection string |
ADMIN_SECRET | Yes for admin | Password for /admin and Bearer token for scripts. Falls back to CRON_SECRET. Use a long random value. |
CRON_SECRET | Yes in production | Bearer token Vercel Cron sends to the cron routes |
RESEND_API_KEY | For emails | Resend API key for the monthly workbook |
EXPORT_FROM_EMAIL | For emails | Sender, e.g. Home Run Derby <[email protected]> |
PUBLIC_SITE_URL | For emails | Base URL used in email links |
EXPORT_SIGNING_SECRET | Optional | Signs unsubscribe links. Defaults to CRON_SECRET. |
NEXT_PUBLIC_APP_NAME | Optional | Site name shown in the UI |
LEGACY_LEAGUE_SLUG | Optional | League that old unscoped links (/standings, /team/...) redirect to. Defaults to hrd. |
Never commit .env. Only .env.example is tracked.
| Command | What it does |
|---|---|
npm run dev / build / start | Run, build and serve the app |
npm test | Run the Vitest suite |
npm run prisma:migrate / prisma:deploy | Create or apply migrations (existing databases) |
npm run prisma:seed | Seed league hrd |
npm run season:setup | Create a new season for a league |
npm run season:import-workbook | Import players and teams from the host's workbook |
npm run season:export-workbook | Build a standings workbook without emailing it |
npm run sync | Run the nightly scoring pipeline by hand |
npm run import:projections | Load projection CSVs |
npm run backfill:historical-stats | Backfill past seasons' stats |
vercel.json schedules two Vercel Cron jobs:
| Path | Schedule (UTC) | Job |
|---|---|---|
/api/admin/sync/run | 0 9 * * * | Nightly MLB game-log sync, scoring, odds and forecast snapshots |
/api/cron/monthly-export | 0 15 * * * | Sends any monthly workbook that has been closed for two days, and resumes interrupted sends |
Both routes are protected by the proxy and expect Authorization: Bearer <CRON_SECRET>, which Vercel Cron adds automatically.
Each year starts fresh: new owners, a new player pool, and the league's format carried over.
# 1. Create the season (pulls opening/closing day from MLB, copies groups and prize sheet)
npx tsx scripts/setup-season.ts hrd 2027
# 2. Load the player pool and teams from the host's workbook (dry run first)
npx tsx scripts/import-host-workbook.ts hrd 2027 "2027 Home Run Derby.xlsx"
npx tsx scripts/import-host-workbook.ts hrd 2027 "2027 Home Run Derby.xlsx" --commit
# 3. Projections and history for the entry form and forecasts
npx tsx scripts/import-projections.ts 2027 path/to/projections.csv
npx tsx scripts/backfill-historical-stats.ts 2025 2026
Then run a sync from /admin/sync, add owner emails on the season's admin page, and open entries. To start a second league:
npx tsx scripts/setup-season.ts office-derby 2027 "Office Home Run Derby"
The full yearly checklist, MLB ID overrides and email setup are in docs/OFFSEASON.md.
├── prisma/ # Schema, migrations, seed (prisma.config.ts at the root)
├── scripts/ # Season setup, imports, exports, manual sync
├── docs/ # Offseason guide and yearly checklist
├── src/
│ ├── app/
│ │ ├── [league]/ # Public pages: standings, players, optimal, odds, team, submit, rules
│ │ ├── admin/ # Commissioner area
│ │ └── api/ # admin, cron and public routes
│ ├── components/ # UI, including Arc components
│ ├── lib/ # Admin auth, login throttle, Prisma client, helpers
│ ├── server/ # Entries, scoring, stats sync, odds, forecasts, export, email
│ └── proxy.ts # Gates /admin, /api/admin and /api/cron
└── tests/ # Vitest suites
/admin, /api/admin/* and /api/cron/* are gated by the Next.js proxy (src/proxy.ts). Browser sessions use a signed, expiring, httpOnly cookie; scripts and cron use a Bearer secret. Secrets are compared in constant time./api/admin/login.X-Frame-Options, X-Content-Type-Options, HSTS, and others).No license has been specified yet. Until one is added, all rights are reserved by the author.