惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MongoDB | Blog
MongoDB | Blog
B
Blog
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
aimingoo的专栏
aimingoo的专栏
B
Blog RSS Feed
博客园 - Franky
V
V2EX
IT之家
IT之家
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
J
Java Code Geeks
F
Fortinet All Blogs
I
InfoQ
云风的 BLOG
云风的 BLOG
腾讯CDC
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
月光博客
月光博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
N
Netflix TechBlog - Medium
宝玉的分享
宝玉的分享
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Proofpoint News Feed
Microsoft Security Blog
Microsoft Security Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How I Built FeedLog: Three Repos, One Product
odeds · 2026-05-06 · via DEV Community

odeds

FeedLog turns GitHub issues into publish-ready changelog entries without leaving your repo. You drop @feedlog publish in an issue comment, an AI draft appears for review, you approve it, and it shows up in your public changelog. Simple concept — but shipping it involved a handful of deliberate architecture decisions I want to write down while they're fresh.

Three repos, one product

The codebase lives across three repos:

  • feedlog-api (private) — the Node backend: webhooks, AI processing, the public API your customers call.
  • feedlog-app (private) — the web dashboard: OAuth, settings, changelog management.
  • feedlog-toolkit (public, MIT) — the embeddable SDK that customers drop into their own site to render the changelog widget.

Splitting into three was a deliberate choice. The toolkit is the only piece customers integrate directly, so it makes sense for it to be public, independently versioned (we use Changesets), and separately releasable without touching internal code. The API and app ship independently too — a frontend deploy doesn't force an API restart, and vice versa.

The toolkit is a Stencil-based monorepo that outputs true web components plus auto-generated React and Vue wrappers. One component source, three framework targets.

The API stack

The API is Node with Fastify as the HTTP framework. Fastify's plugin system and built-in schema validation are a good fit for a small team: we use fastify-type-provider-zod so every route is typed end-to-end from the Zod schema to the handler — no separate OpenAPI spec to keep in sync.

For the database: Drizzle ORM on top of Neon Postgres. Neon gives us a serverless Postgres database with branching, which is useful for previewing migrations. Drizzle keeps the schema as TypeScript and generates SQL migrations via Drizzle Kit. We run migrations as a separate tsx scripts/migrate.ts step, not at startup.

Beyond the request/response path:

  • BullMQ + Redis handles async work — GitHub webhook events get queued immediately and processed by a separate worker, so the webhook endpoint always returns fast. The AI draft generation also runs through the queue.
  • Croner runs scheduled tasks in-process: a webhook recovery job that redelivers failed GitHub hook payloads every 15 minutes, plus Sentry cron monitor heartbeats for all three processes (API, events worker, external worker).
  • opossum wraps the Postgres pool as a circuit breaker so a DB hiccup degrades gracefully instead of cascading into timeouts across all requests.
  • Per-API-key rate limiting is stored in Redis via @fastify/rate-limit, so limits survive restarts and work across multiple instances.

The app stack

The dashboard is TanStack Start (React SSR) with TanStack Router and TanStack Query for data fetching. UI is Tailwind CSS v4 with Radix UI primitives following the shadcn pattern. It deploys to Cloudflare Workers via Wrangler — edge-deployed SSR with no cold start tax.

DB design decisions

This is the part I spent the most time thinking through, and all three decisions have held up well.

UUIDv7 as the primary key

Every table uses UUIDv7 as its primary key, generated by a Postgres extension (uuidv7() as the column default). UUIDv7 is time-ordered and monotonically increasing, which means:

  • New rows always insert at the end of the B-tree index — no page splits, no fragmentation.
  • The UUID itself encodes the creation timestamp, so we don't need a separate created_at column on every table.

The one real downside: the Neon console and Drizzle Studio just show the UUID as a UUID. They don't decode it into a human-readable timestamp. It's a small operational annoyance — when you're scanning rows manually you can't immediately see when a record was created. We handle this by having a extractCreatedAtFromUuid7 SQL helper we call when we need the timestamp in a query.

Prefixed public IDs

Internal primary keys are UUIDs and never leave the system. Every table that gets exposed through the API also has a public_id column: a short, URL-safe string with a meaningful prefix.

usr_a3b7kx9m2p1z    user
ins_q8tnrfw4j6yd    installation
rep_c2mh5vp0xk3a    repository
iss_e9rz1db7yt4n    issue
pk_lw6gc8nu0fqj     API key

Enter fullscreen mode Exit fullscreen mode

The IDs are prefix_ + 12 characters of base36 nanoid (customAlphabet('0123456789abcdefghijklmnopqrstuvwxyz', 12)). The prefix serves as an immediate type hint when you see an ID in a log, a support ticket, or a URL — you know instantly what kind of entity you're dealing with. Stripe popularized this pattern for good reason.

Soft deletes on every table

All tables have a deleted_at timestamp column, and every delete — no matter how trivial — goes through a soft delete. Even rows that could safely be nuked immediately get deleted_at set instead of being removed.

The pros:

  • Accidental recovery. When something goes wrong in production and a record gets deleted it shouldn't have, you can restore it with an UPDATE. No backup restore, no data archaeology.
  • Audit trail. You can always see what existed and when it was removed.
  • Undo flows are free. Upvotes are a good example: when a user un-upvotes something, we set deleted_at. When they re-upvote, we set deleted_at = null. The code for "toggle" is trivial — no insert/delete cycle, just a field flip.
  • Safer debugging. In production you can query soft-deleted rows alongside live ones to understand what happened, without the risk of it being too late.

The obvious tradeoff is that tables accumulate soft-deleted rows over time. The plan for that: a per-table cleanup cron that runs periodically and hard-deletes rows where deleted_at is older than a configurable threshold. We already have croner running in-process and the infrastructure for scheduled work, so this is a straightforward addition — each table can configure its own retention window before a permanent delete runs.

What I'd do differently

Honestly, not much yet. The main thing I'd reconsider is whether croner running in-process in the API server is the right home for cleanup jobs long-term, or whether they should live in a separate scheduled job process. In-process is simpler to start with, but it means every API instance races to run the same cron, which requires a distributed lock. For now the jobs are idempotent enough that duplicate runs are harmless, but it's something to revisit as the system grows.