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

Clubedge Starter Docs

Overview

What Clubedge Starter contains, and the architecture that keeps each part replaceable.

Clubedge Starter is a production-ready starter that ships only the modules you choose: Next.js or TanStack Start, or a Hono or FastAPI API with a React + Vite frontend, a native app, or both, on PostgreSQL, with optional auth, storage, email, payments, background jobs, observability, and deployment, each behind an interface you can replace.

Most starters give you one stack and leave you to rip out what you don't need. Clubedge Starter is built the other way around. Every service is an optional module, and a module you leave out is removed completely. Each provider sits behind an interface in its own package, so you can swap Supabase Auth for Better Auth, or OpenTelemetry for Sentry, without touching your pages.

Features

Application

  • Next.js App Router or TanStack Start, with React, TypeScript, Tailwind CSS 4, and shadcn/ui using Base UI primitives.
  • Or a React + Vite frontend with a separate API in apps/api, in TypeScript (Hono) or Python (FastAPI), joined by an OpenAPI contract. See A frontend and its API.
  • With that frontend, an optional Android and iOS app in apps/shell, made with Capacitor: it calls the API through the website, keeps its session on the device, and asks for an update when the API serves newer versions. A demo build has sample data and needs no server. See The mobile app.
  • With either API, an optional native Android and iOS app in apps/mobile, built with Expo and React Native: its own screens for sign-in, a dashboard, and settings call the API with the same contract client, and it asks for an update when the API serves newer versions. See The native app.
  • Or no website at all: the API alone, which the native app calls directly. See Without a website.
  • pnpm workspaces and Turborepo, with the web app in apps/web and framework-agnostic packages under packages/.
  • Drizzle ORM and PostgreSQL schema, migrations, and seed commands.
  • Zod environment validation, security headers, structured errors, and /api/health.
  • A landing page and a working dashboard built from the shared UI package.

Modules

Production

  • A production image that includes its own migrator (node /app/migrate.mjs), for running migrations before each release. With a separate API, the API's image has it.
  • A manual deploy workflow for the chosen platform, or with Docker, a Compose setup behind Caddy and a workflow that publishes the images with each release. A readiness endpoint (/api/ready) checks the database.
  • Rate limits that count each client by the address your host reports, with CLIENT_IP_HEADER or TRUSTED_PROXY_HOPS.

Quality

  • GitHub Actions CI with Vitest, Playwright, ESLint, and Prettier.
  • pnpm check:services, which proves the app can reach every configured service with a real round trip.

Architecture

The browser talks to the web app. The app reaches PostgreSQL through Drizzle, and every other service through an interface in its own package. Optional modules appear only when you choose them:

With a frontend and its API, the browser loads the React + Vite frontend and calls the API through the contract in packages/contract. The API reaches PostgreSQL and checks the auth provider's token or session on each request. The API, Hono or FastAPI, takes the app's place in the diagram above: it holds every module, and the frontend forwards Stripe's webhooks and Inngest's calls to it. FastAPI runs jobs on BullMQ or Inngest, since pg-boss has no Python version. Both deploy with Docker or Railway. A mobile app loads the frontend's pages from the device and calls the API through the deployed frontend, like the browser. A native app has screens of its own and calls the API with the same contract client: through the deployed frontend, or directly in a project without a website, where the API is the only server.

Six principles keep it that way:

  • PostgreSQL is the source of truth for application data. Drizzle centralizes application schema, queries, and migrations.
  • Authentication stays separate from application data. The auth provider owns credentials and sessions; application tables are managed by Drizzle.
  • Providers sit behind interfaces. Each interface lives in its own package under packages/, and each provider in another, so replacing a provider does not touch application code.
  • Shared packages are framework-agnostic. Packages under packages/ receive configuration and request cookies as arguments and never import a web framework. ESLint enforces these boundaries.
  • One composition root. apps/web/src/server/ is the only place that reads environment variables and chooses providers. Routes and components call it rather than a provider SDK. With a frontend and its API, the API's composition root plays that part, and the frontend reads only its public VITE_* settings.
  • Keep the baseline focused. Additional providers and tooling should be added when a real use case calls for them.

This is a foundation and a reference implementation. Review its security and deployment choices for your application before you go to production; see Before deploying.

In this section

Project structure

Where the app, the shared packages, and the configuration live.

Commands

The scripts you run from the repository root.

Environment

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

Local services

Run PostgreSQL and the other services on your machine with Docker, the Supabase CLI, or nothing at all, or use a hosted Neon database.

Database

Drizzle schema, migrations, and seed data on PostgreSQL.

UI

The shared shadcn/ui package on Base UI primitives, theming, and where components belong.

Authentication

Supabase Auth, Better Auth, Firebase Authentication, or Appwrite, behind one AuthProvider interface.

Email

Send email over SMTP or through Resend, behind one EmailProvider interface.

File storage

S3-compatible storage or Supabase Storage, behind one StorageProvider interface.

Cache and rate limits

A fixed-window rate limiter and cache on Redis, or in process memory.

Payments

Subscriptions with Stripe Checkout and the customer portal, behind one PaymentProvider interface.

Background jobs

Jobs with retries and schedules, run by pg-boss, BullMQ, or Inngest behind one interface.

Observability

Server and browser error reporting and request tracing, with OpenTelemetry or Sentry.

Push notifications

Notifications to the mobile apps, through Expo's push service or straight through FCM and APNs, behind one PushProvider interface.

Over-the-air updates

Changes to the native app's JavaScript and assets reach installed apps with EAS Update, without a store release.

Docker

Development and production images, and the migrator inside them.

The mobile app

The React + Vite frontend as an Android and iOS app with Capacitor, with an update notice and a demo build.

The native app

A native Android and iOS app with Expo and React Native, which calls the same API as the website, or the API alone.

Before deploying

A checklist of security and operational choices to review before production.

Troubleshooting

Fixes for common problems.

How is this guide?