Remaking my first big project (2018) into something cool! A cozy cow farming game built with React and Supabase for cloud saves.
- Original Scratch ver: https://scratch.mit.edu/projects/225887048/
- Openprocessing rewrite (abandoned): https://openprocessing.org/sketch/639290
- Node.js v18+ (recommended: use nvm)
- npm v9+
- Docker (required for local Supabase)
- Supabase CLI (installed automatically as dev dependency)
npm installThe game works offline without Supabaseβcloud saves are optional.
npm startOpen http://localhost:3000 in your browser.
Ensure Docker Desktop (or Docker daemon) is running.
cd supabase
npx supabase startThis spins up a local Supabase stack with:
- API: http://127.0.0.1:54321
- Studio: http://127.0.0.1:54323 (database GUI)
- Database: localhost:54322
npm run db:pushCreate a .env.local file in the project root:
# .env.local
REACT_APP_SUPABASE_URL=http://127.0.0.1:54321
REACT_APP_SUPABASE_ANON_KEY=<your-local-anon-key>Get your local anon key by running:
cd supabase
npx supabase statusLook for anon key in the output.
npm start- Go to supabase.com and create a new project
- Note your Project URL and anon public key from Settings β API
npm run supabase:linkEnter your project reference ID when prompted (found in project settings).
npm run db:pushCreate a .env.local file:
# .env.local
REACT_APP_SUPABASE_URL=https://your-project.supabase.co
REACT_APP_SUPABASE_ANON_KEY=your-anon-keynpm start| Command | Description |
|---|---|
npm start |
Start development server |
npm run build |
Build for production |
npm test |
Run tests in watch mode |
npm run db:push |
Push migrations to database |
npm run db:reset |
Reset database ( |
npm run db:diff |
Generate migration from schema changes |
npm run db:migrate |
Create a new migration file |
npm run supabase:link |
Link to remote Supabase project |
βββ public/ # Static assets (images, sounds)
βββ src/
β βββ components/ # React components
β βββ config/ # Game configuration
β βββ engine/ # Game logic, state, reducers
β βββ pages/ # Page components (pasture, crafting)
β βββ save/ # Supabase client & sync services
βββ supabase/
β βββ config.toml # Local Supabase configuration
β βββ migrations/ # Database migrations
βββ package.json
| Variable | Required | Description |
|---|---|---|
REACT_APP_SUPABASE_URL |
No | Supabase project URL |
REACT_APP_SUPABASE_ANON_KEY |
No | Supabase anonymous key |
Note: Cloud saves are disabled if these are not set. The game works fully offline.
cd supabase
npx supabase stopTo stop and reset all data:
npx supabase stop --no-backupThis is normal if you haven't set up cloud saves. The game works without it.
- Ensure Docker is running
- Try
docker system pruneto free up resources - Restart Docker Desktop
Check that local Supabase is running:
cd supabase
npx supabase status- Frontend: React 18, TypeScript, CSS Modules
- Backend: Supabase (Postgres + Auth + Realtime)
- Build: Create React App
- Testing: Jest + React Testing Library