All environment variables are validated at build time byDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/astrxnomo/manizalesdepie/llms.txt
Use this file to discover all available pages before exploring further.
lib/env.ts (public variables) and lib/env.server.ts (server-only secrets). Both use Zod to parse the values the moment the module loads. A missing or empty variable throws immediately with a descriptive error — failing the build rather than surfacing as a null pointer at 3 a.m. during an active emergency.
Public variables
Variables prefixedNEXT_PUBLIC_ are inlined into the browser bundle by Next.js. They are visible to anyone who inspects the page source. Never put a secret in a NEXT_PUBLIC_ variable.
The project URL from Supabase Project Settings → API.Example:
https://lriozoktdpkggzywimek.supabase.coUsed to initialize both the browser Supabase client and the server-side SSR client. Must be a valid URL — lib/env.ts validates it with z.url().The publishable (anon) key from Supabase Project Settings → API.This key is safe in the browser because row-level security limits what it can read and write. It cannot bypass RLS. Published rows are readable by the anon role; everything else is gated by policy.
The full URL of your deployment. Used for OAuth redirect URLs and OpenGraph metadata.
- Local development:
http://localhost:3000 - Production:
https://manizales-de-pie.vercel.app(or your custom domain)
lib/env.ts validates it with z.url().Phone number for curator contact. Digits only, with country code. No spaces, dashes, or plus signs.Example:
573001234567 (where 57 is Colombia’s country code)Displayed across the app as the contact point for affected people and reporters. This is not validated as required — the app runs without it — but it should be set before the deployment is shared publicly.Server-only variables
Server-only variables are never prefixedNEXT_PUBLIC_. They live in lib/env.server.ts, which opens with import "server-only". That import turns an accidental client-side import of this module into a build error, not a code review comment.
The service role key from Supabase Project Settings → API.Bypasses all RLS policies. Only
*.dal.ts files may access this key, and only through the admin client at lib/supabase/admin.ts. No page, component, route handler, or server action may import it directly.The env split in practice
The two modules enforce the public/server split at the import graph level:lib/env.ts
lib/env.server.ts
lib/env.ts is safe to import anywhere — pages, components, the proxy, server actions. lib/env.server.ts may only be imported by server-side code in lib/ and data/. The server-only package makes that boundary enforced rather than advisory.
Setting up .env.local
Copy the example file and fill in each variable:.env.local template:
.env.local
NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY, NEXT_PUBLIC_SITE_URL, or SUPABASE_SECRET_KEY is missing or empty. NEXT_PUBLIC_CURATOR_WHATSAPP is an optional extra variable not present in .env.example — the app runs without it, but it should be set before the deployment is shared publicly.