Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/CristianParadaLopez/cv-builder/llms.txt

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

The dashboard (/dashboard) is a protected page that shows every CV you have saved to your account. It is the central hub for managing your generated resumes — you can view, download, and delete any saved CV from here. Access requires sign-in via Firebase Authentication (Google OAuth or email/password).

Accessing the dashboard

Navigate directly to /dashboard in the browser. Unauthenticated visitors are automatically redirected to /login by ProtectedRoute before the dashboard renders. Once you land on the dashboard, the page immediately fetches your saved CVs by calling getUserCVs(user.uid) and renders them in a responsive grid, sorted newest first.

Saving a CV

After generating a CV in the Builder, click the Guardar CV button in the builder interface.
1

Authentication check

If you are not currently signed in, you are redirected to /login. After authenticating, you are sent back to complete the save.
2

Data is sanitised

Before writing to Firestore, the saveCV function recursively strips any undefined values from formData, replacing them with null, so Firestore never rejects the document.
3

Document is created in Firestore

addDoc writes a new document to users/{userId}/cvs with four fields: title, html, formData, and createdAt (set to serverTimestamp()).
4

New document ID is returned

saveCV returns the Firestore-generated document ID as a Promise<string>, which the Builder can use to reference the saved CV immediately.
The document written to Firestore has this shape:
{
  title: formData.name || "Mi CV",  // candidate's name from the form
  html: string,                      // complete generated HTML
  formData: any,                     // sanitised form values
  createdAt: serverTimestamp(),      // Firestore server timestamp
}

Dashboard features

CV Grid

All saved CVs are displayed in a responsive grid (1 column on mobile, 2 on medium screens, 3 on large screens), ordered by creation date with the newest CV first.

Title & Date

Each card shows the CV title (sourced from formData.name) and the formatted creation date, localised to the es-AR locale.

Download

Clicking Descargar triggers a client-side download of the CV as a .html file using the browser’s Blob URL API — no server round-trip required.

Delete

Clicking the delete icon prompts for confirmation, then calls deleteCV(userId, cvId) to remove the Firestore document. The card is removed from the UI immediately on success.
When no CVs have been saved yet, the dashboard shows an empty state with a Crear mi primer CV call-to-action button that navigates to /builder.

Data access functions

All Firestore operations for CVs live in frontend/src/pages/services/cvStorage.ts. The three exported functions are:
import {
  collection, addDoc, getDocs,
  deleteDoc, doc, serverTimestamp, query, orderBy
} from "firebase/firestore";
import { db } from "../../firebase/config";

// Save a new CV and return its Firestore document ID
export async function saveCV(
  userId: string,
  html: string,
  formData: any
): Promise<string> {
  const ref = collection(db, "users", userId, "cvs");
  const cleanedFormData = cleanUndefined(formData ?? {});
  const docRef = await addDoc(ref, {
    title: cleanedFormData?.name || "Mi CV",
    html,
    formData: cleanedFormData,
    createdAt: serverTimestamp(),
  });
  return docRef.id;
}

// Fetch all CVs for a user, ordered newest first
export async function getUserCVs(userId: string): Promise<SavedCV[]> {
  const ref = collection(db, "users", userId, "cvs");
  const q = query(ref, orderBy("createdAt", "desc"));
  const snap = await getDocs(q);
  return snap.docs.map((d) => ({
    id: d.id,
    ...(d.data() as Omit<SavedCV, "id">),
  }));
}

// Permanently remove a CV document
export async function deleteCV(userId: string, cvId: string): Promise<void> {
  await deleteDoc(doc(db, "users", userId, "cvs", cvId));
}
FunctionSignatureDescription
saveCV(userId, html, formData) => Promise<string>Creates a new CV document and returns its generated document ID
getUserCVs(userId) => Promise<SavedCV[]>Returns all CVs for the user, sorted by createdAt descending
deleteCV(userId, cvId) => Promise<void>Permanently deletes the specified CV document from Firestore
CV titles default to formData.name — the candidate’s full name entered in the Builder form. If you regularly save multiple CV variations for the same person (for example, tailored to different job descriptions), consider editing the name field slightly before each save to create a more descriptive title, such as "Ana García – Backend" versus "Ana García – Frontend". This makes it much easier to identify the right CV at a glance on the dashboard.
Dashboard downloads save CVs as .html files. To export a saved CV as a PDF, open the downloaded file in any browser and use the browser’s Print → Save as PDF function.

Build docs developers (and LLMs) love