Extract color palettes from every Pokémon sprite — and play a daily Pokémon-guessing game built around them.
Live at pokemonpalette.com.
- Palette extraction — dominant colors for every Pokémon (1000+), including shiny variants
- Daily game — Wordle-style guessing game using palette similarity as the hint signal
- Unlimited mode — same game, no daily limit, configurable palette size
- Multiplayer — host or join a room and race a friend on the same Pokémon
- Pokédex — track which Pokémon you've caught across modes
- Saved palettes — bookmark and export your favorites
- Public API — paid
/api/v1/palettesendpoint (Stripe-gated, API-key auth) - Admin panel — users, palettes, daily overrides, email campaigns, geo insights
- Accessibility — colorblind modes, keyboard shortcuts, skip links, WCAG-compliant viewport
| Layer | Tools |
|---|---|
| Framework | Next.js 15 (App Router, Turbopack), React 19, TypeScript |
| UI | Tailwind CSS 4, shadcn/ui (Radix), Lucide, Sonner, GSAP, Recharts |
| Auth | Clerk |
| Database | Supabase (Postgres) + Prisma ORM (introspection-only) |
| Resend | |
| Payments | Stripe (Checkout + webhooks) |
| Rate limit | Upstash Redis |
| Analytics | GA4, Google AdSense |
Schema lives in supabase/migrations/ (source of truth, includes RLS + RPCs). Prisma is used only for typed queries — never for migrations.
- Node.js 18+
- A Supabase project (database + auth)
- A Clerk app (auth) — optional in dev; the app no-ops auth when keys are absent
git clone https://github.com/yassenshopov/pokemonpalette.git
cd pokemonpalette
npm installCreate .env.local with the variables below (only Clerk + Supabase are required for core functionality):
# Clerk
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
CLERK_SECRET_KEY=
CLERK_WEBHOOK_SECRET=
# Supabase / Postgres
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=
DATABASE_URL= # pgbouncer pooler, port 6543
DIRECT_URL= # direct connection, port 5432 (prisma migrate only)
# Optional
RESEND_API_KEY=
RESEND_FROM_EMAIL=
NEXT_PUBLIC_BASE_URL=http://localhost:212
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
STRIPE_PALETTE_API_PRICE_ID=
NEXT_PUBLIC_GA4_ID=
NEXT_PUBLIC_ADSENSE_CLIENT_ID=
UPSTASH_REDIS_REST_URL=
UPSTASH_REDIS_REST_TOKEN=Run the dev server:
npm run dev # http://localhost:212For local webhook testing (Clerk, Stripe) over ngrok:
npm run dev:ngrok
npm run webhook:info # print current tunnel URL + Clerk/Stripe endpoints| Command | Purpose |
|---|---|
npm run dev |
Dev server on port 212 (Turbopack) |
npm run dev:ngrok |
Dev server + ngrok tunnel for webhook testing |
npm run build |
prisma generate + production build |
npm start |
Run production build |
npm run lint |
ESLint |
npm run db:studio |
Open Prisma Studio |
npm run db:pull |
Re-introspect Postgres into schema.prisma |
npm run db:format |
Format schema.prisma |
npm run test:seo |
Run SEO smoke checks against the live site |
npm run webhook:* |
Inspect / test ngrok webhook URLs |
src/
app/ # Next.js App Router
api/ # Route handlers (admin, billing, multiplayer, v1 public API, webhooks…)
[name]/ # Pokémon detail page
shiny/[name]/ # Shiny variant detail page
type/[type]/ # Browse by type
rarity/[rarity]/ # Browse by rarity
generation/[gen]/ # Browse by generation
game/ # Daily + unlimited guessing game (+ Pokédex)
explore/ # Public palette feed
saved-palettes/ # User's saved palettes
account/ # Account settings, API keys
admin/ # Admin: users, palettes, game data, emails, insights
api-access/ # Stripe checkout for API access
components/ # Feature + UI components (shadcn/ui in components/ui)
lib/ # Shared utilities, Prisma client, palette algorithms
prisma/
schema.prisma # Introspected from Supabase — DO NOT migrate from here
supabase/
migrations/ # Source of truth: tables, RLS policies, SECURITY DEFINER RPCs
public/
pokemon/ # Pre-extracted sprite PNGs (immutably cached)
data/ # Pre-built per-Pokémon JSON (immutably cached)
scripts/ # ngrok dev helper, webhook test utilities
- Migrations are raw SQL in
supabase/migrations/(they encode RLS + RPCs Prisma can't express). - Prisma is introspection-only —
db:pullregeneratesschema.prismafrom the live DB. - The runtime
DATABASE_URLmust use the pgbouncer pooler (port 6543, transaction mode) to avoid connection exhaustion on serverless.DIRECT_URL(port 5432) is only used byprisma migrate/db pull.
Deployed on Vercel. The build command runs prisma generate before next build. Configure all environment variables in the Vercel project settings; Clerk and Stripe webhooks point at https://www.pokemonpalette.com/api/webhooks/clerk and /api/billing/webhook respectively.
MIT © Yassen Shopov. See [LICENSE](LICENSE).