DevPlaysChess is a production-focused monorepo built with Turborepo and pnpm.
- Web: Next.js (
apps/web) - Mobile: Expo (
apps/mobile) - Backend: Convex (
packages/backend) - Authentication: Better Auth (Convex adapter)
- Payments: Dodo Payments (Better Auth plugin)
apps/
web/ # Next.js web app
mobile/ # Expo mobile app
packages/
backend/ # Convex backend and Better Auth component wiring
ui/ # Shared tokens/utilities
docs/
features/ # Feature implementation notes
- Node.js 20+
- pnpm 10+
- Convex account/project
- (Optional) Dodo Payments account for billing flows
- (Optional) Expo account for mobile production builds
The repository provides templates in all required locations:
- Root reference:
/.env.example - Web:
apps/web/.env.example - Mobile:
apps/mobile/.env.example - Backend:
packages/backend/.env.example
NEXT_PUBLIC_CONVEX_URLNEXT_PUBLIC_CONVEX_SITE_URLSITE_URLBETTER_AUTH_SECRET
Optional for payment flows:
DODO_PAYMENTS_API_KEYDODO_ENVIRONMENTDODO_DEFAULT_PRODUCT_IDDODO_PAYMENTS_WEBHOOK_SECRET
EXPO_PUBLIC_CONVEX_URLEXPO_PUBLIC_CONVEX_SITE_URL
Set using Convex CLI (not via local file):
BETTER_AUTH_SECRETSITE_URLDODO_PAYMENTS_API_KEY(optional)DODO_ENVIRONMENT(optional)DODO_DEFAULT_PRODUCT_ID(optional)DODO_PAYMENTS_WEBHOOK_SECRET(optional)
- Create or link a Convex project.
- Start backend once:
pnpm --filter @devplays-chess/backend dev- Copy the deployment URL from Convex output/dashboard.
- Use that URL for:
NEXT_PUBLIC_CONVEX_URLEXPO_PUBLIC_CONVEX_URL
- Local development:
NEXT_PUBLIC_CONVEX_SITE_URL=http://localhost:3000SITE_URL=http://localhost:3000EXPO_PUBLIC_CONVEX_SITE_URL=http://localhost:3000
- Production:
- Set all site URLs to your public web domain.
Generate a secure random secret (minimum 32+ characters) and set:
BETTER_AUTH_SECRET
From Dodo dashboard/API credentials:
DODO_PAYMENTS_API_KEYDODO_DEFAULT_PRODUCT_IDDODO_PAYMENTS_WEBHOOK_SECRETDODO_ENVIRONMENT(test_modeorlive_mode)
pnpm installcp apps/web/.env.example apps/web/.env.local
cp apps/mobile/.env.example apps/mobile/.envPopulate values as described above.
pnpm --filter @devplays-chess/backend exec convex env set BETTER_AUTH_SECRET <your_secret>
pnpm --filter @devplays-chess/backend exec convex env set SITE_URL http://localhost:3000Optional Dodo values:
pnpm --filter @devplays-chess/backend exec convex env set DODO_PAYMENTS_API_KEY <your_key>
pnpm --filter @devplays-chess/backend exec convex env set DODO_ENVIRONMENT test_mode
pnpm --filter @devplays-chess/backend exec convex env set DODO_DEFAULT_PRODUCT_ID <product_id>
pnpm --filter @devplays-chess/backend exec convex env set DODO_PAYMENTS_WEBHOOK_SECRET <webhook_secret>pnpm --filter @devplays-chess/backend auth:generatepnpm devpnpm --filter @devplays-chess/backend deploySet production Convex env values with production URLs and secrets before deployment.
Set Vercel project root to apps/web and configure:
NEXT_PUBLIC_CONVEX_URLNEXT_PUBLIC_CONVEX_SITE_URLSITE_URLBETTER_AUTH_SECRET(if used by web runtime path)- Optional Dodo values if checkout route is used in web runtime
Webhook endpoint:
https://<your-domain>/api/auth/dodopayments/webhooks
Set:
EXPO_PUBLIC_CONVEX_URLEXPO_PUBLIC_CONVEX_SITE_URL
Then build/distribute with EAS.
pnpm dev
pnpm build
pnpm lint
pnpm typecheck
pnpm format:check
pnpm test- Deployment details:
DEPLOYMENT.md - Feature change logs:
docs/features/