DEV Community

Cover image for Show Dev: I Built ByteNews — A High-Density Hacker News Clone on Next.js 14 & Cloudflare D1

Show Dev: I Built ByteNews — A High-Density Hacker News Clone on Next.js 14 & Cloudflare D1

⚡️ Live Demo: https://forxbytes.pages.dev

⭐️ GitHub Repo: https://github.com/QuantumTechCoder/ByteNews


I love Hacker News for its signal-to-noise ratio and fast information density. But modern web design often ruins forums with rounded bloated cards, slow hydration, and massive JavaScript payloads.

So I built ByteNews — an edge-native, zero-bloat Hacker News clone crafted with Vercel's Geist design system, Next.js 14 App Router (RSC), and Cloudflare D1.

Here is what it looks like running in production:

ByteNews Homepage Feed


The Vision: Pure Information Density

ByteNews rejects standard dashboard bloat:

  • Zero Drop Shadows & No Rounded Card Clutter: Crisp 1px hairline borders (border-neutral-800).
  • True Monochrome Palette: Pitch-black background (#000000), elevated surfaces (#0A0A0A), and crisp text (#EDEDED).
  • Hacker News Orange Accent (#FF6600): Reserved exclusively for the [B] logo badge, active nav tabs, and upvote triangles.
  • Geist Typography: GeistSans for readability in article titles and discussion text; GeistMono for tabular ranks, points, comment counts, and karma scores.

Deep Nested Discussion Trees

Discussions are the soul of community forums. ByteNews features infinitely nested comment trees with hairline indentation lines, collapsible threads with instant counter tags [+ X collapsed], and inline reply forms:

ByteNews Discussion & Comments

Every upvote updates optimistically with React's useOptimistic and Server Actions — 0ms perceived lag.


The Edge Architecture

Most Next.js deployments rely on standard Node.js containers and external Postgres databases, causing 200–500ms database connection latency.

ByteNews runs 100% on Cloudflare's Edge:

┌──────────────────────────────────────────┐
│        Client / Mobile PWA (0ms)         │
│     (Service Worker + Stale-While-Reval) │
└────────────────────┬─────────────────────┘
                     │ HTTP / Server Actions
                     ▼
┌──────────────────────────────────────────┐
│        Cloudflare Pages Functions        │
│         Next.js 14 (Edge Runtime)        │
│       React Server Components (RSC)      │
└────────────────────┬─────────────────────┘
                     │ @prisma/adapter-d1
                     ▼
┌──────────────────────────────────────────┐
│          Cloudflare D1 (SQLite)          │
│       Sub-50ms Global Query Latency      │
└──────────────────────────────────────────┘
Enter fullscreen mode Exit fullscreen mode
  1. Pages Functions + Next-on-Pages: Each dynamic route executes as an edge worker with export const runtime = "edge".
  2. Native Cloudflare D1 with Prisma: Direct V8 bindings query our D1 SQLite cluster without TCP handshakes or connection pool overhead.
  3. HN Gravity Ranking: The algorithm calculates decayed rank in real-time: $$\text{Score} = \frac{\text{Points} - 1}{(\text{AgeInHours} + 2)^{1.8}}$$

Submission & User Profiles

Authors can publish link submissions or discussion questions in one click:

ByteNews Submit Form

User profiles feature real-time karma tallies, account creation timestamps, and inline bio editors:

ByteNews User Profile


Try It Out

I would love to hear your feedback, thoughts on the UI density, and suggestions in the comments below!

Top comments (0)