Skip to Content
Prodly 2.0 is released 🎉
InstallationBefore starting installation

Before starting installation

Environment Variables Configuration

Before you can run Prodly, you need to properly configure your .env file. This section provides a complete guide to obtaining and adding all necessary credentials, including Supabase, Groq, Google Gemini, Serper, and Upstash Redis.


Required .env variables

Here’s the full list of environment variables you must fill in:

# Domain / App URL NEXT_PUBLIC_APP_URL= # Supabase NEXT_PUBLIC_SUPABASE_URL= NEXT_PUBLIC_SUPABASE_ANON_KEY= SUPABASE_SERVICE_ROLE_KEY= # AI - Text generation (Groq) GROQ_API_KEY= # AI - Image analysis (Google Gemini) GOOGLE_API_KEY= # Keyword suggestions (Serper) SERPER_API_KEY= # Rate limiting (Upstash Redis) UPSTASH_REDIS_REST_URL= UPSTASH_REDIS_REST_TOKEN= # Stripe (for payments) STRIPE_SECRET_KEY= NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY= STRIPE_WEBHOOK_SECRET=

1. Set Your App URL

NEXT_PUBLIC_APP_URL=https://yourdomain.com

If you’re testing locally, use:

NEXT_PUBLIC_APP_URL=http://localhost:3000

This variable is used for generating absolute URLs (e.g., in email templates or OAuth callbacks).

2. Supabase Setup (Auth & Database)

Prodly uses Supabase for authentication and as its PostgreSQL database.

đź§­ Step-by-step guide:

  1. Go to https://supabase.com  and sign up / log in.
  2. Create a new project.
    • Choose a name and a secure database password.
    • Select a region close to your users.
  3. Wait for the database to be provisioned (a few minutes).
  4. Once ready, go to Project Settings → API.
  5. Copy the following values:
    • Project URL → NEXT_PUBLIC_SUPABASE_URL
    • anon public key → NEXT_PUBLIC_SUPABASE_ANON_KEY
    • service_role key → SUPABASE_SERVICE_ROLE_KEY (keep this secret – never expose it client-side)

The service_role key bypasses Row Level Security – use it only in server-side code (API routes, server actions).

- Database schema

Prodly requires five tables with Row Level Security.

The complete SQL schema is provided in the project as supabase-schema.sql.

To apply it:

  1. In your Supabase dashboard, open the SQL Editor.
  2. Copy the contents of supabase-schema.sql into a new query.
  3. Run the query.

All tables and policies will be created automatically.

Make sure your database user has the necessary privileges to create tables and enable RLS.

3. Groq API Key (Text Generation)

Groq provides the LLaMA model for generating product descriptions.

đź§­ How to get your Groq API key:

  1. Visit https://console.groq.com  and sign in / create an account.

  2. Navigate to API Keys.

  3. Click Create API Key, give it a name, and copy the generated key.

Add it to your .env:

GROQ_API_KEY=your_groq_api_key_here

4. Google Gemini API Key (Image Analysis)

Google Gemini Vision extracts product attributes from uploaded images.

đź§­ How to get your Google API key:

  1. Go to Google AI Studio https://aistudio.google.com/app/api-keys .

  2. Sign in with your Google account.

  3. Click Get API Key and choose an existing project or create a new one.

  4. Copy the generated key.

Add it to your .env:

GOOGLE_API_KEY=your_google_api_key_here
Make sure the Gemini API is enabled for your project. You may need to enable billing (free tier quotas are usually sufficient for development).

5. Serper API Key (Keyword Suggestions)

Serper provides Google Search results to suggest relevant keywords as the user types.

đź§­ How to get your Serper API key:

  1. Visit https://serper.dev  and sign up.

  2. After logging in, go to the Dashboard.

  3. Your API key is displayed there. Copy it.

  4. Add it to your .env:

SERPER_API_KEY=your_serper_api_key_here

6. Upstash Redis (Rate Limiting)

Upstash provides serverless Redis for rate limiting API requests.

đź§­ How to get your Upstash Redis credentials:

  1. Go to https://upstash.com  and create an account.

  2. Create a new Redis database.

    • Choose a name and region close to your users.
  3. Once created, go to the Details page.

  4. Under REST API, copy the UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.

  5. Add them to your .env:

UPSTASH_REDIS_REST_URL=https://your-region.upstash.io UPSTASH_REDIS_REST_TOKEN=your_token_here

7. Stripe Setup (Payments)

Prodly uses Stripe to handle subscription payments and credits.

đź§­ How to get your Stripe keys:

  1. Go to https://dashboard.stripe.com  and log in / sign up.

  2. In the dashboard, navigate to Developers → API keys.

  3. Copy the Publishable key and Secret key.

    • NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY = publishable key (starts with pk_)

    • STRIPE_SECRET_KEY = secret key (starts with sk_)

  4. To set up webhooks, go to Developers → Webhooks and create an endpoint pointing to:

https://yourdomain.com/api/stripe/webhook

(for local development, use a tool like ngrok)

  1. After creating the endpoint, copy the Signing secret (starts with whsec_) and set it as STRIPE_WEBHOOK_SECRET.

Add the keys to your .env:

STRIPE_SECRET_KEY=sk_live_... NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_live_... STRIPE_WEBHOOK_SECRET=whsec_...
Keep your secret key and webhook secret safe – never expose them client‑side.

Final Check

After adding all values, your .env file should look like this (with your actual keys filled in):

NEXT_PUBLIC_APP_URL=http://localhost:3000 NEXT_PUBLIC_SUPABASE_URL=https://yourproject.supabase.co NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIs... SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIs... GROQ_API_KEY=gsk_abc123... GOOGLE_API_KEY=AIzaSyABC123... SERPER_API_KEY=abc123... UPSTASH_REDIS_REST_URL=https://eu1-stellar-owl-12345.upstash.io UPSTASH_REDIS_REST_TOKEN=AXVhkgNAcDE4MTg... STRIPE_SECRET_KEY=sk_live_... NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_live_... STRIPE_WEBHOOK_SECRET=whsec_...
Never commit your .env file to version control. It should be added to .gitignore. Use your hosting platform’s environment variable manager (e.g., Vercel, Netlify) for production secrets.

What’s Next?

Once your environment variables are configured and the database schema is applied, you’re ready to install dependencies and start the development server:

npm install npm run dev
Last updated on