Skip to main content

Case study

How AppliHawk
is built

A production job-search SaaS — the architecture, the AI cost control, and the trade-offs behind it. Designed, built, tested, and operated end-to-end by one engineer.

1657
backend tests
62
live AI tests
497
frontend tests
5
E2E browsers
~$0.01
AI cost / user·mo
34
MCP tools
140
pinned dependencies
1
engineer

The system at a glance

Every box below is operated by one person — which is the point of most decisions on this page.

AppliHawk system architectureBrowsers load the static SvelteKit frontend from Cloudflare Pages and call the FastAPI backend on Railway, which uses PostgreSQL and Redis. A Celery worker handles background jobs and email via Resend. Both API and worker call Gemini. Claude connects through an OAuth 2.1 MCP endpoint on the API.BrowseruserCloudflare PagesSvelteKit · staticFastAPIRailway · DockerREST + /mcp (OAuth 2.1)PostgreSQLAlembic migrationsRediscache · queues · limitsCelery worker + beatreminders · digests · backupsrecap nudges · GDPR purgeGeminiscoring · parsing · capsResendtransactional emailClaude / MCP clientsper-user opt-in · liveOAuth 2.1

Highlighted boxes are AppliHawk's own code; the plain ones are managed services. Dashed means per-user opt-in.

The decision log

Six decisions, in the order the system was reasoned about. Each one names the constraint it answers and the trade-off it accepts.

  1. D-01 · STACK

    One engineer runs everything, so the architecture must be operable by one person

    Constraint Build, deploy, and on-call are all the same person. A monorepo keeps everything together and GitHub Issues tracks the work.

    Decision Async FastAPI in a single Docker image on Railway for the backend service. The frontend is SvelteKit compiled to static files on Cloudflare Pages. Typed end to end — Pydantic on the wire, TypeScript strict in the client.

    Trade-off There is no server-side rendering. Public pages are prerendered; the app itself is a pure SPA.

    Railway over AWS's free tier: the request to raise the sending limits on AWS's email service was declined without a stated reason, with a pointer to the terms instead. A few dollars a month for services that answer questions is the better use of one person's time.

  2. D-02 · AI COST

    AI features must never produce a surprise bill

    Constraint LLM calls are the only cost that scales with user behaviour rather than user count.

    Decision Scoring is on-demand only — a user clicks, a score happens, nothing fires ambiently. Per-user daily quotas, plus an admin cost dashboard with spending alerts and hard caps that fail closed.

    Trade-off To the user, the product feels hands-on rather than automatic. That is acceptable.

    Gemini Flash-Lite keeps the marginal cost near $0.01 per active user per month — the caps exist for the day that assumption breaks.

  3. D-03 · FAIRNESS

    AI that scores job candidates has to be built like it will be audited

    Constraint Suitability scoring can brush against employment-discrimination territory (EEOC).

    Decision Scoring prompts were audited: protected-class proxies stripped from inputs, scores framed as advisory, with UI disclaimers that it is not professional advice and the decision stays with the user. All AI input passes through sanitisation and hardened system prompts (prompt-injection defence).

    Trade-off Less flattering scores than a naive prompt would give. More defensible ones.

    The scoring explains its reasoning per dimension (skills, experience, location) so users can disagree with it intelligently.

  4. D-04 · PRIVACY

    Job-search data is sensitive, so leaving must be as easy as joining

    Constraint Users trust the app with their employment situation. GDPR is the floor, not the ceiling.

    Decision One-click JSON export of everything (Art. 20). Account deletion schedules a 30-day recovery window, then a background job purges for real (Art. 17). Resumes are parsed into a structured profile and the file is discarded — never stored.

    Trade-off Re-parsing requires re-uploading. A file that is not kept cannot leak.

    Consent is tracked per purpose, and the deletion purge is a scheduled worker task, not a manual promise.

  5. D-05 · MCP

    AI assistants are becoming a user surface, so the tracker speaks MCP

    Constraint Connecting Claude to user data safely means real authorization, not API keys in config files.

    Decision A full OAuth 2.1 authorization server in front of an MCP endpoint whose tools cover everything the web app can do except the AI calls: scope-separated consent, per-user enablement that defaults to off, DNS-rebinding allowlist, per-user rate limits.

    Trade-off The endpoint mounts only when configured, so an unconfigured deploy has zero MCP attack surface. Live in production since the tool contract was rebuilt against a real client.

    "Book round two for Thursday and remind me to email the recruiter" is the demo. The OAuth server behind it is the engineering.

  6. D-06 · OPERABILITY

    Failures surface to one person, so deploys have to be reliable

    Constraint There is no ops team, no QA team, and no second opinion at 2am.

    Decision 1657 backend tests plus 62 integration tests against the live LLM. 497 frontend tests, E2E across five browser targets. A compiled dependency lockfile, real health checks (DB and Redis, not just 200 OK), and startup validators that refuse to boot with production misconfiguration. Nightly backups to Cloudflare R2, Sentry and PostHog in the EU, and a dead-man's-switch heartbeat on the worker.

    Trade-off Feature cadence is slower. Deploys are boring. "May you live in interesting times" is treated like the curse it is.

    The startup validators are the favourite: a prod deploy with a placeholder secret or localhost CORS origin refuses to start, loudly.

Work with me

Need something like this built?

Everything on this page — product, backend, frontend, AI integration, and the operations around it — was built by me. If you need a production-grade tool, an AI feature done responsibly, or a full product taken from idea to deploy, I'm available for freelance work.