Skip to main content

Configuration Reference

BunShip Pro is configured through environment variables (in .env) and feature flags (in code).

Environment Variables

All variables are defined in .env at the repository root. Copy .env.example to get started.

Application

VariableRequiredDefaultDescription
NODE_ENVNodevelopmentdevelopment or production
PORTNo3000API server port
API_URLNohttp://localhost:3000Base URL for the API
FRONTEND_URLNohttp://localhost:3001Base URL for the frontend
CORS_ORIGINSNohttp://localhost:3001Comma-separated allowed origins

Database

VariableRequiredDefaultDescription
TURSO_DATABASE_URLYesfile:./local.dbSQLite file path or Turso URL
TURSO_AUTH_TOKENProductionAuth token for hosted Turso

Authentication

VariableRequiredDefaultDescription
JWT_SECRETYesSecret for signing access tokens (32+ chars)
JWT_REFRESH_SECRETYesSecret for signing refresh tokens (32+ chars)

Stripe Billing

VariableRequiredDefaultDescription
STRIPE_SECRET_KEYNoStripe API secret key (sk_test_... or sk_live_...)
STRIPE_WEBHOOK_SECRETNoStripe webhook signing secret (whsec_...)
STRIPE_PRO_MONTHLY_PRICE_IDNoBuilt-inStripe price ID for Pro monthly plan
STRIPE_PRO_YEARLY_PRICE_IDNoBuilt-inStripe price ID for Pro yearly plan
STRIPE_ENTERPRISE_MONTHLY_PRICE_IDNoBuilt-inStripe price ID for Enterprise monthly
STRIPE_ENTERPRISE_YEARLY_PRICE_IDNoBuilt-inStripe price ID for Enterprise yearly
Set DEMO_MODE=true to run without Stripe. All billing pages will show mock data.

Email

VariableRequiredDefaultDescription
EMAIL_PROVIDERNoresendresend, smtp, or console
RESEND_API_KEYNoResend API key (when provider is resend)
RESEND_FROM_EMAILNoSender address (e.g., App <hello@yourdomain.com>)
SMTP_HOSTNoSMTP server hostname (when provider is smtp)
SMTP_PORTNo587SMTP port
SMTP_SECURENofalseUse TLS
SMTP_USERNoSMTP username
SMTP_PASSNoSMTP password

File Storage (S3)

VariableRequiredDefaultDescription
S3_ENDPOINTNoS3-compatible endpoint URL
S3_BUCKETNoBucket name
AWS_ACCESS_KEY_IDNoAWS access key
AWS_SECRET_ACCESS_KEYNoAWS secret key
AWS_REGIONNous-east-1AWS region
S3_FORCE_PATH_STYLENofalseEnable for MinIO or other S3-compatible services
MAX_FILE_SIZENo52428800Max upload size in bytes (default 50 MB)

Redis

VariableRequiredDefaultDescription
REDIS_URLNoredis://localhost:6379Redis connection URL for background jobs

OAuth (Optional)

VariableRequiredDefaultDescription
GOOGLE_CLIENT_IDNoGoogle OAuth client ID
GOOGLE_CLIENT_SECRETNoGoogle OAuth client secret
GITHUB_CLIENT_IDNoGitHub OAuth client ID
GITHUB_CLIENT_SECRETNoGitHub OAuth client secret

Admin

VariableRequiredDefaultDescription
CRON_SECRETNoSecret for authenticating cron job endpoints

Frontend Analytics

These are VITE_ prefixed and available to the frontend:
VariableRequiredDefaultDescription
VITE_ANALYTICS_PROVIDERNoplausible, posthog, or ga4
VITE_PLAUSIBLE_DOMAINNoYour domain for Plausible analytics
VITE_POSTHOG_KEYNoPostHog project API key
VITE_GA4_IDNoGoogle Analytics 4 measurement ID

Feature Flags

Feature flags are defined in packages/config/src/features.ts. They control which features are enabled at build time.

Auth Features

auth: {
  enableEmailPassword: true,
  enableMagicLink: true,
  enableGoogleOAuth: true,
  enableGithubOAuth: true,
  enableTwoFactor: true,
  enableSessionManagement: true,
  requireEmailVerification: true,
}

Organization Features

organizations: {
  enabled: true,
  allowMultipleOrgs: true,
  allowOrgCreation: true,
  requireOrgOnSignup: false,
  maxOrgsPerUser: 10,
}

Billing Features

billing: {
  enabled: true,
  provider: "stripe",
  trialDays: 14,
  allowFreePlan: true,
}
To disable a feature, change its value to false in the config file. The frontend and backend both read from this shared config, so changes apply everywhere.

Admin Feature Flags

The admin panel at /admin/feature-flags provides a UI for toggling features at runtime. These are grouped by category: authentication, billing, organizations, and file uploads.

Analytics Setup

To add analytics, set the provider and its key in .env:

Plausible

VITE_ANALYTICS_PROVIDER=plausible
VITE_PLAUSIBLE_DOMAIN=yourdomain.com

PostHog

VITE_ANALYTICS_PROVIDER=posthog
VITE_POSTHOG_KEY=phc_xxx

Google Analytics 4

VITE_ANALYTICS_PROVIDER=ga4
VITE_GA4_ID=G-XXXXXXXXXX
Only one provider can be active at a time.

Next Steps