Property Management Network — Next.js 16 (App Router), Better Auth, Drizzle ORM over PostgreSQL, Stripe, OpenAI, Resend. Includes: - Security hardening: access-control/IDOR fixes, TLS-by-default DB layer, constant-time cron auth, strict security headers, atomic AI quota gating, HTML/email output encoding, demo-backdoor disabled in production. - Superadmin dashboard at /admin (overview/MRR, server-paginated users with ban/impersonate/plan/delete, billing, platform activity + admin audit log, AI usage, system health) via the Better Auth admin plugin. - Seed/migration utility scripts under scripts/. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
49 lines
1.7 KiB
Bash
49 lines
1.7 KiB
Bash
# ============================================
|
|
# PROPERTY MANAGEMENT NETWORK — Environment Variables
|
|
# ============================================
|
|
# Copy this file to .env.local and fill in your values.
|
|
# Never commit .env.local to version control.
|
|
|
|
# === DATABASE (external Postgres) ===
|
|
# Standard Postgres connection string.
|
|
DATABASE_URL=postgres://user:password@host:5432/dbname
|
|
|
|
# === BETTER AUTH ===
|
|
# Generate a secret: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
|
|
BETTER_AUTH_SECRET=your-random-secret-here
|
|
BETTER_AUTH_URL=http://localhost:3000
|
|
|
|
# Google OAuth — create credentials at https://console.cloud.google.com
|
|
# Authorized redirect URI: <BETTER_AUTH_URL>/api/auth/callback/google
|
|
GOOGLE_CLIENT_ID=
|
|
GOOGLE_CLIENT_SECRET=
|
|
|
|
# === STORAGE (local disk) ===
|
|
# Directory where uploaded files are stored (kept out of the public web root).
|
|
STORAGE_DIR=./storage
|
|
|
|
# === STRIPE ===
|
|
# Get from: https://dashboard.stripe.com/apikeys
|
|
STRIPE_SECRET_KEY=sk_test_your-secret-key
|
|
STRIPE_WEBHOOK_SECRET=whsec_your-webhook-secret
|
|
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_your-publishable-key
|
|
|
|
# Stripe Price IDs — create in Stripe Dashboard > Products
|
|
STRIPE_PRO_MONTHLY_PRICE_ID=price_your-pro-monthly-id
|
|
STRIPE_LANDLORD_MONTHLY_PRICE_ID=price_your-landlord-monthly-id
|
|
STRIPE_LIFETIME_PRICE_ID=price_your-lifetime-id
|
|
|
|
# === AI (OpenAI) ===
|
|
# Get from: https://platform.openai.com/api-keys
|
|
OPENAI_API_KEY=sk-your-api-key
|
|
|
|
# === EMAIL (Resend) ===
|
|
# Get from: https://resend.com/api-keys
|
|
RESEND_API_KEY=re_your-api-key
|
|
RESEND_FROM_EMAIL=noreply@yourdomain.com
|
|
|
|
# === APP ===
|
|
NEXT_PUBLIC_APP_URL=http://localhost:3000
|
|
NEXT_PUBLIC_APP_NAME=Property Management Network
|
|
CRON_SECRET=your-random-secret-string
|