Live Demo: guppycode.vercel.app
guppy is a programming puzzle game where you recreate pixel art by writing Python code. The target images dynamically change with the canvas dimensions, so your solutions must be mathematically robust and work for any valid size.
- Study: Open a level and study the target image.
- Code: Write Python code to recreate it using the built-in Monaco Editor.
- Test: Drag the dimension sliders to test your solution across different canvas sizes.
- Solve: Pass the level by producing the correct output for every valid size.
Frontend
- React + TypeScript + Vite: Core UI and build tooling.
- Monaco Editor: High-performance code editor for the Python environment.
- Pyodide: WebAssembly-powered Python runtime that executes code entirely in the browser.
- HTML Canvas: Fast 2D rendering engine for the pixel buffer.
Backend
- Node.js + Express: RESTful API framework.
- PostgreSQL: Relational database for user profiles and code submissions.
- Prisma: Type-safe ORM for database migrations and queries.
- Google OAuth 2.0: Secure authentication system.
- Node.js (v18+)
- Docker (for local PostgreSQL database)
- Google Cloud Console account (for OAuth credentials)
- Open a terminal and navigate to the backend directory:
cd backend - Install dependencies:
npm install
- Create a
.envfile in thebackenddirectory:DATABASE_URL="postgresql://guppy:password@localhost:5433/guppy?schema=public" JWT_SECRET="super-secret-local-key" PORT=8081 GOOGLE_CLIENT_ID="your_google_client_id_here"
- Start the local PostgreSQL database using Docker:
docker compose up -d
- Sync the Prisma schema to initialize the database tables:
npm run db:push
- Start the backend development server:
npm run dev
- Open a new terminal and navigate to the frontend directory:
cd frontend - Install dependencies:
(Note: The
npm install
postinstallscript will automatically copy Pyodide WebAssembly assets into thepublic/pyodidefolder for offline-first development). - Create a
.envfile in thefrontenddirectory:VITE_API_BASE_URL="http://localhost:8081/api" VITE_GOOGLE_CLIENT_ID="your_google_client_id_here"
- Start the Vite development server:
npm run dev
To enable sign-ups, you must generate a Client ID in the Google Cloud Console.
- Add
http://localhost:5173to your Authorized JavaScript origins. - Paste the Client ID into both
.envfiles.
You are now ready to play locally!
