Skip to main content
CryptoFlex// chris johnson
ShippingSubscribe
§ 01 / The Blog · Building in Public

How I Built This Site with Next.js, Tailwind v4, and Claude Code

A walkthrough of building cryptoflexllc.com from scratch - the tech decisions, the component architecture, and what I learned about modern web development along the way.

Chris Johnson··7 min read

This site - the one you're reading right now - was built in a single session with Claude Code. Not a template, not a drag-and-drop builder. Real code, real decisions, real deployment. Here's how it came together and what I learned.

The Stack#

TechnologyWhy
Next.js 15App Router with server components by default - faster pages, simpler data fetching
React 19Latest React with server component support
Tailwind CSS v4New version: all config lives in CSS via @theme blocks. No more tailwind.config.ts
shadcn/uiCopies real component source code into your project. You own it, you can modify it
MDXBlog posts as Markdown files with embedded React components. No database needed

The Big Decision: Tailwind v4#

Major Change from v3

If you've used Tailwind before, v4 is a significant change. The configuration that used to live in tailwind.config.ts now lives directly in your CSS. No more JavaScript config file.

css
@import "tailwindcss";
@plugin "@tailwindcss/typography";

@theme inline {
  --color-background: var(--background);
  --color-primary: var(--primary);
  /* ... */
}

All your design tokens - colors, fonts, spacing, border radii - are defined as CSS variables in :root and bridged to Tailwind utilities via the @theme block. It's actually simpler once you get used to it.

Dark Mode: All In#

I didn't want a light/dark toggle. The site is dark mode, period. One line in the root layout makes this happen:

tsx
<html lang="en" className="dark">

The color palette uses the OKLCH color space - a perceptually uniform system where colors with the same lightness value actually look equally bright to human eyes. The accent color is a cyan at oklch(0.75 0.15 195).

Key colors:

RoleValueWhat It Looks Like
Backgroundoklch(0.141 0.005 285.823)Near-black with a subtle blue tint
Foregroundoklch(0.985 0 0)Almost white
Primaryoklch(0.75 0.15 195)Cyan - the accent everywhere
Cardoklch(0.178 0.005 285.823)Slightly lighter than background
Borderoklch(1 0 0 / 10%)Semi-transparent white - subtle

The Component Architecture#

Glassmorphism Nav#

The sticky navigation uses a glass effect - semi-transparent background with a backdrop blur:

tsx
<header className="sticky top-0 z-50 border-b border-border/40 bg-background/80 backdrop-blur-md">

On mobile, the nav links collapse into a hamburger menu that opens a Sheet (a drawer from shadcn/ui built on Radix Dialog). It handles focus trapping, escape key, click-outside, and screen reader announcements automatically.

The asChild Pattern#

Radix Pattern

You'll see asChild throughout the code. This is a Radix pattern that means "don't render your default element - render my child instead." It's how you put button styling on a Next.js Link.

tsx
<Button asChild size="lg">
  <Link href="/blog">Read the Blog</Link>
</Button>

The result is a <a> tag with button styling, not a <button> wrapping an <a>. Semantically correct and better for accessibility.

Blog Card Interaction Pattern#

Blog cards use a CSS pseudo-element overlay pattern for clickable cards with independently interactive elements. The title link uses after:absolute after:inset-0 to cover the entire card, while tag badges sit above with relative z-10 for independent clickability:

tsx
<Card className="group relative h-full hover:border-primary/50">
  <div className="relative z-10 flex flex-wrap gap-2">
    {post.tags.map((tag) => (
      <Link href={`/blog?tag=${encodeURIComponent(tag)}`}>
        <Badge variant="secondary">{tag}</Badge>
      </Link>
    ))}
  </div>
  <h3 className="group-hover:text-primary">
    <Link href={`/blog/${post.slug}`} className="after:absolute after:inset-0">
      {post.title}
    </Link>
  </h3>
</Card>

Why Pseudo-Elements

This avoids nested <a> tags (invalid HTML) and works as a pure server component - no onClick handlers needed. When you hover anywhere on the card, the title turns cyan. Tags remain independently clickable and link to filtered blog views at /blog?tag=TagName.

The Blog System#

This is the part I'm most proud of. The blog is powered by MDX files - write Markdown, and it becomes a page on the site. No database, no CMS, no API.

How It Works#

  1. Write a file: Drop an .mdx file into src/content/blog/
  2. Add frontmatter: Title, date, description, tags at the top
  3. Done: The post appears on /blog and gets its own page at /blog/your-slug

The slug comes from the filename. my-first-post.mdx becomes /blog/my-first-post.

Blog Search and Tag Filtering#

The blog listing page includes a search bar and clickable tag filters. Search filters posts by title, description, and tags in real time. Tags use URL query parameters (/blog?tag=Security&tag=Claude+Code) so filtered views are shareable and bookmarkable. Multiple tags filter with AND logic - selecting "Security" and "Next.js" shows only posts with both tags.

Custom MDX Components#

Blog posts support custom React components embedded directly in Markdown. This includes callout boxes (like the tips and warnings you see throughout), inline product badges for tools like Vercel and Next.js, and SVG architecture diagrams. All components are registered in the MDX renderer and available to every post.

Under the Hood#

A utility file (lib/blog.ts) reads all .mdx files at build time, parses the frontmatter with gray-matter, and returns sorted post data. Because this runs in a Server Component, there's no client-side fetch, no loading spinner, no API call. The data is baked into the HTML at build time.

Blog posts are rendered with next-mdx-remote, which converts MDX to React components on the server. The typography is handled by Tailwind's prose classes - they style headings, paragraphs, lists, code blocks, and links without you writing any CSS.

Static Generation#

Every blog post is pre-built at compile time via generateStaticParams(). The result is static HTML - fast, cacheable, and SEO-friendly. When you add a new post, you push to GitHub and Vercel rebuilds automatically.

The Contact Page#

Update

The contact page was originally a client-side form with mailto: fallback. It has since been redesigned as a server component with a LinkedIn CTA and email fallback - no form state needed, no "use client" directive.

The current contact page features a prominent LinkedIn connect button and a secondary email option (Chris.Johnson@cryptoflexllc.com). Since it's now a pure server component, the metadata workaround (separate layout.tsx for SEO) is still in place but the page itself is simpler and more focused.

A common problem: on pages with little content, the footer floats in the middle of the screen instead of sticking to the bottom. The fix is three lines of Tailwind:

tsx
<body className="min-h-screen flex flex-col">
  <Nav />
  <main className="flex-1">{children}</main>
  <Footer />
</body>
  • min-h-screen - body fills at least the viewport height
  • flex flex-col - vertical flex layout
  • flex-1 on main - main grows to fill available space, pushing footer down

What I'd Change#

Looking back, a few things I'd do differently:

  1. Add a real contact form. Done! The contact page now has a LinkedIn CTA with email fallback. The mailto: approach was replaced with a cleaner, server-rendered design.

  2. Add image optimization. Blog post images should use Next.js <Image> for automatic optimization and lazy loading.

  3. Add a table of contents. For longer posts, auto-generating a TOC from headings would help navigation.

  4. Add reading time. Done! Every post now displays reading time in the header, calculated from word count.

The Full Build Guide#

If you want to build a similar site from scratch, I've written a comprehensive step-by-step guide that covers every command, every file, every decision: BUILD-GUIDE.md.

It's about 1,300 lines and walks through scaffolding, shadcn/ui setup, the dark theme, all components, the MDX blog system, SEO, and deployment. Someone should be able to follow it and build the same site.

Final Thoughts#

Building a production website in a single session feels like it shouldn't be possible. But the combination of Next.js (which handles routing, rendering, and optimization), Tailwind (which eliminates the CSS bottleneck), shadcn/ui (which gives you accessible components), and Claude Code (which writes the code while you make the decisions) made it real.

The code is open source: github.com/chris2ao/cryptoflexllc. Fork it, modify it, learn from it.


Written by Chris Johnson and edited by Claude Code (Opus 4.6). This post is part of a series about AI-assisted development. Previous: Configuring Claude Code. Next up: My First 24 Hours with Claude Code - the full day-one narrative.

Related Posts

A dark browser chrome mockup fills most of the cover: a titlebar with three traffic-light dots sits above two tabs. The dim left tab reads Cry next to a plain white triangle in a black circle, the generic Next.js placeholder favicon. The bright active tab beside it, outlined in teal, reads CryptoFlex LLC next to the real teal circuit-shield icon, with an address bar below reading cryptoflexllc.com. Small captions under the tabs read scaffold triangle, since February and real shield, shipped this week. Below, the headline Replacing the Default Favicon (Favicon in teal) is followed by a line: Two bugs were hiding in plain sight, a scaffold icon nobody ever replaced, and a manifest icon that wasn't even square. Two callout cards sit at the bottom: one shows the real 16px favicon frame blown up pixel by pixel next to the text Tuned Per Frame, Not Per Master describing the alpha and brightness boost; the other shows the number 773 next to Commits, One Untouched File. A Quick Tips series chip and a Part 2, Favicon & PWA Icons chip sit in the header, and the footer reads Cryptoflex LLC, From The Workshop with Next.js, Favicon, PWA stack tags.

My tab strip still showed the stock Next.js triangle because nobody had replaced the scaffold favicon.ico, and my web manifest pointed at a logo that wasn't even square. Fixing both took a Pillow crop, per-frame tuning at 16 pixels, and a maskable safe zone.

Chris Johnson··6 min read
Dark editorial cover for Security Review: Round Two, part 9 of the Security Engineering series. Two chips read Security Engineering and Part 9, Biannual Site Review, above a kicker reading 6 Agents, 1 Rule, Nothing Ships Without Consensus. Below, two side-by-side terminal-style code panels contrast a safe frontmatter fence against a dangerous one: the left, green-bordered panel labelled Data, Renders Fine shows a plain --- fence with an ordinary title and date, captioned Plain frontmatter fence, always just data; the right, red-bordered panel labelled Code, Would Execute shows a ---js fence with its payload marked omitted, captioned One labelled fence, now rejected before parsing, every push. Beneath the panels, the title reads Security Review: Round Two, with Round Two in teal. A mono deck line beneath the title reads The worst finding was hiding in the content folder, caught by consensus, not a scanner. A row of six chips names the review team: AppSec Pentester (Captain, Audit Lens), Red Teamer (Exploit Lens), Sec. Researcher (Novel Bugs), Threat Intel (OSINT and CVEs), Sec. Engineer (Fix Design), and an amber-accented Advocate chip (Cost vs. Risk Veto). An italic closing line reads Five lenses find it, the advocate weighs what it's worth to fix. The footer shows the Cryptoflex LLC, From the Workshop brand strip and the text Fixed and Deployed, Round Three in 6 Months.

A team of six agents, five security specialists plus an advocate representing the site owner, ran a consensus-driven security review of cryptoflexllc.com. The standout finding: an ordinary-looking blog draft that could have been parsed as executable code instead of data.

Chris Johnson··16 min read
A dark teal cover graphic titled Ledgerly, Part 3, One Design System, Eight Agents, with the kicker looked like stock shadcn, now wears the same design system as this site. On the left, a glowing teal card labelled one design system record shows the path _ds/cryptoflex-design-system/ above a mono file tree of tokens/fonts.css, tokens/colors.css, tokens/typography.css, tokens/spacing.css, tokens/elevation.css, tokens/motion.css, tokens/base.css, styles.css, and _ds_bundle.js, a chip reading linked by path, 2nd project, and an italic note that it was built for cryptoflexllc.com in April, linked rather than copied by Ledgerly's 783-line prototype in August, with the main session keeping the theme, shared components, sidebar, and dashboard. A teal bus line leaves the record, runs along the top under the labels one session, eight concurrent agents and one route directory plus its spec per agent, and drops two trunks with eight arrowed stubs into eight lane cards in two columns. Lane 01 db-engineer, schema and analytics, migrations 0004 and 0005, four new aggregates, an amber pragma bug tag, caught mid-build with two regression tests. Lane 02 transactions, transactions.spec.ts, six tests and zero lines touched. Lane 03 budgets, spec changed with the product, not the paint. Lane 04 chat, zero lines touched. Lane 05 cash flow and lane 06 recurrings, both tagged new route, covered by nav.spec.ts growing from six entries to eight. Lane 07 reports, spec changed with the product. Lane 08 import plus onboarding, zero lines touched. Along the bottom, a rail reading 46 Playwright tests, all green, with 18 outlined green squares for tests in the five spec files never touched and 28 filled squares for the five that changed with the product, and the line "One design system, eight agents at once. Forty-six tests stayed green."

Ledgerly's UI still worked but looked like stock shadcn, so the whole thing went through Claude Design and came back wearing CryptoFlex's Cyber Editorial system, the same one from April's site rebuild. Eight parallel agents rebuilt every screen against real backend constraints while 46 Playwright tests stayed green, one of them written to prove a SQLite migration bug on purpose.

Chris Johnson··27 min read

Comments

Subscribers only: enter your subscriber email to comment

Reaction

Pick a reaction

Loading comments...

Navigation

Blog Posts

↑↓ navigate↵ openesc close