DumpIt deploys as a Next.js app on Vercel with Firebase Auth, Firestore, Firebase Admin SDK, and Gemini for AI/RAG.
- Vercel project connected to the GitHub repository.
- Firebase project with Authentication and Firestore enabled.
- Firebase Admin service account for server-side API routes.
- Google AI Studio / Gemini API key for embeddings and answer generation.
- Firestore vector indexes for
resource_chunks.
Set these locally in .env.local and in Vercel Project Settings -> Environment Variables.
# Firebase Client SDK Configuration (public browser config)
NEXT_PUBLIC_FIREBASE_API_KEY=
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
NEXT_PUBLIC_FIREBASE_PROJECT_ID=
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
NEXT_PUBLIC_FIREBASE_APP_ID=
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=
# Firebase Admin SDK (server-only)
FIREBASE_PROJECT_ID=
FIREBASE_CLIENT_EMAIL=
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
# Gemini AI (server-only)
GEMINI_API_KEY=
GEMINI_MODEL=gemini-2.5-flash
GEMINI_EMBEDDING_MODEL=gemini-embedding-001Notes:
NEXT_PUBLIC_*values are safe browser config for the Firebase Web SDK.FIREBASE_PRIVATE_KEY,FIREBASE_CLIENT_EMAIL, andFIREBASE_PROJECT_IDare server secrets for Firebase Admin.GEMINI_API_KEYmust be an AI Studio / Gemini API key, not a Firebase Web API key.- Do not prefix Gemini keys with
Bearer, and do not wrap the value in quotes in Vercel. - Use
GEMINI_MODEL=gemini-2.5-flashfor v1.gemini-2.5-procan return429 RESOURCE_EXHAUSTEDon the free tier. - Redeploy Vercel after changing environment variables.
- Create or select a Firebase project.
- Enable Firestore Database.
- Enable Authentication.
- Enable Email/Password and Google sign-in providers if both are desired.
- Generate a Firebase Admin service account key:
- Firebase Console -> Project Settings -> Service Accounts
- Generate new private key
- Map JSON fields to env vars:
project_id->FIREBASE_PROJECT_IDclient_email->FIREBASE_CLIENT_EMAILprivate_key->FIREBASE_PRIVATE_KEY
Server APIs use Firebase Admin SDK and verify Firebase ID tokens. Client-side direct access should remain constrained.
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
function isAuthenticated() {
return request.auth != null;
}
function isOwner(userId) {
return isAuthenticated() && request.auth.uid == userId;
}
match /resources/{resourceId} {
allow read: if resource.data.is_public == true || isOwner(resource.data.user_id);
allow create: if isAuthenticated() && request.auth.uid == request.resource.data.user_id;
allow update, delete: if isOwner(resource.data.user_id);
}
match /resource_chunks/{chunkId} {
allow read: if resource.data.is_public == true || isOwner(resource.data.user_id);
allow write: if false;
}
match /users/{userId} {
allow read, create, update: if isOwner(userId);
match /collections/{collectionId} {
allow read, write: if isOwner(userId);
match /resources/{resourceId} {
allow read, write: if isOwner(userId);
}
}
}
}
}Create the standard indexes Firestore asks for in the Firebase Console or with gcloud when query errors provide a command.
Expected query shapes include:
resources:user_idpluscreated_atresources: public resource discovery filters- collection group
collections:is_sharedplussort_order
DumpIt stores embeddings in resource_chunks.embedding with 768 dimensions. Firestore vector search requires separate indexes for each filter combination.
Private search (My Dump) uses:
user_id == currentUser
nearest embedding
Create the private vector index:
gcloud firestore indexes composite create \
--project=YOUR_PROJECT_ID \
--collection-group=resource_chunks \
--query-scope=COLLECTION \
--field-config=order=ASCENDING,field-path=user_id \
--field-config=vector-config='{"dimension":"768","flat": "{}"}',field-path=embeddingShared search (Shared and part of All) uses:
is_public == true
user_id != currentUser
nearest embedding
Create the shared vector index:
gcloud firestore indexes composite create \
--project=YOUR_PROJECT_ID \
--collection-group=resource_chunks \
--query-scope=COLLECTION \
--field-config=order=ASCENDING,field-path=is_public \
--field-config=order=ASCENDING,field-path=user_id \
--field-config=vector-config='{"dimension":"768","flat": "{}"}',field-path=embeddingMonitor index operations:
gcloud firestore operations list --project=YOUR_PROJECT_IDThe index is usable after the operation reports state: SUCCESSFUL and the index response shows state: READY.
- Import the GitHub repository into Vercel.
- Add all required environment variables for Production, Preview, and Development as needed.
- Deploy from
main. - After any environment variable change, redeploy the latest production deployment.
Default build settings:
- Build command:
npm run build - Install command:
npm install - Output directory:
.next
- Save a normal public web page in DumpIt.
- Open Resources and confirm
index_statusbecomesindexed. - Ask a specific question in
My Dump, for example:
What does my Firebase Authentication resource explain?
- Test
Shared. - Test
All.
If a resource remains pending, failed, or skipped, Ask DumpIt cannot use it.
Symptoms:
API_KEY_INVALID
API key not valid. Please pass a valid API key.
Fix:
- Create a key in Google AI Studio / Gemini API.
- Set it as
GEMINI_API_KEY. - Do not use
NEXT_PUBLIC_FIREBASE_API_KEY. - Redeploy Vercel.
Symptoms:
429 RESOURCE_EXHAUSTED
model: gemini-2.5-pro
Fix:
- Set
GEMINI_MODEL=gemini-2.5-flash. - Redeploy Vercel.
- Use billing/quota only if you intentionally want Pro models.
Symptoms:
FAILED_PRECONDITION: Missing vector index configuration
Fix:
- Run the exact
gcloud firestore indexes composite create ...command from the error. - For DumpIt production, create both vector indexes listed above.
- Wait for
READY.
Symptoms:
I could not find indexed resources for that question yet.
Fix:
- Confirm the target resource has
index_status=indexed. - Ask a specific semantic question instead of a single keyword.
- Check whether the source page blocks server fetches or hides text behind login/client-side rendering.
Fix:
- Confirm
FIREBASE_PROJECT_ID,FIREBASE_CLIENT_EMAIL, andFIREBASE_PRIVATE_KEY. - Preserve private key newlines as
\nin hosted env vars. - Do not expose Admin credentials as
NEXT_PUBLIC_*.
- Firebase Auth enabled.
- Firestore enabled.
- Firebase Admin env vars configured in Vercel.
- Gemini env vars configured in Vercel.
-
GEMINI_MODEL=gemini-2.5-flash. - Standard Firestore composite indexes created.
- Private vector index is
READY. - Shared vector index is
READY. - Vercel redeployed after env var changes.
-
npm run secret-scanpasses. -
npm run typecheckpasses. -
npm test -- --runpasses. -
npm run buildpasses. - A saved resource reaches
index_status=indexed. - Ask DumpIt works in
My Dump,Shared, andAll.