FastAPI Env

FastAPI backend environment variables.

Required variables

APP_NAME=Whitepapper_API
REDIS_PREFIX=whitepapper
CORS_ORIGINS=https://your-domain.example,http://localhost:4321
PUBLIC_SITE_URL=https://your-domain.example
CLERK_SECRET_KEY=sk_test_xxx
CLERK_JWT_KEY=-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----
CLERK_AUTHORIZED_PARTIES=https://your-domain.example,http://localhost:4321
CLERK_WEBHOOK_SIGNING_SECRET=whsec_xxx
FIREBASE_STORAGE_BUCKET=your-project.appspot.com
FIRESTORE_DATABASE_ID=(default)
FIREBASE_SERVICE_ACCOUNT_JSON={...}
CRON_SECRET=change-me
VALKEY_SERVICE_URI=redis://default:password@host:6379/0
VALKEY_HOST=
VALKEY_PORT=
VALKEY_USER=
VALKEY_PASSWORD=
GROQ_API_KEY=gsk_xxx

Expected outcome

FastAPI can start, authenticate users, access Firestore/Storage, and run cache + cron endpoints.

Common errors

ErrorCauseFix
500 at startupInvalid Firebase service account JSONReformat and validate JSON string
401 on cron endpointsWrong CRON_SECRETAlign header secret with backend env
CORS issuesMissing frontend originAdd all frontend origins to CORS_ORIGINS

Related pages

Whitepapper

Whitepapper is an API first CMS engine for devs who publish content.

Antk i n