Environment Setup
To configure your application, you'll need to set up various environment variables. Create a .env.local file in your project root.
You can generate a NEXTAUTH_SECRET key here: Generate here
# Database (Neon.tech PostgreSQL)
DATABASE_URL=your_neon_database_url
# Email (Resend)
RESEND_API_KEY=your_resend_api_key
RESEND_EMAIL=your_verified_email
# Authentication (Google OAuth)
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your_nextauth_secret
# File Storage (AWS S3)
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
AWS_REGION=your_aws_region
S3_UPLOAD_BUCKET=your_bucket_name
# Rate Limiting (Upstash Redis)
UPSTASH_REDIS_REST_URL=your_upstash_url
UPSTASH_REDIS_REST_TOKEN=your_upstash_token
# Payments (Stripe)
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBGOOK=your_stripe_webhook_secret
STRIPE_STARTER_PRICE_ID=
STRIPE_PRO_PRICE_ID=
# App Encryption
ENCRYPTION_KEY=your_encryption_key
NEXT_PUBLIC_APP_URL=http://localhost:3000
Service Setup Guides
Database Setup (Neon.tech)
- Go to Neon.tech and create an account
- Create a new project
- Once created, go to the "Connection Details" tab
- Copy the connection string
- Replace DATABASE_URL in your .env.local with the connection string
Email Setup (Resend)
- Visit Resend and create an account
- Go to the API Keys section
- Generate a new API key
- Copy the API key and add it to RESEND_API_KEY in your .env.local
- Add your verified email address to RESEND_EMAIL
Note: Make sure to verify your domain or email in Resend's dashboard
File Storage Setup (AWS S3)
- Create an AWS Account if you don't have one
- Go to AWS IAM and create a new user with S3 access
- Generate Access Key and Secret Key
- Create a new S3 bucket
- Configure your .env.local with AWS credentials and bucket details
Note: Important: Make sure to configure CORS settings in your S3 bucket
Rate Limiting Setup (Upstash Redis)
- Go to Upstash and create an account
- Create a new Redis database
- Go to the "REST API" section
- Copy the UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN
- Add these values to your .env.local
Authentication Setup (Google OAuth)
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google OAuth2 API
- Configure the OAuth consent screen
- Create OAuth 2.0 credentials
- Add authorized redirect URIs
- Copy the Client ID and Client Secret
- Add them to your .env.local
Payment Setup (Stripe)
- Create a Stripe account
- Get your API keys from the Stripe Dashboard
- Create your products and price IDs
- Set up webhook endpoints
- Add the Stripe credentials to your .env.local