A File-by-File Walkthrough of a Next.js + Redis Markdown Note App
The piece is a tutorial aimed at developers learning Next.js full-stack patterns. It maps the concrete decisions—async server components, Redis hash storage, component extraction—onto a working codebase, making the App Router model tangible for someone who has read the docs but hasn't wired the pieces together.
A markdown note-taking app built on Next.js and Redis gets a thorough, file-by-file dissection. The walkthrough covers the App Router's file-based routing, the distinction between server and client components via `"use client"`, and how `lib/redis.js` wraps a Redis hash store to serve note data. Every component in the sidebar tree—from `Sidebar` down to `SidebarNoteItemContent`—is explained, including an inline-vs-extracted component comparison.
The project also surfaces practical conventions: alias configuration so `@/` points to the project root, the BEF naming scheme for CSS classes paired with Tailwind, and a "to be continue" comment technique for stubbing future work directly in the code. The data layer uses `ioredis` to store notes as JSON strings in a Redis hash, with seed data that populates the store on first access.
The `SidebarNoteItemContent` component is a deliberate stub: it receives `expandChildren` as a prop but never renders it, which is presented as a feature—a placeholder that signals where future expansion belongs without breaking the current render.
The project treats `initialData` as a seed mechanism inside the data-access function itself rather than a separate migration step, so the Redis store populates automatically on the first read when it's empty.
Calling the comment-driven planning approach 'specification-driven programming' reframes a common habit—leaving TODO comments—as an intentional workflow for breaking work into AI-generable component units.