A React + Vite app that loads CSSBattle battle and daily targets from Supabase with lazy loading, cache-aware refresh, and responsive browsing.
- Browse
battleanddailytargets from Supabase. - Lazy loading with automatic scroll-triggered page fetches.
- Cache-aware refresh that prepends newly published targets.
- Light, dark, and system theme modes.
- Header version label sourced from
package.json.
- React 18
- Vite 5
- Supabase JavaScript client
- ESLint 9 (flat config)
- Node.js
>=24 <25 - npm
Copy-Item .env.example .env
# Then set VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY in .env
npm install
npm run devnpm run dev # Start development server
npm start # Alias for development server
npm run lint # Run ESLint
npm run build # Create production build in dist/
npm run preview # Preview production build locally- Source tables:
battle_targets,daily_targets - UI mode switch: Battle / Daily
- Cache strategy: localStorage (per mode)
- Revalidation windows (UTC):
01:00and18:00
- Follow repository rules in
AGENTS.md. - Keep
CHANGELOG.md,package.json, andpackage-lock.jsonaligned before release. - Create release tags in format
v*.*.*(example:v2.1.0).
CIworkflow runs lint and production build on pushes/PRs tomain.Releaseworkflow runs onv*.*.*tags, generates release notes, publishes GitHub Releases, and deploys via FTP.- In GitHub Actions, Vite build values are injected via repository secrets:
VITE_SUPABASE_URLVITE_SUPABASE_ANON_KEY
- Local development continues to use
.env.
The release workflow is composed from reusable actions under .github/actions:
build-react-appgenerate-release-notesnotify-discord-releasedeploy-ftp
Manual FTP deploy is available via Actions -> Release -> Run workflow and optional ref input.
- Use only the Supabase anon key in frontend apps.
- Never expose the Supabase service role key in this project.