How saadmansakib47/presume works
Purpose and entry points
Pesume is a Next.js LaTeX resume builder: users select a CV template, edit structured resume data, inspect a visual/LaTeX preview, and export TeX or browser-printed PDF. The primary UI entry is app/page.tsx; global application shell and styling originate in app/layout.tsx and app/globals.css.
Client-side builder state
The resume editing workflow is centered on typed CV data and a reusable state hook. hooks/useCVData.ts owns or coordinates mutable CV state, while lib/cv-types.ts defines the document model and template presets. This creates a boundary between form interactions and render/export implementations.
Form composition and data capture
components/CVForm/CVForm.tsx is the consolidated editor controller. It composes personal details from components/CVForm/PersonalInfo.tsx, section editing from components/CVForm/BasicSections.tsx, and visibility/template-related controls from components/CVForm/SectionToggles.tsx. Form output feeds the shared CV data model rather than rendering directly into exports.
Template selection and visual rendering
The application supports distinct CV layouts rendered as React/HTML: components/templates/ClassicCV.tsx provides the two-column classic design, while components/templates/ProgrammerCV.tsx provides the technical single-column layout. components/TemplateBrowserModal.tsx exposes template choice, with visual assets under public/templates and community template metadata at public/community-templates.json.
Preview and export pipeline
components/CvPreview.tsx is the presentation/export boundary: it displays the selected HTML template and exposes generated LaTeX for inspection or download. lib/latex-template.ts converts typed CV data into template-specific compile-ready TeX, relying on lib/latex-utils.ts for escaping and formatting. Browser print styling in app/globals.css produces the PDF-oriented output; lib/generate-pdf.ts is the dedicated PDF-generation utility boundary.
Server API boundaries
Two Next.js route handlers provide backend extension points: app/api/chat/route.ts handles AI-chat requests, and app/api/generate-cv/route.ts handles CV-generation requests. These isolate external/service-backed capabilities from the client editor; the repository structure does not establish the specific AI or TeX compilation provider.
Runtime and artifacts
The app runs on the Next.js/TypeScript runtime (next.config.ts, package.json) and is deployable as a standard Next.js application with server route support. TeX source templates and samples are maintained separately from React renderers in templates/base-moderncv.tex, cv-samples/classic-cv.tex, and cv-samples/programmer-cv.tex, enabling local or third-party LaTeX compilation after export.
Main entry points: page.tsx Resume builder page · CvPreview.tsx Preview & export boundary · CVForm.tsx CV form controller · useCVData.ts CV state hook
Components 21
Next.js UI
- App shell & styles · Global shell and screen/print styling.
app/layout.tsx - Resume builder page · Primary client entry point.
app/page.tsx
CV Editor
- CV form controller · Composes structured resume editing.
components/CVForm/CVForm.tsx - Personal details editor
components/CVForm/PersonalInfo.tsx - Section editor
components/CVForm/BasicSections.tsx - Section & visibility controls
components/CVForm/SectionToggles.tsx - CV state hook · Owns mutable document state.
hooks/useCVData.ts - CV model & presets · Typed document schema and template presets.
lib/cv-types.ts
Rendering & Export
- Template browser · Selects available CV layouts.
components/TemplateBrowserModal.tsx - Template catalog assets · Preview assets and community metadata.
public/templates - Preview & export boundary · Displays HTML layout and exposes TeX export.
components/CvPreview.tsx - Classic CV layout · Two-column HTML resume.
components/templates/ClassicCV.tsx - Programmer CV layout · Technical single-column HTML resume.
components/templates/ProgrammerCV.tsx - LaTeX generator · Builds template-specific compile-ready TeX.
lib/latex-template.ts - LaTeX formatting · Escapes and formats TeX values.
lib/latex-utils.ts - PDF generation utility · Dedicated PDF-generation boundary.
lib/generate-pdf.ts
Server APIs
- AI chat API · Isolates service-backed chat requests.
app/api/chat/route.ts - CV generation API · Isolates service-backed CV generation.
app/api/generate-cv/route.ts
TeX Artifacts
- Base moderncv source
templates/base-moderncv.tex - Classic TeX sample
cv-samples/classic-cv.tex - Programmer TeX sample
cv-samples/programmer-cv.tex
Connections 24
- App shell & styles → Resume builder page: hosts
- Resume builder page → CV state hook: uses
- Resume builder page → CV form controller: renders
- Resume builder page → Template browser: opens
- Resume builder page → Preview & export boundary: renders
- CV form controller → Personal details editor: composes
- CV form controller → Section editor: composes
- CV form controller → Section & visibility controls: composes
- CV form controller → CV state hook: updates
- CV state hook → CV model & presets: uses
- Template browser → Template catalog assets: reads catalog
- Template browser → CV state hook: selects template
- CV state hook → Preview & export boundary: supplies CV data
- Preview & export boundary → Classic CV layout: renders selected layout
- Preview & export boundary → Programmer CV layout: renders selected layout
- Preview & export boundary → LaTeX generator: exports TeX
- LaTeX generator → LaTeX formatting: formats values
- Preview & export boundary → PDF generation utility: generates PDF
- App shell & styles → PDF generation utility: print styles · Global print CSS supports browser PDF output.
- LaTeX generator → Base moderncv source: aligns with
- Base moderncv source → Classic TeX sample: supports sample
- Base moderncv source → Programmer TeX sample: supports sample
- Resume builder page → AI chat API: AI requests
- Resume builder page → CV generation API: generation requests