A modern web remake of the classic game Zoo Paloola, built with React, TypeScript, and Vite.
- Frontend: React, TypeScript, Vite
- Styling: Tailwind CSS
- Backend/Multiplayer: Supabase (Realtime, Database, Auth)
- Physics: Custom 2D physics engine
-
Install dependencies:
npm install
-
Environment Setup: Create a
.envfile in the root directory with your Supabase credentials:VITE_SUPABASE_URL=your_supabase_url VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
-
Run locally:
npm run dev
This project is optimized for deployment on Vercel.
- Push to GitHub: Ensure your project is pushed to a GitHub repository.
- Import Project: Go to Vercel dashboard, click "Add New...", select "Project", and import your GitHub repository.
- Configure Project:
- Framework Preset: Vite
- Root Directory:
./(default) - Build Command:
npm run build(default) - Output Directory:
dist(default)
- Environment Variables:
- Go to the Environment Variables section.
- Add
VITE_SUPABASE_URLandVITE_SUPABASE_ANON_KEYwith your production Supabase values.
- Deploy: Click "Deploy".
The game uses a games table in Supabase to store multiplayer sessions.
No. By default, rows in the games table persist indefinitely. Supabase does not automatically delete old game sessions.
If you want to remove old or finished games to save space, you have a few options:
-
Manual Cleanup (SQL Editor): Run this SQL command periodically in your Supabase SQL Editor:
-- Delete finished games older than 1 day DELETE FROM games WHERE status = 'finished' AND created_at < NOW() - INTERVAL '1 day'; -- Delete abandoned waiting games older than 1 hour DELETE FROM games WHERE status = 'waiting' AND created_at < NOW() - INTERVAL '1 hour';
-
Automated Cleanup (pg_cron): If you are on a Supabase Pro plan, you can enable the
pg_cronextension to run the above SQL automatically on a schedule. -
Edge Functions: You can write a Supabase Edge Function that runs on a schedule (using cron triggers) to perform the cleanup.