Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Jason-AML/MonzaSport-Nextjs/llms.txt

Use this file to discover all available pages before exploring further.

Monza Motors relies on environment variables to connect to four external services: Supabase (authentication and database), Stripe (payment processing), Groq (AI inference), and the hosting platform itself for redirect URL generation. Variables prefixed with NEXT_PUBLIC_ are bundled into the client-side JavaScript and are accessible in the browser — all other variables are server-side only and must never be exposed to client code.
SUPABASE_SERVICE_ROLE_KEY and NEXT_STRIPE_SECRET_KEY carry elevated privileges. Never commit these values to version control and never reference them from any file that runs in the browser. Add .env.local to your .gitignore before your first commit.

Supabase Configuration

Monza Motors uses @supabase/ssr to create both a browser client (via createBrowserClient) and a server client (via createServerClient with Next.js cookie handling). Both clients require the public URL and anon key; the service role key is used exclusively by server-side routes that need elevated database access, such as the AI chat route.
NEXT_PUBLIC_SUPABASE_URL
string
required
Your Supabase project URL. Found in your Supabase dashboard under Settings → API → Project URL. This value is exposed to the browser and is used by the browser Supabase client to connect to your project.
NEXT_PUBLIC_SUPABASE_ANON_KEY
string
required
The Supabase anonymous (public) API key for your project. Found in Settings → API → Project API keys → anon / public. Used by browser clients for authentication flows and public data reads. Exposed to the browser — it is safe to include in client-side code because its permissions are governed by Row Level Security (RLS) policies.
SUPABASE_SERVICE_ROLE_KEY
string
required
The Supabase service role key with elevated privileges that bypasses RLS. Found in Settings → API → Project API keys → service_role. Used server-side only by the AI chat route and any administrative data operations. Never expose this key to the browser or commit it to source control.

Stripe Configuration

Monza Motors creates Stripe Checkout sessions from a Next.js API route, so only the secret key is required. The Stripe publishable key is not needed for this integration pattern.
NEXT_STRIPE_SECRET_KEY
string
required
Your Stripe secret API key used to create and manage checkout sessions entirely on the server. Found in the Stripe Dashboard → Developers → API keys → Secret key. Use a test-mode key (sk_test_...) during development. Never expose this to the browser or commit it to source control.

Groq AI Configuration

The AI assistant at /chat uses the Groq inference API with the llama-3.3-70b-versatile model via the @ai-sdk/groq package. The API key is consumed exclusively by the server-side chat route.
GROQ_API_KEY
string
required
API key for Groq’s inference API. Obtain one from the Groq Console. Used by the AI chat route to stream responses from the llama-3.3-70b-versatile model. This variable is server-side only and must not be prefixed with NEXT_PUBLIC_.

Application Configuration

NEXT_PUBLIC_BASE_URL
string
The fully-qualified base URL of the application used to construct absolute URLs for Stripe checkout success_url and cancel_url redirect parameters. Set this to http://localhost:3000 during local development. In production deployments on Vercel this value is superseded automatically — see the note below.
When running on Vercel, the platform automatically injects the VERCEL_URL environment variable containing the deployment’s canonical hostname. The Stripe redirect logic uses VERCEL_URL in production, meaning NEXT_PUBLIC_BASE_URL only needs to be set for local development. You do not need to update NEXT_PUBLIC_BASE_URL when promoting a deployment to production.

Full .env.local Template

Copy the block below into a .env.local file at the project root and replace each placeholder with your real credentials. This file is listed in .gitignore and will not be committed to source control.
.env.local
# ─── Supabase ────────────────────────────────────────────────────────────────
# Supabase project URL (browser-safe)
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url

# Supabase anonymous / public API key (browser-safe)
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key

# Supabase service role key — server-side only, bypasses RLS
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key

# ─── Stripe ──────────────────────────────────────────────────────────────────
# Stripe secret key — server-side only
NEXT_STRIPE_SECRET_KEY=your_stripe_secret_key

# ─── Application ─────────────────────────────────────────────────────────────
# Base URL used for Stripe redirect URLs in local development
NEXT_PUBLIC_BASE_URL=http://localhost:3000

# ─── Groq AI ─────────────────────────────────────────────────────────────────
# Groq inference API key — server-side only
GROQ_API_KEY=your_groq_api_key

Build docs developers (and LLMs) love