1 · Problem Statement

Portfolio & Blog Platform · Yaswanth Gudivada · yswnth.me

My work was spread across separate places: a portfolio here, a blog there, projects and other sites somewhere else. A reader who liked an article had no easy way to see who wrote it, what else I've built, or where else I am.

I wanted one website that brings it all together: blog, profile, projects, and links to my other sites. One single source of truth for everything about me.

And it has to stay easy to keep up: publishing must cost exactly one git push.

2 · Why This Tech Stack

Choice Why this one
Next.js 16 + MDX in git Pages built from files at build time; the repo is the CMS
Zod Checks every file, so a typo fails the build, not the live site
PostgreSQL + Drizzle Subscribers need real constraints; the schema is plain TypeScript
Resend + React Email Transactional email, templates written as components
GitHub Actions The trigger already exists: the push itself
Tailwind v4 + @shadcn/lint One set of theme tokens, enforced by lint

Content is static, so it lives in the repo. Subscribers are state, so they live in Postgres. Nothing else gets a server.

3 · High Level Diagram

PUBLISH NOTIFY READ & SUBSCRIBE content/ files posts · projects · links main Vercel build Zod-checked loaders Static pages articles · links · 404 · RSS Readers Actions: detect added posts only Broadcast job Resend → inboxes Subscribe form API routes subscribe · unsubscribe subscribers git push reads writes

Publish: Vercel builds every page from the files. Notify: Actions mails subscribers only for added posts. Read & subscribe: the only server part, two API routes and one table.

4 · Demo of the Project

5 · Low Level Diagram

CONTENT LOADERS LOGIC ROUTES blogs/**/*.mdx projects/*.mdx links/**/index.md content.ts → posts.ts readContentDir + Zod links.ts readLinkTree post-query.ts resolveLinksView terminal.ts articles/[slug] links/[[...path]] + proxy not-found (404) NEWSLETTER api/subscribe scripts/broadcast.ts subscribers.ts db.ts (Drizzle) mail.ts Resend Postgres

5 · The Code Behind It

File What its code guarantees
content.ts Same filename twice, or a bad frontmatter field, fails the build
subscribers.ts Two signups racing can't duplicate a row: the unique index is the guarantee
unsubscribe.ts Links carry a token, never the email; one-click via List-Unsubscribe-Post
broadcast.yml Only added posts send mail; edits and moves never re-send
proxy.ts /links/ShadCn → 308 /links/shadcn before routing
terminal.ts The 404 fixes a bad URL segment by segment to suggest a real page
git diff --name-only --find-renames --diff-filter=A "$BASE" "$AFTER" -- 'content/blogs/'

6 · Challenges

What fought back How I fixed it
A wrong-case /links redirect got cached over the real page on macOS Redirect in the proxy, before any rendering
Mail scanners "clicked" unsubscribe links Opening the link shows a confirm button; one-click uses POST
On the first push, git diff silently matched nothing rev-parse --verify --quiet, falling back to git's empty tree
One broadcast linked to another domain The site URL secret was wrong; present is not the same as correct
20 one-off styles broke the design system Moved into tokens and variants; 28 screenshots, zero pixels changed

Still open: re-running a broadcast re-sends it. A table keyed on the post's slug fixes it, and it's next.

4px
1 / 7
← → navigate  ·  O overview  ·  F fullscreen  ·  L laser  ·  D draw  ·  ? controls