Engineering case study

Building an AI product, with AI

LuminaAI turns a master profile into CVs and cover letters tailored to each job offer, scored and fact-checked by AI. I built it for my own job search — and as a place to try new tools and show how I work with AI.

A real product

I use it for my own applications: import, coaching, tailored CVs, scores, PDF export.

A tech lab

Where I try the latest models, SDKs and framework versions on a real codebase.

An AI showcase

AI inside the product, and AI agents in the way it is built — every decision documented.

Try the app
Architecture decisions
35
Tests written
429
Milestones
26
Languages
2

The product

From a static profile to applications tailored to each offer.

  1. Profile import

    Upload a CV or a LinkedIn PDF export; AI structures it into a master profile, which can be exported as Markdown at any time.

  2. AI profile coach

    Document your achievements one question at a time. Switch between conversations, rename or archive them, and dictate answers in supported browsers.

  3. Tailored or role-oriented CVs

    Paste an offer, or target a role enriched with a standard competency blueprint; the CV introduces your professional identity and the role family you seek, then presents the relevant experience.

  4. Cover letters

    A matching cover letter for each application that adds what the CV cannot say — why this company, and the strengths the role needs, each backed by one line of evidence — editable before export.

  5. Fit scores and fact-check

    Profile and CV assessed with the same requirements rubric, with evidence gaps and a check for unsupported claims.

  6. Document styles and language

    Two layouts and four palettes shared by the CV and the cover letter, an accent colour kept readable automatically, and a default language the documents are written in — each overridable per application.

  7. PDF export and tracking

    Print-quality PDFs in an editorial dark layout with numbered sections, and an application tracker with status history, updated from the dashboard or the review page, in English and French. Rejected and withdrawn applications record the stage reached and why, and an outcomes page groups them by company.

  8. Stack per role

    Each experience lists its stack by category (languages, data, cloud, CI/CD, monitoring, methods, tools), printed under the role; it can be extracted from an existing profile and reviewed before saving.

  9. Clear message on old browsers

    Browsers too old to run the app get a lightweight page instead of a broken one: it presents LuminaAI with its video and lists the minimum versions for iPhone and iPad, Android, Windows and Mac.

AI in the product

Models are treated as interchangeable components with contracts: schemas, fallbacks, judges and costs.

  1. One model per feature

    Each AI feature has its own primary model, fallback from the other vendor and reasoning effort, chosen for what it does and what it costs.

    ADR-0006
  2. Typed structured outputs

    Every generation returns JSON validated against a Zod schema, typed end to end from the model to the UI.

    ADR-0006
  3. Writer and judge from different vendors

    CVs are written by one vendor's model and fact-checked by another's, so the writer never grades itself.

    ADR-0008
  4. Scores computed in code

    Models grade weighted criteria; the overall score is computed in code, so it always agrees with the breakdown.

    ADR-0009
  5. Prompt caching

    The master profile is sent as a cached prefix, cutting cost and latency of repeated calls — measured in the logs.

    ADR-0007
  6. Tools instead of parsing

    The coach proposes profile changes through a strict tool call validated against the real profile, not text parsed with a regex.

    ADR-0010
  7. One profile, any document language

    The CV is written in the application's language from a single profile, translated by the writer model; the fact-check accepts a faithful translation.

    ADR-0013
  8. Written for two readers

    Prompts give each CV section one job — keyword index for screening software, proof and brevity for the recruiter — and ban a named list of stock phrases in English and French.

    ADR-0014
  9. Evidence-led coaching

    The coach distinguishes confirmed facts from past proposals and enriches achievements without inventing figures or overwriting unrelated information.

    ADR-0015
  10. Recognition of applied suggestions

    The coach checks earlier suggestions against the saved profile and picks up from the changes already present.

    ADR-0020
  11. Comparable fit scores

    One rubric, weighting and evidence standard for profile and CV, versioned to distinguish historical assessments.

    ADR-0016
  12. Professional identity and direction

    The opening draws on the whole profile to introduce professional identity and the role family being sought. The target guides the objective without inventing expertise or personal motivations.

    ADR-0017
  13. Detailed evidence in the master profile

    The coach records context, decisions, contributions and results for the models that write and verify application documents.

    ADR-0021
  14. Guarded stacks

    Stack items the writer or the extraction proposes are checked in code against the profile, and against the role's own text for extraction, so no tool is invented.

    ADR-0031

Architecture

A single Next.js application deployed on serverless infrastructure.

System map

System mapBROWSERNEXT.JS · SERVERLESSMANAGED SERVICESpagesfetch · streamsstays localfallbackReact 19 UIEN/FR · streamed chatDictationWeb Speech APIProxyAuth.js session · localePagesApp Router · RSCAPI routesZod · rate limits · logsData layerParameterised SQL · per userAI layerOne model route per featurePDF rendererPuppeteer · headless ChromiumPostgreSQLNeon · JSONB documentsAnthropicClaude modelsOpenAIGPT models

CV generation pipeline

One generation for a job offer: independent steps run in parallel, and the CV is checked by a model from another vendor than the one that wrote it.

CV generation pipelinein parallelin parallelJob offerpasted orread from a URLMaster profilecareer evidence+ detailed notesTailored CVclaude-opus-5-5 · high effortfallback gpt-6.1-solProfile fit scoregpt-6.1-sol · medium effortfallback claude-sonnet-5-5Applicationsaved with itsCV snapshotFact-checkgpt-6.1-sol · medium effortfallback claude-sonnet-5-5CV fit scoregpt-6.1-sol · medium effortfallback claude-sonnet-5-5Reviewscores and gapsflagged claimsthemed PDF
  • Anthropic model first
  • OpenAI model first
  • Fallback or local only
Pages go through the proxy for sign-in and language; data and AI calls go straight to API routes, which check the session themselves. Model names are read from the code, so the diagram follows every model change.

Stack

Read from the project's dependencies at render time.

  • next 16
  • react 19
  • typescript 6
  • tailwindcss 4
  • next-intl 4
  • next-auth 5
  • ai 7
  • @ai-sdk/anthropic 4
  • @ai-sdk/openai 4
  • zod 4
  • pg 8
  • @neondatabase/serverless 1
  • puppeteer-core 25
  • remotion 4
  • vitest 5

Technical decisions

Every lasting trade-off is recorded as an Architecture Decision Record. This list is generated from the repository.

  1. ADR-0001Multi-provider AI behind one SDKSuperseded
    Context
    The app started on a single AI vendor with nested try/catch fallbacks between two of its models.
    Decision
    Use the Vercel AI SDK as a provider-agnostic layer, with one model route per feature and a fallback from another vendor.
    Trade-off
    No vendor lock-in and models swappable in one place, at the cost of two provider SDKs and two API keys. Model choices were later superseded by ADR-0006.
  2. ADR-0002Centralised input validationAccepted
    Context
    Each API route validated its input with ad-hoc checks: inconsistent errors and untyped payloads.
    Decision
    All API input schemas live in one Zod module; routes call safeParse and get fully typed data.
    Trade-off
    One file to audit and consistent 400 errors; deeply nested CV data is deliberately not validated at every internal call.
  3. ADR-0003In-memory rate limitingAccepted
    Context
    Registration and job-page scraping were expensive (hashing, headless browser, AI calls) and unthrottled.
    Decision
    A sliding-window limiter in memory, behind an interface that a Redis implementation can replace.
    Trade-off
    Zero infrastructure today, but the state is per serverless instance and resets on deploy: a best-effort defence.
  4. ADR-0004Structured JSON loggingAccepted
    Context
    Scattered console logs could not be filtered, had no severity and sometimes leaked error details to clients.
    Decision
    A dependency-free logger writing one JSON line per event, with redaction of sensitive keys and generic errors for clients.
    Trade-off
    Queryable, safe logs; less readable locally and no sampling or batching compared with a full logging library.
  5. ADR-0005HTTP security headersAccepted
    Context
    The app shipped without browser security headers (clickjacking, MIME sniffing, referrer leaks, no CSP).
    Decision
    Declare the OWASP baseline headers and a Content Security Policy for every route in the Next.js config.
    Trade-off
    Strong baseline with no code changes; the CSP still allows inline scripts until a nonce-based policy is in place.
  6. ADR-0006October 2026 model refreshAccepted
    Context
    New model generations from both vendors and a major SDK version changed prices, capabilities and APIs.
    Decision
    Keep per-feature routing, refresh every route with an explicit reasoning effort, move to typed structured outputs and fix the chat fallback.
    Trade-off
    Lower cost at equal or better quality and explicit behaviour per feature; model tiers change often, so the routing needs regular review.
  7. ADR-0007Prompt caching of the profileAccepted
    Context
    The profile, often thousands of tokens, was resent at full price on almost every call because no two prompts shared a prefix.
    Decision
    Build prompts profile-first with explicit cache breakpoints and a per-user cache key, and log cache reads and writes.
    Trade-off
    Cheaper, faster repeated calls with measurable hit rates; prompt order becomes load-bearing, and CV generation is kept out because the layout degraded its output.
  8. ADR-0008Fact-checking generated CVsAccepted
    Context
    Prompts forbid inventing facts but nothing verified it — and an invented fact in a CV sent to an employer is the worst failure.
    Decision
    After each generation, a model from another vendor lists statements the profile does not support; the user reviews them.
    Trade-off
    Invented facts surface before the CV leaves the app, for one extra call run in parallel; the judge can be wrong, so it informs rather than blocks.
  9. ADR-0009Rubric-based fit scoresAccepted
    Context
    A single holistic 0–100 score was unstable between runs and said nothing about what to fix.
    Decision
    Each score has weighted criteria graded by the model; the total is computed in code, with up to five gaps to address.
    Trade-off
    Actionable, more stable scores with explicit weights; older scores are not directly comparable.
  10. ADR-0010Coach suggestions as tool callsAccepted
    Context
    The coach wrote profile changes as JSON inside its text; malformed output or invalid targets failed silently.
    Decision
    One strict, schema-checked tool whose target path is validated against the real profile; the model retries on error.
    Trade-off
    Every suggestion shown is valid and saved conversations keep working, for slightly more latency per turn.
  11. ADR-0011This page, derived from the repositoryAccepted
    Context
    A portfolio page is only useful if it stays true; hand-written pages drift after each feature or decision.
    Decision
    Facts are read from the repository (decision records, dependencies, tests) and copy lives in translations; tests fail when a decision has no summary in both languages.
    Trade-off
    The page cannot silently miss a decision, but each new decision needs two short summaries, and features still rely on a written rule.
  12. ADR-0012CV themes: layout × palette, legible by constructionAccepted
    Context
    Users want to choose how their CV looks, but free colour choices can make a CV unreadable or clashing.
    Decision
    A theme pairs a layout with a hand-tuned palette; users may add one accent colour, whose lightness is adjusted until it meets accessibility contrast on every surface it is printed on.
    Trade-off
    Any colour stays readable and the preview matches the PDF exactly, but a chosen accent can come out visibly darker or lighter than picked.
  13. ADR-0013Documents written in the chosen languageAccepted
    Context
    The application language only changed the CV titles: a French profile generated in English gave English titles over French text.
    Decision
    Users set a default language and can override it per application; the AI writes the CV in that language from the single profile, translating it, and the fact-check accepts a faithful translation.
    Trade-off
    One profile is enough and no extra AI call is made, but switching the language of an existing application means regenerating it.
  14. ADR-0014Documents written for AI screeners and recruitersAccepted
    Context
    Generated CVs and letters read as machine-written and repeated the same achievements, while applications are now often screened by an AI model before a recruiter skims them.
    Decision
    Each CV section has one reader and one job: a short summary for the recruiter, each achievement once in the role where it happened, and a skills index in the offer's exact words. Every document avoids a named list of stock phrases, and the cover letter covers what the CV cannot.
    Trade-off
    Requirements stay explicit for screening software without repetition for humans, but style is only steered by the prompt until an automated check is added.
  15. ADR-0015Evidence-led profile coachingAccepted
    Context
    Vague duties and figures without context give document writers little reliable evidence.
    Decision
    Ask about personal contributions, tools and outcomes, preserve message attribution and validate suggestion targets and types.
    Trade-off
    Response quality still needs live model evaluation; adding whole new experiences remains manual.
  16. ADR-0016One rubric for fit scoresAccepted
    Context
    Profile and CV scores measured different things, so their difference did not reveal lost evidence.
    Decision
    Grade evidence against the same requirements and weights, version scores and recalculate both after edits.
    Trade-off
    Separate AI calls can still vary; recalculation costs more and historical scores need refreshing.
  17. ADR-0017Professional identity and directionAccepted
    Context
    A summary built around recent achievements repeats the experience section and says little about who the person is or what role they seek.
    Decision
    Introduce professional identity and a target-aligned role-family objective in both CV modes. Distinguish the role being sought from experience already acquired when checking facts.
    Trade-off
    The opening is more personal without another AI call, but its quality depends on the available profile and the model’s interpretation of the role family.
  18. ADR-0018Exclude an unpatched extraction dependencyAccepted
    Context
    An unused translation extraction watcher introduced a denial-of-service vulnerability into production dependencies, with no patched release available.
    Decision
    Upgrade Next.js for its cache disclosure fixes and disable unused extraction watching with a local dependency replacement that rejects watcher operations, keeping the production audit gate unchanged.
    Trade-off
    JSON translations and locale routing remain available, but live extraction watching requires a safe upstream dependency before it can be enabled. Development tools still have reported vulnerabilities.
  19. ADR-0019Browser dictation for the profile coachAccepted
    Context
    Explaining an achievement to the coach can mean typing a long answer.
    Decision
    Use the browser’s speech recognition to fill an editable draft. The app can request microphone access after the user starts dictation.
    Trade-off
    The browser controls support and may process the audio through its own service. The user decides when to send the resulting text to the coach.
  20. ADR-0020Coach suggestion status from profile contentAccepted
    Context
    The chat could forget that a suggestion was applied after a reload, and the coach could continue treating that change as pending.
    Decision
    Check old suggestions against the saved profile and send their current status to the coach on the next turn. Save the conversation and profile independently.
    Trade-off
    An identical manual edit counts as applied. A later edit may change the status because it reflects the content currently in the profile.
  21. ADR-0021Keep detailed evidence in the master profileAccepted
    Context
    Writing CV bullets too early compressed the context and limits of achievements before the candidate chose an application.
    Decision
    Keep editable notes by section and experience. The document writers select relevant facts, and the fact-check uses the same evidence.
    Trade-off
    Detailed notes use more model context and let the candidate reuse the same example across different applications.
  22. ADR-0022Save coach conversations on the serverAccepted
    Context
    Leaving the profile page could interrupt a browser save and bring back an earlier conversation.
    Decision
    Save messages as part of each turn, confirm resets after saving them, and load the latest conversation when reopening the profile.
    Trade-off
    Saving before the model starts adds a database write to the start of each turn.
  23. ADR-0023Archive and resume coach conversationsAccepted
    Context
    Starting a fresh chat used to erase interview context that the candidate might want to revisit.
    Decision
    Archive the current conversation when switching and show past conversations by preview and date. Protect each active conversation from older replies.
    Trade-off
    The archive stores more transcript data so candidates can resume their previous interviews.
  24. ADR-0024Recover the coach schema after a hot reloadAccepted
    Context
    A running development server can load newer coach code before its database has been upgraded.
    Decision
    Apply the same upgrade used at startup if a query reports that the coach schema is missing, then retry.
    Trade-off
    The first affected request waits for the upgrade. Requests against an upgraded database run directly.
  25. ADR-0025Keep conversation entries stable in coach historyAccepted
    Context
    Switching conversations made the History list jump, especially when it contained only two conversations.
    Decision
    Keep the active conversation visible and highlight it. Preserve the identity and date of each conversation when switching.
    Trade-off
    Older conversations use the date already available so that they can keep a stable place in the list.
  26. ADR-0026Name and manually archive coach conversationsAccepted
    Context
    Similar previews are hard to distinguish, and users sometimes want to set a conversation aside.
    Decision
    Let the current conversation be renamed or moved to Archives. A conversation can be resumed from Archives.
    Trade-off
    Archived conversations keep their transcripts and titles so they remain recoverable.
  27. ADR-0027Keep photos out of profile text savesAccepted
    Context
    A large encoded photo could block edits to another part of the master profile.
    Decision
    Save photos separately and preserve photos embedded in older profiles when saving text.
    Trade-off
    Older profiles retain their embedded photo until the user replaces or deletes it.
  28. ADR-0028Animate with plain CSSAccepted
    Context
    A more expressive visual design needed scroll reveals, animated gradients, glows and drifting background shapes across the app.
    Decision
    Build these effects as shared CSS classes plus one small viewport-entry hook instead of adding an animation library, and switch all motion off for visitors who ask for reduced motion.
    Trade-off
    No extra code is shipped to the browser, but there is no spring physics or sequencing API: complex choreography is written by hand with delays.
  29. ADR-0029A landing video written as codeAccepted
    Context
    Screenshots showed what the product does but not why it exists: a career has many facets, and a CV or an online profile shows only one.
    Decision
    Write a short video as React code with an original soundtrack synthesised from code, render it in English and French from the same translated copy, in landscape and in a portrait cut for phones, and play it muted on the landing page only once it scrolls into view, with a still image for visitors who prefer reduced motion.
    Trade-off
    The video follows the interface and both languages without re-editing, but the rendered files are committed and must be re-rendered by hand, and the rendering library needs a paid license for larger companies.
  30. ADR-0030Error codes the interface translatesAccepted
    Context
    The server answered failures with English sentences that several pages showed as they were, so French users read errors in English, and network failures showed raw browser messages.
    Decision
    The server adds a stable code to every error a user can act on, and the interface translates it, falling back to a generic message in the user's language for anything unexpected.
    Trade-off
    Every error a user reads follows the interface language, but a new error needs a code and a message in each language, or users only see the generic one.
  31. ADR-0031A stack for each roleAccepted
    Context
    The CV listed technologies globally, so a reader could not tell when, for how long or in which role each was used, and tailoring dropped the tools the offer did not name.
    Decision
    Each role keeps its own stack in fixed categories that the candidate can correct. CVs copy it, trimming only older or off-target roles and never adding a tool; existing profiles can have it extracted from their own text, reviewed before saving.
    Trade-off
    Readers see where and how long each tool was used, and a tool repeated across roles stands out, at the cost of longer CVs and a profile format older data had to be converted to.
  32. ADR-0032Content belongs to its owner, admins includedAccepted
    Context
    The admin role bypassed ownership checks, so an administrator's dashboard mixed in every user's applications and could open, edit, export or delete anyone's CVs and cover letters.
    Decision
    Every read or change of an application is limited to its owner, whatever the role. Administrators keep only account approval and the exemption from usage limits; another user's application answers as if it did not exist.
    Trade-off
    A careless or compromised administrator account no longer exposes candidates' documents, at the cost of support: inspecting a user's application now needs direct database access or a future sharing feature.
  33. ADR-0033Cover letters cite experience, they do not retell itAccepted
    Context
    Cover letters told one or two career stories in depth, and turned into project write-ups: implementation steps, tools, chains of figures and caveats about who did what.
    Decision
    The letter states why this role and two or three strengths it needs, each proven by a single sentence naming where and at what scale. It names at most three past employers, leaves the detail to the CV and the interview, and drops any fact that would need a caveat.
    Trade-off
    Shorter letters about motivation and fit that no longer compete with the CV, at the cost of no worked example of how the candidate operates.
  34. ADR-0034Why an application ended is kept on the applicationAccepted
    Context
    A rejected application only said "rejected": the candidate could not recall who ended each process, at which step or why, nor spot companies to avoid or reasons that keep recurring.
    Decision
    A new "withdrawn" status covers processes the candidate ends. Each rejected or withdrawn application keeps the stage reached, a reason from a fixed list for its side, and a free note, all optional and editable later. Reopening an application clears them.
    Trade-off
    Each application shows its outcome directly and the overview is a single read, at the cost of keeping only the last reason when an application is rejected, reopened and rejected again.
  35. ADR-0035Browsers that are too old get a page of their ownAccepted
    Context
    On an old iPad that cannot update past iOS 12, the site showed as a broken page: the styling framework and the application's JavaScript both need browsers from 2023 onwards, and supporting older ones would mean downgrading the stack and patching the whole client.
    Decision
    The supported browsers are those the web framework targets (Chrome, Edge and Firefox 111, Safari 16.4). Older ones are recognised on the server and receive a simple page, without script and with styling they can render, that says the browser is not supported, presents the product with its video, and lists the minimum version for each kind of device.
    Trade-off
    Visitors on old devices understand what happens and still discover the product, while modern browsers are untouched; recognising browsers from what they announce can miss unusual ones, so anything unclear is let through rather than blocked.

Building with AI

Development is done with AI coding agents inside an explicit framework: written context, specs, plans, reviews and automated gates.

  1. 01

    Written context for agents

    A single instruction file, read by every coding agent whatever the tool, describes the architecture, conventions and rules they must follow: translations first, queries scoped to the user, decision records, branches and conventional commits.

  2. 02

    Spec before code

    Each feature starts with a dialogue that ends in a written, approved design spec — before any implementation.

  3. 03

    Plans in small tasks

    The spec becomes a plan of small tasks, each with exact files, tests written first and its own commit.

  4. 04

    Agents execute, reviews gate

    A fresh agent implements each task; a review between tasks checks the result against the spec before moving on.

  5. 05

    Decisions recorded

    Every lasting trade-off gets an Architecture Decision Record, committed with the code that implements it.

  6. 06

    Automated gates

    Pre-commit formatting and linting; CI runs format, lint, type check, tests, dependency audit and a production build on every pull request. Production dependencies must pass the security audit; the unused translation extraction watcher is disabled because it has no upstream patch.

  7. 07

    This page keeps itself honest

    A test fails if a decision record has no public summary in both languages, so the page cannot fall behind the code.

Milestones

The main steps of the project.

  1. Editorial CV layout

    A redesigned PDF: dark editorial page, numbered sections, skill chips and exact page numbers.

  2. Document styles and language

    Layouts, palettes and a default language for the CV and the cover letter, with a live preview.

  3. Documents for screeners and recruiters

    CVs and cover letters rewritten to pass AI screening and read as written by the candidate.

  4. Evidence-led coaching

    Focused achievement interviews, clear separation of facts and proposals, and type-checked profile updates.

  5. Comparable fit scores

    A shared job-requirements rubric measures profile evidence and the evidence retained in the CV.

  6. Professional identity and direction

    CV summaries introduce who the candidate is and the role family they seek, without recapping recent jobs or copying the vacancy title.

  7. Dictation for the profile coach

    A microphone button fills the editable draft in French or English on supported browsers.

  8. Applied coach suggestions

    Suggestion cards recover their status after a reload, and the latest coach conversation stays saved after starting a new one.

  9. A more detailed master profile

    Editable notes preserve career details for CVs, cover letters and fact-checking.

  10. Coach conversation history

    History keeps conversations in place while switching, with options to rename the current conversation or move it to Archives.

  11. An animated interface

    Scroll reveals, drifting backgrounds, glowing highlights and counting fit scores across the app, all switched off for visitors who prefer reduced motion.

  12. A video of the philosophy

    A 40-second video on the landing page: one career has many facets, and LuminaAI shows the one each offer needs, without inventing anything. Phones get a portrait cut.

  13. A stack for each role

    Every role of the CV shows the tools used there, by category, so readers see where and how long each one was used.

  14. A clearer review page

    Each application's page groups the match analysis, the editable documents, its status with history, and the export, so the follow-up happens where the documents are. Its role and company can be corrected in place.

  15. Shorter cover letters

    Cover letters focus on why the role fits and what the candidate brings, backing each strength with one line instead of retelling projects.

  16. Remembering why applications ended

    Rejections and withdrawals record the stage reached and the reason (salary, on-site presence, profile fit, a failed technical step…). An outcomes page lists every application by company with counts by reason and stage.

  17. A page for old browsers

    An old iPad showed the site broken. Browsers below the supported versions now get a simple page that presents the product and says which devices can run it.

  18. Taking your profile with you

    The master profile, with its details and the stack of each role, downloads as a structured Markdown file to keep, reuse elsewhere or give to another assistant.

  19. Trustworthy AI output

    New model generation, prompt caching, fact-checking, rubric-based scores and tool-based coach suggestions.

  20. Engineering page

    This page, generated from the repository and guarded by tests.

  21. Mobile and landing page

    Responsive pass across the whole app and a refreshed landing page.

  22. Cover letters and role-oriented CVs

    Cover letter generation, and CVs targeting a role through a standard skills blueprint.

  23. Production hardening

    Four sprints: input validation, rate limiting, structured logs, security headers, CI, then a test suite over every API route.

  24. Multi-provider AI

    Move from a single vendor to per-feature routing across Anthropic and OpenAI.

  25. AI agents join the workflow

    Agent instructions and skills added to the repository; development moves to an agent-assisted workflow.

  26. First version

    A static CV with A4 PDF export, then the first Next.js application.