Saarthi Environment Status

Environment Variables

Database URL: Defined

Secret Key: Defined

Gemini API Key: Defined

Cloudinary Name: Defined

Cloudinary API Key: Defined

Cloudinary Secret: Defined

Node Environment: production

Running on Vercel: Yes

File Storage: Memory + Cloudinary

How to Fix in Vercel

To fix the missing environment variables in Vercel:

  1. Go to your Vercel Dashboard
  2. Select your project (Saarthi)
  3. Click on "Settings" in the top navigation
  4. Select "Environment Variables" from the left sidebar
  5. Add each environment variable:
    • ATLASDB_URL: Your MongoDB connection string
    • SECRET: A random string for session encryption
    • GEMINI_API_KEY: Your Google Gemini API key
    • CLOUD_NAME: Your Cloudinary cloud name
    • CLOUD_API_KEY: Your Cloudinary API key
    • CLOUD_SECRET_KEY: Your Cloudinary API secret
  6. Make sure to select all environments (Production, Preview, Development) where appropriate
  7. Click "Save" after adding each variable
  8. Redeploy your application by going to the "Deployments" tab and clicking "Redeploy"

How to Fix Locally

If you're running the application locally, create a .env file in the root directory with the following content:

ATLASDB_URL=mongodb+srv://username:password@cluster.mongodb.net/database
SECRET=your_random_secret_string
GEMINI_API_KEY=your_gemini_api_key
CLOUD_NAME=your_cloudinary_cloud_name
CLOUD_API_KEY=your_cloudinary_api_key
CLOUD_SECRET_KEY=your_cloudinary_api_secret

MongoDB Atlas Setup

If you need to create a MongoDB database:

  1. Go to MongoDB Atlas and create an account
  2. Create a new cluster (the free tier is sufficient)
  3. Click "Connect" on your cluster
  4. Select "Connect your application"
  5. Copy the connection string and replace <password> with your database user password
  6. Add this connection string as the ATLASDB_URL environment variable

Gemini API Key

To get a Gemini API key:

  1. Go to Google AI Studio
  2. Sign in with your Google account
  3. Navigate to the "API keys" section
  4. Create a new API key
  5. Copy the API key and add it as the GEMINI_API_KEY environment variable

Cloudinary Setup

For image uploads to work in Vercel, you need to set up Cloudinary:

  1. Go to Cloudinary and sign up for a free account
  2. Go to your Cloudinary Dashboard
  3. Find your Cloud Name, API Key, and API Secret
  4. Add these values to your Vercel environment variables as:

Need Help?

If you're still having issues, check the Health Check Endpoint for more diagnostic information.