Genero is a Next.js monorepo for applications that implement local "citycoins", built on new monetary principles. The first implementation is T-Coin, a Toronto-focused digital currency. The repository contains the wallet, sparechange, contracts, Supabase Edge Functions, and operator scripts needed to run the TorontoCoin app family.
The project integrates Supabase for storage and auth, Cubid for onboarding and wallet-management surfaces, Twilio Verify for SMS OTP, and Celo/TorontoCoin contracts for the live token runtime. UI components are built with React, Tailwind CSS, Radix, and the local shared component/hook libraries.
- Node.js 20+
- pnpm 10.x, matching the
packageManagerfield inpackage.json - Docker/Colima for local Supabase work
- Supabase CLI for local or remote migration validation
- Foundry for TorontoCoin contract/deployment work under
contracts/foundry
- Copy
.env.exampleto.env.localand populate the Next app variables. If you also deploy Supabase Edge Functions from this repo, usesupabase/functions/.env.exampleas the companion edge-runtime template. - Install dependencies:
pnpm install
- Start the default development server:
pnpm dev
If you want separate local-dev Supabase target profiles, keep shared values in /.env.local and run one of:
pnpm dev:supabase-local
pnpm dev:supabase-remoteThose commands layer one of these ignored local-only files on top of the shared base env:
/.env.local-supabase-local/.env.local-supabase-remote
For local Supabase work under Colima, start the trimmed local stack with:
pnpm supabase:start:localThat helper switches to the colima-varrun Docker context when available and reapplies the GoTrue mailer-host patch needed to suppress local GOTRUE_MAILER_EXTERNAL_HOSTS warnings for browser and gateway traffic (localhost, 127.0.0.1, and the local kong gateway host).
Open http://localhost:3000 in your browser. Next.js will serve the app configured by NEXT_PUBLIC_CITYCOIN and NEXT_PUBLIC_APP_NAME.
pnpm dev– run the development serverpnpm dev:supabase-local– run the development server with the local-Supabase env profile layered on top of/.env.localpnpm dev:supabase-remote– run the development server with the remote-Supabase env profile layered on top of/.env.localpnpm build– create a production buildpnpm build:supabase-local– create a production build with the local-Supabase profile loadedpnpm build:supabase-remote– create a production build with the remote-Supabase profile loadedpnpm start– start the production serverpnpm start:supabase-local– start the production server with the local-Supabase profile loadedpnpm start:supabase-remote– start the production server with the remote-Supabase profile loadedpnpm smoke:e2e– run the Playwright smoke harness againstSMOKE_BASE_URLor build and start a local production serverpnpm smoke:e2e:supabase-local– build with the local-Supabase profile and smoke stable public/preview-safe routes in Chromiumpnpm supabase:start:local– start the local Supabase stack for this repo and patch local GoTrue mailer host handlingpnpm lint– run Next.js lint plus the app-facing Supabase boundary guardpnpm test– run the Vitest suitepnpm ops:wallet:preflight:supabase-local– run the wallet release preflight against the local Supabase profilepnpm ops:wallet:preflight:supabase-remote– run the wallet release preflight against the remote Supabase profilepnpm ops:wallet:preflight:deployment– run the wallet release preflight against process env onlypnpm ops:indexer:drain-touch-queue– drain one queued async indexer touch request from the worker runtimepnpm ops:torontocoin,pnpm ops:torontocoin:pools,pnpm ops:torontocoin:acceptance– run TorontoCoin operator health checks
.github/workflows/ # Frontend CI, Supabase migration deploy/dry-run, and secret scanning
agent-context/ # Session workflow, logs, app context, and agent operating notes
app/
tcoin/ # TorontoCoin apps and contract-management surfaces
wallet/ # General-purpose TorontoCoin wallet
sparechange/ # SpareChange app
contracts/ # Contract-management UI
contracts/
foundry/ # TorontoCoin Solidity workspace, deployment artefacts, and runtime manifests
docs/
engineering/ # Current specs, architecture notes, and release runbooks
scripts/ # Repository helper scripts, env/profile loaders, and operator checks
services/ # Node service modules for indexer/onramp workers and shared runtime logic
shared/ # Reusable hooks, components, clients, and utilities
lib/contracts/ # Runtime contract bridges and operator status helpers
lib/edge/ # Typed browser clients and app-scope helpers for Supabase Edge Functions
supabase/
migrations/ # Versioned SQL migrations synced with Supabase
functions/ # Supabase Edge Functions plus shared Deno helpers
_shared/ # Shared auth, scoping, RBAC, validation, and domain helpers
API routes for Twilio OTP verification and temporary compatibility shims are located under app/api.
The current implementation specs live in docs/engineering/technical-spec.md and docs/engineering/functional-spec.md. Session-by-session change history remains in agent-context/session-log.md.
TorontoCoin retail runtime now uses the fresh Celo mainnet suite surfaced through shared/lib/contracts/torontocoinRuntime.ts for buy, transfer, and operator-health flows. Legacy city-registry resolution remains in place only for older contract-management surfaces that have not yet been repointed.
Credentials for Supabase, Cubid and Twilio are required. The Next app template lives at .env.example, and the Supabase Edge Functions template lives at supabase/functions/.env.example.
Use NEXT_PUBLIC_CITYCOIN to choose the city/currency scope and NEXT_PUBLIC_APP_NAME to choose the deployed app surface. For TorontoCoin wallet release work, the canonical public Supabase key is NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY; retired aliases are not active runtime inputs.
Local development can use one shared base env plus target-specific overlays:
/.env.localfor shared local values/.env.local-supabase-localfor local app plus local Supabase/.env.local-supabase-remotefor local app plus remote Supabase
Do not put real secrets in checked-in files. Keep SUPABASE_SERVICE_ROLE_KEY out of deployed Next.js/Vercel envs; it belongs in the external indexer worker runtime and privileged Supabase Edge Function runtime when those surfaces intentionally need it.
Pull requests run frontend CI, secret scanning, and Supabase migration validation when relevant. The dedicated TCOIN Supabase workflow dry-runs migrations for PRs into dev against Preview – tcoin and PRs into main against Production – tcoin; pushes to those branches deploy migrations to the matching database after the GitHub Environment gate.
Agents must never directly mutate a linked Supabase database. Remote schema changes should flow through reviewed migrations and the guarded GitHub workflow, or through an explicit human/operator action described in the relevant runbook.
Wallet, SpareChange, and contracts app-facing data flows should prefer typed Supabase Edge Functions, narrow RPCs, read-model helpers, or documented server boundaries instead of broad browser/client table access. The detailed boundary contract and current exception list live in docs/engineering/supabase-boundary-contract.md; new app-facing direct table reads/writes need an explicit reason there and in the lint guard.
Use 2 spaces for TypeScript indentation, keep Solidity at 4 spaces, and run the relevant checks before committing. For ordinary app/runtime changes, start with pnpm lint and pnpm test; for release work, also run the profile-specific preflight and smoke checks in docs/engineering/wallet-release-runbook.md. The current testing contract lives in docs/engineering/testing-ci-contract.md.
MIT. See LICENSE.