FemeSalud is built with TanStack Start and Nitro, making Vercel the natural deployment target. Nitro compiles the application into serverless functions that Vercel executes on every request, giving you full SSR with zero cold-start configuration. A singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/KevxxAlva/femesalud-zen-flow/llms.txt
Use this file to discover all available pages before exploring further.
vercel.json file at the project root is all Vercel needs to understand the build.
vercel.json Configuration
The project’svercel.json uses the tanstack-start framework preset:
vercel.json
vite.config.ts with preset: "vercel". Nitro then produces framework-aware serverless function bundles and static assets under .vercel/output/, the directory Vercel reads automatically at deploy time — no custom output directory configuration needed.
Build Command
Vercel calls the project’s build script once the framework preset is detected:npm run build if you’re not using Bun. Both invoke vite build, which activates the Nitro Vercel preset and writes all deployment artifacts to .vercel/output/. You do not need to configure the build command manually in the Vercel dashboard; the tanstack-start preset sets it for you.
Environment Variables on Vercel
FemeSalud requires five environment variables to connect to Supabase. Add all five in the Vercel dashboard under Settings → Environment Variables before your first deployment.| Variable | Where it’s used |
|---|---|
VITE_SUPABASE_URL | Client-side Supabase client initialization |
VITE_SUPABASE_PUBLISHABLE_KEY | Client-side publishable key for Supabase auth |
SUPABASE_URL | Server-side API calls and auth middleware |
SUPABASE_PUBLISHABLE_KEY | Server-side publishable key for auth middleware |
SUPABASE_SERVICE_ROLE_KEY | Server-side admin client — bypasses RLS for trusted operations |
Automatic Deployments
Connecting your GitHub repository to Vercel enables fully automated deployments on every push.Connect your GitHub repository
In the Vercel dashboard, click Add New → Project and import the
femesalud-zen-flow repository from GitHub. Vercel requests read access to detect pushes and open pull requests.Vercel detects the framework
During import, Vercel reads
vercel.json and identifies tanstack-start as the framework. The build command, output directory, and Nitro adapter settings are all configured automatically — no manual overrides required.Push to main triggers a production build
Every
git push origin main starts a new production deployment. Vercel runs bun run build, Nitro compiles the serverless output, and the new version goes live at your production URL in seconds.Preview Deployments
Every pull request opened againstmain automatically receives its own unique preview URL — for example, femesalud-zen-flow-git-feat-branch-your-org.vercel.app. Preview deployments run the full SSR build with their own scoped environment variables, so you can share a working link with reviewers before merging. Closing or merging the PR retires the preview URL.
SSR Architecture
TanStack Start uses Nitro as its server runtime. On each incoming request, Nitro invokes the server entry atsrc/server.ts, which loads the TanStack Start server entry and passes the request through. TanStack Start then runs the matched route’s server-side logic, renders the React tree to HTML, and streams the response — all inside a Vercel Serverless Function.
Authentication-guarded routes use ssr: false in their route configuration. This intentionally skips server rendering for those pages: they ship as a minimal HTML shell and hydrate fully on the client. The tradeoff is correct — there is no public content to pre-render for auth-protected views, and client-only hydration avoids exposing session state in server-rendered HTML.
Production Checklist
Before pointing your domain at the production deployment, verify the following:All five environment variables are set in Vercel
Confirm
VITE_SUPABASE_URL, VITE_SUPABASE_PUBLISHABLE_KEY, SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY, and SUPABASE_SERVICE_ROLE_KEY are present in Settings → Environment Variables for the Production scope.Supabase CORS allows your Vercel domain
In the Supabase dashboard, go to Authentication → URL Configuration and add your Vercel production URL (e.g.
https://femesalud.vercel.app) to the list of allowed redirect URLs and site URLs.At least one admin user exists in user_roles
FemeSalud’s Row Level Security policies gate admin-only features on rows in the
user_roles table. Insert a record with role = 'admin' for the first operator account before trying to access the admin panel.A clinic_info row exists with id = 1
The dashboard reads clinic details from
clinic_info WHERE id = 1. Create this row in Supabase before the first login to avoid blank header states.