Application Configuration
This application relies on environment variables for connecting to external services and for security. All variables should be stored in a .env.local
file in the project's root directory.
Creating the .env.local
file
Create a file named .env.local
and add the following key-value pairs. Obtain the values from the respective service providers.
# Upstash Redis Credentials
UPSTASH_REDIS_REST_URL="..."
UPSTASH_REDIS_REST_TOKEN="..."
# Google Auth Credentials
GOOGLE_CLIENT_ID="..."
GOOGLE_CLIENT_SECRET="..."
# Pusher Credentials
NEXT_PUBLIC_PUSHER_APP_KEY="..."
PUSHER_APP_ID="..."
PUSHER_APP_SECRET="..."
# NextAuth Configuration
NEXTAUTH_SECRET="..."
NEXTAUTH_URL="http://localhost:3000"
Environment Variable Details
Upstash Redis
These variables are required for connecting to your Upstash Redis instance, which is used as the primary database.
UPSTASH_REDIS_REST_URL
: The REST API URL for your Upstash database.UPSTASH_REDIS_REST_TOKEN
: The authorization token for your Upstash database.
Google Authentication
These are needed for the Google OAuth provider through NextAuth.js. You can get them from the Google Cloud Console.
GOOGLE_CLIENT_ID
: Your Google application's client ID.GOOGLE_CLIENT_SECRET
: Your Google application's client secret.
Pusher
These variables connect the application to the Pusher service for real-time functionality.
NEXT_PUBLIC_PUSHER_APP_KEY
: The public app key for your Pusher instance. TheNEXT_PUBLIC_
prefix makes it available to the client-side code.PUSHER_APP_ID
: Your Pusher application ID.PUSHER_APP_SECRET
: Your Pusher application secret.
NextAuth.js
General configuration for NextAuth.js.
NEXTAUTH_SECRET
: A secret string used to sign JWTs. You can generate a strong secret usingopenssl rand -base64 32
.NEXTAUTH_URL
: The canonical URL of your application. For local development, this ishttp://localhost:3000
. For production, this should be your public domain.