← back to work
case · 03 / 04

Aplyra

A TypeScript monorepo built as an architecture exercise: hexagonal design, interchangeable AI providers and a guard against invented facts.

github.com/matosr96/Aplyra ↗
Role
Creator · Architect · Solo dev
Period
2026
Stack
TypeScript · Turborepo · Fastify · MongoDB · OpenAI / Gemini

Why it exists

AI résumé generators usually have two problems: (1) they hallucinate — adding experiences, certifications or technologies that don’t exist — and (2) they re-call the model every time you ask for a small change, which costs money and time.

Aplyra is my attempt to fix both. I also built it to push my own idea of how disciplined a hexagonal architecture in TypeScript can be when no one is pressuring you to take shortcuts.

The decisions that matter

Strict hexagonal, enforced by ESLint. Four ports define the only ways the domain talks to the outside world (AI, persistence, rendering, search). ESLint rules block adapter imports from the domain: lint fails if you break the architecture.

Two interchangeable AI providers. OpenAI and Gemini, behind the same port interface. Switching provider is switching an env var; the domain never finds out.

Anti-hallucination guard. After generation, I compare the output résumé against the input facts. If jobs, education or skills appear that weren’t in the source, the CV is rejected and the model is asked to fix it.

Reuse before asking again. If a job offer is very similar to one already analysed (Jaccard similarity), that analysis is reused instead of calling the model again.

240+
tests
4
hexagonal ports
2
AI providers
3
retries before rejecting

What I learned

That architectural discipline isn’t optional when you work alone. Without code review, the only thing protecting you from shortcuts is making shortcuts technically impossible — via linters, types, and explicit barriers.

Also that reusing results is a very cheap way of building product. Every LLM call you avoid is money, latency and carbon footprint. Reusing a similar analysis is worth more than almost any prompt optimization.