Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Stivenz3/Nexu/llms.txt

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

Nexu is a client-side React application built with Vite. All configuration it needs at runtime is injected at build time through environment variables prefixed with VITE_. These variables tell the app which Firebase project to connect to and, optionally, what public URL to embed in certificate QR codes. This page documents every variable, where to find its value, and how to set it in both local development and Vercel production.
Never commit .env.local to Git. The file is listed in .gitignore by default, but double-check before pushing. Exposing Firebase credentials publicly allows anyone to read and write your Firestore data within the limits of your security rules.

Environment Variables

VITE_FIREBASE_API_KEY
string
required
The Web API key for your Firebase project. Used by the Firebase SDK to identify the application when making requests to Firebase services.Where to find it: Firebase Console → Project Settings → General → Your apps → Web app → apiKey.Example: AIzaSyDjFyLsiJzZSMHKTahuNNMKEnO4VnUKioY
VITE_FIREBASE_AUTH_DOMAIN
string
required
The OAuth/Auth domain for your Firebase project. Used by Firebase Auth when handling sign-in flows and redirects.Where to find it: Firebase Console → Project Settings → General → Your apps → Web app → authDomain.Example: nexu-156ce.firebaseapp.com
VITE_FIREBASE_PROJECT_ID
string
required
The unique identifier for your Firebase project. Used to construct Firestore document paths and other Firebase service URLs.Where to find it: Firebase Console → Project Settings → General → Project ID.Example: nexu-156ce
VITE_FIREBASE_STORAGE_BUCKET
string
required
The default Cloud Storage bucket for your Firebase project. Nexu does not currently upload files to Storage, but the Firebase SDK requires this value to initialise correctly.Where to find it: Firebase Console → Project Settings → General → Your apps → Web app → storageBucket.Example: nexu-156ce.firebasestorage.app
VITE_FIREBASE_MESSAGING_SENDER_ID
string
required
The numeric sender ID for Firebase Cloud Messaging. Required by the Firebase SDK initialisation even if the app does not use push notifications.Where to find it: Firebase Console → Project Settings → General → Your apps → Web app → messagingSenderId.Example: 661629916502
VITE_FIREBASE_APP_ID
string
required
The unique identifier for the specific Web app registration within your Firebase project. Used by the SDK to bind the client to the correct app configuration.Where to find it: Firebase Console → Project Settings → General → Your apps → Web app → appId.Example: 1:661629916502:web:0ed25d517141c6030c72f7
VITE_APP_URL
string
Optional. The public base URL of the deployed application. Used to construct the full verification URL (VITE_APP_URL/verificar/:code) that is embedded as a QR code in certificate PDFs.If this variable is not set, the certificate service falls back to window.location.origin in the browser — which works correctly in most cases. Set it explicitly when doing a production build where the origin may not be available at generation time (e.g. SSR or pre-rendering pipelines).Example: https://nexu.vercel.app

Finding Your Firebase Config

All six required values live in a single place in the Firebase Console:
  1. Open console.firebase.google.com and select your project.
  2. Click the gear icon next to Project OverviewProject settings.
  3. Scroll to the Your apps section and select your Web app registration (the </> icon).
  4. Under SDK setup and configuration, choose the Config radio button.
  5. Firebase displays the full firebaseConfig object — copy each field to the corresponding VITE_FIREBASE_* variable.

Local Development: .env.local

For local development, create a file named .env.local at the root of the repository (next to package.json). Vite automatically loads this file and makes every VITE_* variable available via import.meta.env.
# .env.local — never commit this file
VITE_FIREBASE_API_KEY=AIzaSyDjFyLsiJzZSMHKTahuNNMKEnO4VnUKioY
VITE_FIREBASE_AUTH_DOMAIN=nexu-156ce.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=nexu-156ce
VITE_FIREBASE_STORAGE_BUCKET=nexu-156ce.firebasestorage.app
VITE_FIREBASE_MESSAGING_SENDER_ID=661629916502
VITE_FIREBASE_APP_ID=1:661629916502:web:0ed25d517141c6030c72f7
# Optional — falls back to window.location.origin in the browser
VITE_APP_URL=http://localhost:5173
A template with all keys and empty values is committed to the repository as .env.example. Run cp .env.example .env.local and fill in the values to get started.

Dev Fallback (no .env.local)

If .env.local is absent — or if any required variable is empty — src/firebase/config.ts falls back to hardcoded credentials for the shared nexu-156ce project when running in development mode (import.meta.env.PROD === false). This means the dev server works out of the box for teammates who have access to the shared project, without any configuration at all. In production mode (npm run build), the fallback is disabled. If the VITE_FIREBASE_* variables are not set, the build will throw an error at runtime:
[Firebase] Falta configurar las variables VITE_FIREBASE_* en Vercel (build).

Production: Vercel Environment Variables

For the live deployment on Vercel, environment variables are set through the Vercel dashboard — they are never in a file in the repository.
  1. Open your project in the Vercel Dashboard.
  2. Go to Settings → Environment Variables.
  3. Add each VITE_FIREBASE_* variable (and optionally VITE_APP_URL) for the Production environment.
  4. Redeploy the project (or trigger a new deployment) for the variables to take effect in the build.
Variables set in Vercel are available during vite build as import.meta.env.VITE_*. They are not secret at runtime — Vite inlines them as string literals in the JavaScript bundle. Do not put server-side secrets (like Firebase Admin SDK credentials or reCAPTCHA secret keys) in VITE_* variables. Those belong in non-prefixed Vercel environment variables consumed only by Vercel serverless functions (e.g. api/verify-recaptcha.ts).

Shared Development Project: nexu-156ce

The entire Nexu team shares a single Firebase project for both local development and production: nexu-156ce. This means:
  • All developers with Owner or Editor access point their local .env.local (or use the built-in fallback) to the same Firestore database.
  • Lesson 1 is already seeded in this project — no seed commands are needed to test the learner flow.
  • Running npm run seed:lesson1 overwrites Lesson 1 content for everyone. Always notify the team before running seed commands against the shared project.
  • Firestore security rules are deployed with npm run firebase:deploy:rules and affect all environments immediately.
If you need an isolated environment (e.g. for destructive testing), create a separate Firebase project and point a local .env.local at it.

Build docs developers (and LLMs) love