New:New releases:CLIcreate-clubedge-app v0.49.1·Clubedge Starter v0.32.0

Clubedge Starter Docs

Environment

Install the toolchain, create the environment file, and every variable the app reads.

Install the toolchain

Install Node.js 22.12 or newer, then enable Corepack and install pnpm dependencies from the repository root:

corepack enable
pnpm install

The root package.json pins pnpm 10.9.0 through its packageManager field. Use a compatible pnpm 10 release if Corepack is not available.

If pnpm reports that it ignored a package build script needed by your environment, review the package name and approve only the required dependency with pnpm approve-builds.

With the FastAPI API, also install uv. The API needs Python 3.12 (apps/api/.python-version), which uv downloads when it isn't installed. The CLI runs uv sync in apps/api after pnpm install; in a fresh clone, the API's scripts run through uv run, which installs its dependencies on first use. Each module option has its own dependency group in apps/api/pyproject.toml: every project keeps the same uv.lock, development installs every group, and the production image only those of your modules.

Create the environment file

Projects generated by the CLI already have apps/web/.env.local. Otherwise, copy the example:

cp .env.example apps/web/.env.local

With a separate API, the CLI creates two files: apps/web/.env.local for the React + Vite frontend, from .env.example, and apps/api/.env.local for the API, from apps/api/.env.example. The API owns the database and the modules, so DATABASE_URL and the modules' variables, such as REDIS_URL, SMTP_URL, or STRIPE_SECRET_KEY, go in the API's file. The database commands read it there.

With a mobile app, the CLI also creates apps/shell/.env.local, from apps/shell/.env.example. It holds WEB_URL, the deployed website's https:// address, which the app calls. The app's build also reads apps/web/.env.local, and the values in apps/shell/.env.local win.

With the native app, the CLI also creates apps/mobile/.env.local, from apps/mobile/.env.example. Expo builds its EXPO_PUBLIC_* values into the app, so they are public:

VariableNeeded forDetails
EXPO_PUBLIC_API_URLRelease builds, and a phone in developmentWhere the app sends its requests: the website's address, or the API's without a website. Blank in development, it means this computer's dev server, which the Android emulator reaches at 10.0.2.2 and the iOS simulator at localhost.
EXPO_PUBLIC_DEV_SERVER_PORTWithout a websiteThe port of that dev server: 3001, the API's. With a website, it is 3000.
EXPO_PUBLIC_SUPABASE_URL, EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEYSupabase AuthThe same project's settings as the website's, or the API's without a website. Sign-in

In a project without a website, there is no apps/web/.env.local: apps/api/.env.local holds every variable, with HOST=0.0.0.0 so that a phone on the same network reaches the API in development. With Better Auth, which then runs in the API, it also holds BETTER_AUTH_SECRET (at least 32 characters, which pnpm check:env checks) and BETTER_AUTH_URL, the API's public URL: http://localhost:3001 in development.

The example points at your local services and leaves provider keys blank, so the app builds and starts before anything is configured. Without local services, set at least DATABASE_URL:

apps/web/.env.local
DATABASE_URL=postgres://user:password@host:5432/app

Variables

A project only contains the variables of the modules it uses. Next.js and TanStack Start name a few of them differently, and React + Vite splits them between the frontend and the API:

VariableNeeded forDetails
DATABASE_URLRequiredPostgreSQL connection URL, such as a Supabase transaction pooler URL.
NEXT_PUBLIC_APP_URLRecommendedThe app's origin. Defaults to http://localhost:3000.
NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEYSupabase AuthAuthentication
CLIENT_IP_HEADER, TRUSTED_PROXY_HOPSRate limits in productionWhere the client's address is for your host (Starter v0.27.0 or newer): Client addresses

With Next.js and TanStack Start, the rest are the same for both frameworks. With React + Vite, the module variables are the API's:

VariableNeeded forDetails
DATABASE_URL_DIRECTOptionalPooled and direct connections
SUPABASE_SECRET_KEYAccount deletion (Supabase)Authentication
BETTER_AUTH_SECRETBetter AuthAuthentication
BETTER_AUTH_REQUIRE_EMAIL_VERIFICATIONBetter Auth with email (optional)Authentication
FIREBASE_PROJECT_ID, FIREBASE_API_KEYFirebaseAuthentication
FIREBASE_CLIENT_EMAIL, FIREBASE_PRIVATE_KEYFirebase in production (the service account)Authentication
FIREBASE_AUTH_EMULATOR_HOSTFirebase in development onlyAuthentication
APPWRITE_ENDPOINT, APPWRITE_PROJECT_ID, APPWRITE_API_KEYAppwriteAuthentication
REDIS_URLRedis (optional)Cache and rate limits
SMTP_URL, EMAIL_FROMSMTP emailEmail
RESEND_API_KEY, EMAIL_FROMResend emailEmail
STORAGE_BUCKET, STORAGE_REGION, STORAGE_ENDPOINT, STORAGE_ACCESS_KEY_ID, STORAGE_SECRET_ACCESS_KEY, STORAGE_PUBLIC_URLS3-compatible storageFile storage
STORAGE_DIRECTORYS3-compatible storage in a local folder (--infra local)File storage
SUPABASE_STORAGE_BUCKETSupabase StorageFile storage
STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET, STRIPE_PRICE_<PLAN>PaymentsPayments
JOBS_WORKER, CRON_SECRETpg-boss or BullMQ (optional)Background jobs
INNGEST_DEV, INNGEST_EVENT_KEY, INNGEST_SIGNING_KEYInngestBackground jobs
OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, OTEL_SERVICE_NAMEOpenTelemetryObservability
SENTRY_DSN, SENTRY_ENVIRONMENT, SENTRY_TRACES_SAMPLE_RATESentryObservability
SENTRY_AUTH_TOKEN, SENTRY_ORG, SENTRY_PROJECTSentry source maps, at build time onlyObservability

DATABASE_URL must be a non-empty string for server environment validation. If you are only exploring the UI, a local placeholder URL works, but database operations fail until it points to a real PostgreSQL database.

Start the app

pnpm dev

The app is available at http://localhost:3000, the liveness endpoint at /api/health, and the readiness endpoint, which also checks the database, at /api/ready.

With a separate API, pnpm dev starts the API too, on port 3001. The frontend forwards /api to it, so /api/health and /api/ready on port 3000 answer from the API. Without a website, pnpm dev starts the API alone: its liveness endpoint is http://localhost:3001/api/health.

How is this guide?