Harshit DuggalWorkAboutDark FunnelBlog
Harshit Duggal
Work with me

A hiring product where the job board updates itself

Candidates apply without an account. Founders watch applications land live. Here's how I shaped the system, the screens, and the realtime layer between them.

System designProduct UXRealtime architecture
flyai.opalhq.fun

Summary

Founders post a role. Candidates apply. Both sides see it live.

Fly AI is a hiring surface for small teams. Candidates browse and apply with no account. Founders publish a role, watch applications arrive as they happen, and reply with an AI draft they edit and send themselves.

Product thinking

Small teams need a quieter hiring tool. Most hiring software is built for recruiters who hire all day. A founder has twenty minutes and a candidate has less patience than that, so I designed for those two people and cut the rest.

1
Next.js app and 1 Postgres database. No separate API, no broker.
0
accounts a candidate needs to apply
~2.5s
worst case for an update to cross instances
100%
of publishes and sends start with a founder's click

Status

Solo build, live. Every call in this codebase is mine, including the ones I'd revisit (listed near the end). Each claim carries a tag: Shipped is live, Measured I timed it, Reasoned I worked it out on paper, Assumed is untested.

System design

One app. One database. Three speeds.

It's a server-first modular monolith. Server Components render the UI. Neon Postgres holds the truth. Pinecone holds a searchable copy of the jobs. TanStack Query caches reads in the browser, and a small event stream tells that cache when to refresh. Four services do the work I'd rather not build: Reflection AI, OpenRouter, Exa and Resend. Shipped

The pieces look heavier than the traffic justifies, and they are. I built them to keep the request, intelligence and realtime planes separate and the failure modes explicit, not because the job board has earned that scale. The shape is the reasoning; the traffic is not the argument. The product runs at three speeds, and I keep them apart on purpose.

PlaneWhat runs thereIf it fails
Request
pages, sessions, reads, writes
Someone is waitingShow a skeleton or redirect. Never crash.
Intelligence
embeddings, search, drafting, email
Nobody, or one explicit clickFall back to SQL or the plain form.
Realtime
events after writes
NobodyDrop the event. The next refetch fixes it.
Three planes, three failure behaviors.

Three rules behind most decisions

  1. 1.Postgres is the only truth. Pinecone stores ids and vectors, never authority. Every search result is re-read from Postgres before it reaches a screen, so a stale vector costs recall and leaves correctness alone. Shipped
  2. 2.Nothing slow lives in a render. Models, embeddings and email run after the response or behind a button. Shipped
  3. 3.Writes announce themselves, reads get invalidated. The UI is eventually consistent, with a gap of milliseconds.

Small choices I like

  • One founder, one company. The company id is the user id, so there are no roles, no membership table and no tenant switcher.
  • Archive instead of delete. Hiding a role is one UPDATE, and applicants and history stay.
  • Gate at the proxy. Onboarding redirects there, so it's a real 307 and not a client redirect wrapped in a 200.

Product UX

Every screen has one job.

For each screen I asked what this person came here to do. If two actions compete, the screen hasn't decided yet.

ScreenThe one job
Landing
headline, one search field
Search
Jobs
a list, three filters
Find a role
Job detail
Apply
Apply
one form
Submit
Dashboard
four tabs
Run hiring
Applicant
person, links, resume
Contact them
Screens and what each one is for.

How that shows up

  • No account for candidates. The signup wall is the biggest drop-off in a hiring funnel, so there isn't one. Shipped
  • The resume fills the form. The server extracts the text, Reflection returns strict JSON, and anything it can't find stays empty. The candidate checks and submits.
  • Onboarding is three questions: headcount, industry, talent needs, all fixed choices. Paste a domain and AI pre-fills them from the live site, then the server clamps every value. Shipped
  • Feedback stays small. Skeletons match the final layout, the search button carries its own loader, saves return you to where you were, and empty states are single sentences.

AI drafts, people decide

Autofill fills fields you can see. Resume parsing pre-fills a form the candidate submits. Outreach is a subject and body you edit and send. Post edits save when you click save. Publishing and emailing always start with a person, and I drew that human step as a dot on the architecture diagram because it's part of the structure. Shipped

Quiet by design

Warm stone surfaces, hairline borders, one accent per meaning. Open posts show as a number beside a label, and a new applicant is one toast with one link. The CRM is a list with inline actions, so there's no drag state to keep in sync.

Realtime job data

A write on one side, a toast on the other.

My favorite part. A founder publishes and the role appears in candidate feeds. A candidate applies and the founder sees it land. No refresh, no socket server, no queue.

Request path
synchronous
Intelligence
deferred
Browsercandidate or founder
Proxyauth + setup gate
RSC streamSuspense shell first
Query cacheTanStack, optimistic
Server actionssession before write
Neon Postgres, Drizzle over HTTPone source of truth for both paths
sessionscompaniesjob postsapplicants
Job post / queryone embed, two uses
EmbeddingLFM-2.5 · 1024d
Pineconeindex on save, top-K
Postgres hydrateids → typed rows
Ranked jobsarchived never shown
Applypublic, no sign-in
PDF → textunpdf, server-side
Reflection AIBeam · strict JSON
Fields + notesnever invented
Resendapproved, then sent
SSE busEvery write publishes one event. Open tabs invalidate only the affected cache, and the first new applicant raises a toast.
Data flowAI or retrieval stepGate: auth or approvalBeta

Role goes live

  1. 1.The founder publishes. The action checks the live session, validates with zod, checks ownership in SQL, and writes. Company and first post commit together in one HTTP batch. Shipped
  2. 2.The server clears its short memo cache and publishes a realtime event.
  3. 3.Open tabs receive it over SSE and invalidate one key family, like ["jobs"]. The feed refetches.
  4. 4.After the response leaves, the post is embedded at 1024 dimensions and upserted to Pinecone. The founder never waits for it. Shipped

Application reaches the founder

  1. 1.The candidate submits. The write lands in Postgres and an applicants event goes out.
  2. 2.The founder's tab collapses a burst of events into one read and compares the newest id to a baseline.
  3. 3.Only a genuinely new candidate raises a toast. The backlog on first load stays silent, and a reconnect re-baselines instead of firing one toast per missed row. Shipped

Why SSE

The traffic is one-way and tiny, EventSource reconnects on its own, and there's nothing extra to run. Across instances, a 2.5 second poller compares two cheap watermarks, count(*) and max(created_at), and emits the same event. A write on instance B still reaches a browser on instance A. Reasoned

PieceWhat it doesIf it fails
In-process bus
Instant updates on the same instanceNothing to recover. The poller covers it.
Watermark poller
every 2.5s
Catches writes from other instancesUpdates arrive up to ~2.5s late.
SSE stream
comment every 20s
Stops proxies closing an idle connectionThe client reconnects and resyncs.
TanStack Query
30s refetch
Backstop if SSE is downStill correct, just slower.
Each layer of the realtime path.

Search follows the same philosophy

Free text is one embed and one Pinecone query for the top 20. I keep matches above 0.3 and within 0.12 of the best score, then re-read those ids from Postgres with archived = false. A city or country in the query filters the real rows, so "ai swe job for usa new york only" returns what the person meant. If embedding or Pinecone fails, search falls back to plain SQL and returns results. Shipped

Numbers

MetricNumberHow I know
Same-instance update
Well under a secondMeasured. Local only.
Cross-instance update
Up to ~2.5sReasoned. The poll interval.
Public feed read
One indexed queryReasoned
Semantic search
1 embed, 1 ANN query, 1 SQL hydrateShipped
Search thresholds
0.3 floor, 0.12 gapAssumed. Not tuned on real queries yet.
What I measured, worked out and assumed.

What I'd do next

  • Postgres LISTEN/NOTIFY instead of the poller, once there's more than a couple of instances.
  • Candidate vectors, so matching works both ways. The resume and job text already exist.
  • A retry queue for vector writes. Today a failed upsert is logged and a backfill script repairs it.
  • Per-user limits on AI routes, plus a small golden set per AI feature so regressions show up.
  • Tune search on real queries. The two thresholds are a starting point.

Close

How I'd work on your team.

Give me a problem and I'll take it from the first decision to the shipped screen. I like small systems that do one thing well, and I like explaining why they're shaped that way. I'll say early what I'm choosing and what it costs. Want to see it run? I'll walk you through it. flyai.opalhq.fun