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
Fantasy baseball home run competition
Translation pending
GamesTypeScript · CSSGitHub @aplaceforfactsOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
Web-based Home Run Derby Pick 'Em League for John
Translation pending
Taken from the repository README
Loading the full README.
Read the full 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.