QuantumQie is a browser-based, canvas-driven resource-management / base-building game built with Next.js and React. Place farms and mines, assign workers, harvest resources, and persist your world using Supabase. The game integrates Ethereum wallet sign-in via Wagmi and RainbowKit for player identity.
- Canvas-rendered, tile-based world with procedurally drawn building art
- Placeable buildings: farms (carrot/rice/cabbage), mines (copper/iron/diamond), warehouse
- Workers that can be hired and assigned to buildings to produce resources
- Production, harvesting, and autosave persistence via Supabase
- Wallet-based identity (Wagmi + RainbowKit) for per-player saves
- Lightweight, dependency-minimal engine with zoom, minimap, and intuitive input
Prerequisites:
- Node.js (18+ recommended)
- npm / pnpm / yarn
Install dependencies and run the development server:
npm install
npm run devOpen http://localhost:3000 in your browser. Connect a wallet on the landing page and navigate to the Game screen.
- Place buildings by selecting a building (hotkeys shown in the UI or press
1–6) and left-click on the canvas to place. - Right-click to remove (or press
xto toggle remove mode). - Click a ready building to harvest its output.
- Assign workers by clicking an unassigned building (workers appear in the Workers panel) — different building types require different worker types (farmers or miners).
- The world autosaves periodically to Supabase.
- Place / Interact: Left Click
- Remove: Right Click (or toggle remove with
x) - Rotate selected building:
r - Deselect / Cancel:
qorEscape - Building hotkeys:
1..6 - Canvas receives keyboard input when focused (click the canvas or tab into it)
1— Carrot Farm (farm-wheat) — cost: 402— Rice Farm (farm-potato) — cost: 503— Cabbage Farm (farm-rice) — cost: 604— Copper Mine (mine-copper) — cost: 905— Iron Mine (mine-iron) — cost: 1106— Diamond Mine (mine-diamond) — cost: 180- Warehouse (warehouse) — cost: 0 (stores resources)
These definitions and rendering are implemented in src/game/buildings.ts.
app/— Next.js app routes and pages (React + server/Client components)src/game/— game engine, renderer, input, placement, persistencesrc/components/— UI components (Toolbar, HUD, Wallet, etc.)src/lib/— small libraries (Supabase client)
Key files:
- src/app/game/page.tsx — main game page and React glue
- src/game/engine.ts — main loop, ticking, and render orchestration
- src/game/buildings.ts — building defs & drawing
- src/game/persistence.ts — Supabase save/load helpers
- src/lib/supabaseClient.ts — reads required env vars
The game optionally persists to Supabase and supports a wallet connection. To enable Supabase persistence, set these env vars in a .env.local file at the project root:
NEXT_PUBLIC_SUPABASE_URL=https://<your-project>.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=<anon-public-key>
# Optional: WalletConnect project id for RainbowKit features
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=<project-id>If Supabase env vars are not provided, the game will still run locally but persistence will be disabled and a warning will be logged.
- Development:
npm run dev - Production build:
npm run buildthennpm run start
This project targets Next.js 16 and React 19. The package.json scripts are preconfigured for standard Next.js workflows.
- Rendering is canvas based and uses procedural drawing (no heavy sprite atlases required). See
src/game/buildings.tsandsrc/game/renderer.tsfor drawing logic. - Input handling and camera controls live in
src/game/input.tsandsrc/game/camera.ts. - Persistence expects a Supabase table named
buildingswith columns matching the fields used insrc/game/persistence.ts(see file for mappings).
Contributions welcome. Open an issue or PR with a clear description of the change or bug. For feature work, add a short note describing the gameplay impact.
This repository does not include a license file. Add LICENSE if you want to make the project open source.
If you want, I can also:
- Add a minimal
READMEbadge and usage GIF - Create a small
SUPABASE_SETUP.mdwith SQL schema and table examples - Add a
Makefile/npm script to seed demo saves