V Talks Tech · 29 AUG 2025
The Blueprint: How This Blog Was Built (From Backend to Frontend)
A full-stack deep-dive into this blog's architecture, from the Node.js backend to the Next.js frontend.
- By
- Vibhishan Ranga
- Read
- 5 min
- Tags
In my first post, I talked about why I built this blog the hard way - to embrace the journey of learning. Now, it's time to pull back the curtain and show you how. This is the technical deep-dive into the tools, decisions, and the process that brought this site to life.
My philosophy has always been to build a solid foundation before worrying about the paint job. For a web application, that means starting with the backend. I wanted a robust, secure, and reliable engine running under the hood before I even thought about how it would look.
Part 1: Forging the Foundation (The Backend)
Before writing a single line of frontend code, my best friend was Postman. I meticulously planned and built the core logic of the application first.
Step 1: The Engine Room - Node.js & Express
The choice of Node.js with the Express framework was a natural starting point. It's a powerful and battle-tested combination that allows for rapid development of RESTful APIs. I structured the project modularly from day one, separating concerns into distinct directories:
-
routes: To define the API endpoints. -
controllers: To handle the incoming requests. -
services: To house all the core business logic. -
repositories: To manage all database interactions, keeping my logic clean. -
middleware: For crucial tasks like authentication and error handling.
This clean architecture made the entire system easier to build, debug, and maintain.
Step 2: The Brains - Database Design with Prisma
I wanted to spend my time on application logic, not writing boilerplate SQL. Prisma was the perfect co-pilot for this. As a modern ORM (Object-Relational Mapper), it allowed me to define my entire database schema in a simple, readable file.
My core database models are:
-
User: To handle accounts, roles (guestvs.admin), and hashed passwords. -
Post: The heart of the blog, containing everything from thetitleandslugto thecontentitself. -
Subscriber: To manage the newsletter functionality.
Prisma's migration system also kept my database schema version-controlled and in sync with my application code - a lifesaver for any project.
Step 3: The Bouncer - Security & Authentication
A house needs locks, and an application needs security. I implemented a few key layers of protection:
-
JSON Web Tokens (JWT): For handling user logins. Once a user logs in, they receive a token that grants them access to protected routes, like the admin panel for creating posts.
-
Password Hashing: Using
bcryptjs, all user passwords are securely hashed before they ever touch the database. -
Role-Based Access: Middleware checks not only if a user is logged in, but also if they have the correct role (e.g.,
admin) to perform sensitive actions. -
Spam Protection: I integrated Google reCAPTCHA on the newsletter signup form to keep bots at bay.
With a fully functional and tested backend, it was time to give this engine a body and a dashboard.
Part 2: Designing the Cockpit (The Frontend)
With my API endpoints responding beautifully in Postman, I confidently moved on to building the part you're interacting with right now.
Step 1: The Chassis - Next.js
For the frontend, Next.js was an immediate choice. As a React framework, it offers a powerhouse of features perfect for a content-driven site like a blog:
-
Server-Side Rendering (SSR): This is a huge win for SEO. It means search engines can easily crawl and index my blog posts, helping people discover the content.
-
File-Based Routing: Creating new pages is as simple as creating a file, which keeps the project structure incredibly clean. Dynamic routes, like
[slug]/page.tsx, automatically generate the unique URLs for each post. -
Dynamic Metadata: The
generateMetadatafunction allows me to programmatically set the title, description, and social sharing images for every single post, which is critical for how links appear on platforms like X or LinkedIn.
Step 2: The Admin Panel - A Gift to My Future Self
One of the first things I built was not for you, the reader, but for me. I created a simple, secure admin dashboard on the frontend where I can easily write, edit, and manage all my blog posts. This was a crucial step to make blogging sustainable. All the communication between this admin panel and the backend is handled by a centralized API layer (/lib/api.ts), keeping the code clean and typed.
Step 3: The Look & Feel - SCSS Modules and CSS Grid
I wanted full control over the design without the chaos of global stylesheets.
-
SCSS Modules: This was the perfect solution. I get the power of SCSS (variables, nesting) with the safety of locally-scoped class names. This means the styling for one component will never accidentally break another.
-
A Grid-First World: The entire layout is built on a custom, responsive CSS Grid. On a desktop, it might be an 18x9 grid, allowing for precise and creative placement of elements. On mobile, that grid completely reconfigures, often flipping to a 9x18 aspect ratio to perfectly suit a vertical screen.
Step 4: The Final Polish - Animations & User Experience
Static pages are functional, but animated ones tell a story. I used Framer Motion to breathe life into the UI, from the full-screen grid animation you see on first load to the sequential "wave" effect on my logos.
To elevate the experience, I added a final touch:
- Smooth Scrolling: The
lenislibrary provides a wonderfully fluid scrolling effect that feels much more premium than the browser's default.
The Journey Continues
Building this blog from the ground up - backend first, then frontend - was a deliberate choice. It forced me to think like an architect and then a designer. Every piece of this stack was chosen for a reason, and putting them all together has been an incredible learning experience.
I hope this gives you a clearer picture of what's going on "under the hood".
As this is also a long-term project for me, I will keep adding features to make the website faster and better and I will be sharing all my learnings via this blog. Keep visiting and do get subscribed for all the latest posts!


