Getting Started
Prerequisites
- Node.js 20+ (LTS recommended)
- pnpm 9+ (package manager)
- PostgreSQL 16+ (local or Neon for dev)
Environment Variables
Copy .env.example to .env.local and fill in:
# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/envara
# Auth (Clerk)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
CLERK_SECRET_KEY=sk_test_...
CLERK_WEBHOOK_SECRET=whsec_...
# AI
ANTHROPIC_API_KEY=sk-ant-...
# Payments (Stripe)
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
# Email (Resend)
RESEND_API_KEY=re_...
# Storage (GCS)
GCS_BUCKET=envara-dev
GCS_PROJECT_ID=...
GOOGLE_APPLICATION_CREDENTIALS=./gcs-key.json
# App
NEXT_PUBLIC_APP_URL=http://localhost:3000Database Setup
# Push schema to database (development)
pnpm db:push
# Generate migration files (when ready for production)
pnpm db:generate
# Run migrations
pnpm db:migrate
# Open Drizzle Studio (database GUI)
pnpm db:studioRunning Locally
# Development server with hot reload
pnpm dev
# Type checking
pnpm typecheck
# Linting
pnpm lint
# Run all checks (typecheck + lint + test)
pnpm checkThird-Party Setup
Clerk
- Create a Clerk application at clerk.com (opens in a new tab)
- Enable Google OAuth and Microsoft OAuth in the social connections settings
- Configure the webhook endpoint:
{APP_URL}/api/webhooks/clerk - Copy keys to
.env.local
Stripe
- Create a Stripe account at stripe.com (opens in a new tab)
- Create products and prices matching the tier structure
- Configure the webhook endpoint:
{APP_URL}/api/webhooks/stripe - Use Stripe CLI for local webhook testing:
stripe listen --forward-to localhost:3000/api/webhooks/stripe
Resend
- Create a Resend account at resend.com (opens in a new tab)
- Verify the
envara.aidomain - Copy the API key to
.env.local