Search and claim cards from the TCG vending machine inventory.
- π Real-time search powered by Algolia
- π΄ Card claiming system with Supabase backend
- β‘ Serverless API routes on Vercel
- β Comprehensive test coverage
/
βββ tcg-search/ # React frontend application
β βββ src/
β β βββ components/ # React components (search, carousels, modals, chat)
β β βββ utilities/ # Algolia & Supabase client setup
β β βββ assets/ # Logos and icons
β βββ api/ # Vercel serverless API routes
β βββ public/ # Static assets
βββ data/ # Algolia index management
β βββ data-files/ # CSV inventory data
β βββ data-utilities/ # Python scripts for indexing
βββ vercel.json # Vercel deployment configuration
βββ .vercelignore # Files excluded from deployment
- Algolia - Search service (free tier available)
- Supabase - Database backend (free tier available)
- Vercel - Hosting platform (free tier available)
- Node.js 20+ (required by @supabase/supabase-js)
node --version # Should be v20.0.0 or higher - Vercel CLI:
npm i -g vercel - Python 3.x + Poetry (only needed for updating Algolia index)
- React 18 with Algolia InstantSearch v7
- Supabase JS Client for real-time subscriptions
- Vercel Serverless Functions
Run full stack locally (frontend + API):
npm run dev
# or
vercel devThis starts:
- React dev server at
http://localhost:3000 - API routes at
http://localhost:3000/api/*
Run frontend only (no API):
cd tcg-search
npm startRequired for local development (.env in tcg-search/):
# Algolia
REACT_APP_ALGOLIA_APP_ID=your_app_id
REACT_APP_ALGOLIA_API_KEY=your_search_key
REACT_APP_ALGOLIA_INDEX_NAME=your_index_name
REACT_APP_USER_TOKEN=your_user_token
# Supabase
REACT_APP_SUPABASE_URL=https://your-project.supabase.co
REACT_APP_SUPABASE_PUBLISHABLE_KEY=your_publishable_key
SUPABASE_SECRET_KEY=your_secret_keycd tcg-search
# Interactive watch mode
npm test
# One-time run with coverage
npm run test:ciSee tcg-search/TESTING.md for detailed testing documentation.
-
Link to Vercel project:
vercel link
-
Add environment variables in Vercel dashboard:
- Go to Project Settings β Environment Variables
- Add all variables from
.env(see above) - Make sure to add them for all environments (Production, Preview, Development)
Deploy from repository root (not tcg-search/):
# Preview deployment
npm run deploy
# or
vercel
# Production deployment
npm run deploy:prod
# or
vercel --prodThe vercel.json configuration handles the mono-repo structure automatically.
- β
React frontend (built from
tcg-search/) - β
API routes (from
api/) - β Serverless functions configuration
- β Data scripts (excluded via
.vercelignore) - β Tests and coverage (excluded)
- Framework: React 18 with Create React App
- Search: Algolia InstantSearch v7
- Styling: Custom CSS
- Platform: Vercel Serverless Functions
- Database: Supabase (Postgres)
- API Routes:
POST /api/claims/create- Submit card claim
- Row Level Security (RLS) enabled on Supabase
- Rate limiting: 5 claims per hour per email
- Server-side validation for all inputs
- Create a feature branch:
git checkout -b feat/your-feature - Make changes and test locally with
vercel dev - Run tests:
cd tcg-search && npm run test:ci - Commit with semantic prefixes:
feat:,fix:,chore:, etc. - Push and create a PR
See .claude/CLAUDE.md for detailed contribution guidelines.
Private repository - see LICENSE file for details.