Skip to main content
The Pikarc backend is configured via environment variables with the PIKARC_ prefix. Settings can also be loaded from a .env file.

Database

VariableTypeDefaultDescription
PIKARC_DB_HOSTstringlocalhostPostgreSQL host
PIKARC_DB_PORTinteger5432PostgreSQL port
PIKARC_DB_USERstringpikarcPostgreSQL user
PIKARC_DB_PASSWORDstringpikarcPostgreSQL password
PIKARC_DB_NAMEstringpikarcPostgreSQL database name
The connection URL is computed as:
postgresql+asyncpg://{user}:{password}@{host}:{port}/{name}

Redis

VariableTypeDefaultDescription
PIKARC_REDIS_URLstringredis://localhost:6379/0Redis connection URL
Redis is used for the guardrail cache layer — spend counters, concurrent run tracking, and kill switch state.

Authentication

VariableTypeDefaultDescription
PIKARC_JWT_SECRETstringchange-me-in-productionJWT signing secret. Also used to derive the Fernet key for API key encryption.
PIKARC_JWT_ALGORITHMstringHS256JWT signing algorithm
PIKARC_JWT_EXPIRY_HOURSinteger24JWT token lifetime in hours
Always change PIKARC_JWT_SECRET in production. The default value is insecure.

Stripe (Optional)

VariableTypeDefaultDescription
PIKARC_STRIPE_SECRET_KEYstring | nullnullStripe secret key. When not set, plan changes are direct DB updates.
PIKARC_STRIPE_WEBHOOK_SECRETstring | nullnullStripe webhook signing secret
PIKARC_STRIPE_PRO_PRICE_IDstring | nullnullStripe Price ID for the Pro plan
PIKARC_STRIPE_SCALE_PRICE_IDstring | nullnullStripe Price ID for the Scale plan
When PIKARC_STRIPE_SECRET_KEY is not configured, the billing system degrades gracefully — plan changes happen via direct database updates with no payment required. This is the default for local development.

Email (Optional)

VariableTypeDefaultDescription
PIKARC_RESEND_API_KEYstring | nullnullResend API key for sending emails
PIKARC_EMAIL_FROMstringPikarc <noreply@pikarc.dev>Sender address for emails
When PIKARC_RESEND_API_KEY is not configured, emails are logged to the console instead of sent.

Application

VariableTypeDefaultDescription
PIKARC_DEBUGbooleanfalseEnables SQLAlchemy echo and FastAPI debug mode
PIKARC_CORS_ORIGINSlist[string]["http://localhost:3000"]Allowed CORS origins
PIKARC_FRONTEND_URLstringhttp://localhost:3000Frontend URL (used for email links and Stripe redirects)

Frontend

The frontend has a single environment variable:
VariableDefaultDescription
NEXT_PUBLIC_API_URLhttp://localhost:8000Backend API URL

Example .env File

# Database
PIKARC_DB_HOST=localhost
PIKARC_DB_PORT=5432
PIKARC_DB_USER=pikarc
PIKARC_DB_PASSWORD=your-secure-password
PIKARC_DB_NAME=pikarc

# Redis
PIKARC_REDIS_URL=redis://localhost:6379/0

# Auth
PIKARC_JWT_SECRET=your-production-secret-here

# Stripe (optional)
PIKARC_STRIPE_SECRET_KEY=sk_live_...
PIKARC_STRIPE_WEBHOOK_SECRET=whsec_...
PIKARC_STRIPE_PRO_PRICE_ID=price_...
PIKARC_STRIPE_SCALE_PRICE_ID=price_...

# Email (optional)
PIKARC_RESEND_API_KEY=re_...