shivam@portfolio: ~/projects/pahredar/under-the-hood
…

shivam@portfolio:~$ cat README.md

cd .. # Pahredar — self-hosted security intelligence

// Pahredar — self-hosted security intelligence

Under the hood

A modular monolith in Go over Postgres, and a sync engine that keeps 430k+ records current without ever clobbering data.

shivam@portfolio:~$ cat notes.md

One binary, three services

 external sources: cvelistV5 · NVD · CISA KEV · EPSS · Exploit-DB · Metasploit · Nuclei · feeds
                               │ scheduled HTTPS pulls
 ┌─────────────────────────────▼──────────────────────────────┐
 │ backend (Go, single binary)                                │
 │   intelligence · news · endpoint scanner   (services)      │
 │   store · config · scheduler · job queue · HTTP  (core)    │
 └───────────────▲─────────────────────────────┬──────────────┘
                 │ JSON                         │ SQL (pgx)
      React + Vite frontend               Postgres: source of truth
      (nginx, proxies /api)               + full-text search

Pahredar is a modular monolith: each product service owns its domain over a shared core. One deployable, because a single operator and $0 hosting rule out microservices, but clear seams so services grow independently. Cross-service reads go through named interfaces — the scanner asks intelligence "which CVEs affect this technology?" without touching its internals.

A sync engine you can trust

  • Idempotent: every job is an upsert, so re-running a job or replaying a window is safe.
  • Cursor-based: incremental jobs only advance their cursor after a successful commit.
  • Never concurrent with itself: a Postgres advisory lock guards each source.
  • Failures are isolated: a failing source doesn't block the others; it is retried with exponential backoff.
  • Bulk loads use COPY into a staging table, then one INSERT … ON CONFLICT DO UPDATE.
  • No clobbering: CVE writes are serialised and every writer derives the row from both the CVE List and NVD records, so neither job can overwrite the other's contribution with stale data.

The first start streams the ~615 MB CVE List archive without writing it all to disk, pulls NVD four pages at a time inside its rate limit, and the database ends up around 4.5 GB.

Data sync: every source, its last success and cursor, with a manual run button

Built with

Go (standard library HTTP, pgx, goose migrations embedded in the binary), Postgres 17 with tsvector full-text search and pg_trgm, React + Vite + TypeScript with TanStack Query, Tailwind and Recharts, all run with Docker Compose.

$_

Achievements

Level 1 · Visitor · 0 XP —

Save your progress

Sign in to keep your points on every device and spend coins to unlock themes and colour palettes. Everything you earned as a guest comes with you.

Loading sign-in options…

We store the name and email address your provider shares, to save your progress. Shivam Sharma may use your email to get in touch. You can delete your account at any time from this window. Privacy

Shop