2 min readEngineering
How this portfolio is built
Next.js 16, typed data files, a Sanity blog and a contact form on Resend: the choices behind this site.
By Mihir Amin
This site is a small Next.js app. Here is how its parts fit together, and why each one is there.
Content lives in typed data files
Projects, experience, skills and achievements are TypeScript files in src/data, not a CMS: that content changes a few times a year, and a typed file, checked against a schema at build time, catches a missing field before it reaches the live page.
Every optional field stays empty until it is confirmed, and the UI hides anything that is empty. A project without a live demo simply has no demo button.
Pages are prerendered
The site uses the App Router with Cache Components. Every project page is generated at build time, and unknown URLs return a real 404.
Posts live in Sanity
Writing is the one part that changes often, so posts live in Sanity and are edited in a Studio embedded in the site. The site reads only published documents, so drafts never appear, and a webhook refreshes the blog as soon as a post is published. The blog index is one query:
*[_type == "post" && defined(slug.current)] | order(publishedAt desc)The Writing link in the navigation only appears once the first post exists.
The contact form is a server action
The form posts to a server action. It validates the fields with zod, drops bot submissions caught by a hidden field, and sends the message through Resend with the sender's address as the reply-to.
Design
The look is an editorial blueprint: near-black paper, ivory type, Geist Sans and Geist Mono, one serif italic word per heading and one blue accent. Motion is limited to short transitions and hover states, and it switches off when your system asks for reduced motion.
- Next.js
- Sanity
- Resend
- portfolio