Building a Modern Developer Portfolio: Cost Optimization, Admin Suites, and Serverless Next.js
An in-depth look at how I designed and built my personal developer portfolio using Next.js and Postgres, optimizing serverless costs, constructing secure client portals, and implementing robust security auditing—all while staying under $0 in infrastructure costs.
Introduction: Transcending the Static Resume
As developers, our portfolios are often the first point of contact for recruiters, clients, and collaborators. However, a static HTML page or simple markdown site rarely does justice to a backend developer's capability. I wanted to build something different: a production-grade web application equipped with an Admin Suite, an interactive Client Portal, an AI Assistant, and a Security Auditor.
In this post, I will break down the engineering choices behind this platform, perform a cost-benefit analysis of choosing Next.js over Java/Spring Boot, and explain how I leveraged Vercel, Supabase, and Cloudflare R2 to achieve a highly responsive system at a baseline cost of exactly $0.

Why Next.js? A Java / Spring Boot Developer's Perspective
By trade, I am a Java Backend Developer. I write robust, statically-typed backend architectures using Spring Boot, Hibernate, and relational databases. Naturally, my first instinct was to build my backend in Java and pair it with a React frontend. However, a pragmatic cost analysis led me to choose Next.js (React) with Drizzle ORM and Postgres for a full-stack, serverless deployment.
The JVM RAM Overhead vs. Serverless Scale-to-Zero
Spring Boot is phenomenal for enterprise systems, but it comes with a structural cost: memory overhead. A minimal JVM process running a Spring Boot application typically requires 256MB to 512MB of RAM at idle. To host this continuously, you must deploy it on a persistent virtual machine or container runtime (such as AWS ECS, Render, or Railway). At current hosting rates, running a persistent 512MB RAM container costs between $5 to $7 per month.
Next.js, on the other hand, compiles to serverless and edge functions. When no one is visiting the website, it consumes zero active compute resources. I host the Next.js frontend and serverless endpoints on Vercel. Vercel provides instant cold-starts, globally distributed Edge routing, and automatic deployments directly from GitHub—all within their generous $0/month free tier.
Database Hosting: Supabase PostgreSQL
Instead of hosting a dedicated database instance on AWS RDS (which would cost $15+/month), I selected Supabase to provision the PostgreSQL instance. Supabase offers a fully managed, production-grade Postgres database. By utilizing Supabase's free tier, I gain access to reliable connection pooling, regular backups, and fast query execution speeds without incurring any monthly hosting bills.
Object Storage: Cloudflare R2 and the Battle of Egress Fees
A portfolio requires file storage for assets like PDF resumes, profile pictures, and client project logos. If hosted on traditional storage like AWS S3, you are charged not only for storage but also egress fees (bandwidth charges for downloading files). If your resume gets downloaded hundreds of times by recruiters, those egress charges can pile up.
To eliminate this risk, I integrated Cloudflare R2. Cloudflare R2 is an S3-compatible object storage service that charges $0 egress fees. You can serve resumes, images, and documents millions of times without paying a single cent for data downloads. Additionally, R2 offers up to 10GB of free storage, which is more than enough for a developer's assets.
Deep Dive: The Admin Suite
The Admin Suite is the nerve center of the portfolio, enabling me to manage my professional footprint dynamically without pushing new commits.

- Profile Manager: Allows real-time editing of bios, current roles, resume URLs, and social profiles.
- Skills & Certifications: A modular dashboard to add tech skills (with Devicon class maps) and verified credentials.
- Experience & Education History: A timeline builder for adding and formatting professional engagements.
- Financial Suite: An integrated analytics panel that calculates lifetime, yearly, and monthly revenue generated from freelance projects, complete with custom date range calculation.
- GitHub Sync: A background integration that hits the GitHub API to pull repositories, track commit metrics, and sync Readmes dynamically.
- Staff Accounts: A Role-Based Access Control (RBAC) system allowing me to create view-only administrator accounts for recruiters. Recruiters can log in and view internal statistics and financial dashboards without being able to write or modify data.
The Client Portal: Interactive Project Hub
To support my freelance operations, the portfolio includes a dedicated Client Portal. When a client signs on, they receive credentials to log into their own secure dashboard.

The client portal includes several enterprise-grade features:
- Milestone Tracking & Installments: Transparency is key in contract development. The portal displays budget breakdowns, base prices, discounts, and payment installment statuses (Pending vs. Paid).
- Integrated Chat Room: A specialized chat interface allows clients to converse directly with me, centralizing requirements and updates.
- Quotation Proposals: When a new project scope is created, the client can approve or decline the quotation directly within the UI.
- OTP Profile Verification: To secure client accounts, any updates to sensitive fields (like email addresses) trigger a secure 6-digit One-Time Passcode (OTP) sent to the client's email, preventing unauthorized account takeovers.
System Audits & Security Auditor
To defend against malicious scans and analyze traffic patterns, I built a custom Request Audit Log in a separate Postgres schema (request_audit).
[IMAGE PLACEHOLDER: Security Dashboard - Geo-Location & Visitor Tracking]
The auditor logs and aggregates telemetry data, including:
- Geo-IP Mapping: Resolving visitor IP addresses to city and country coordinates.
- Session Tracing: Tracking the chronological path (visit history) a visitor takes through the site.
- Device & OS Identification: Parsing User-Agents to identify browser names, operating systems, and device types (mobile vs. desktop).
- Error Auditing: Capturing server-side runtime exceptions, complete with stack traces and request contexts, and dispatching automated email notifications when errors spike.
Guardrails: Rate Limiting & AI Token Cost Controls
One of the portfolio's core features is an AI-powered email drafter and chatbot widget (utilizing DeepSeek and Gemini models). While these integrations offer a premium user experience, they expose the server to potential token-exhaustion attacks and billing spikes.
To protect my API keys, I designed an active rate-limiting middleware mapping back to two specialized tables: ai_email_usage and ai_chat_usage.
// Pseudocode of the Token Guardrail
const checkRateLimit = async (email, ip) => {
const today = new Date().toISOString().split('T')[0];
const record = await db.select()
.from(aiChatUsage)
.where(and(eq(aiChatUsage.email, email), eq(aiChatUsage.chat_date, today)));
if (record.length > 0 && record[0].chat_count >= MAX_DAILY_CHAT_LIMIT) {
throw new Error("Daily AI token limit exceeded.");
}
// Proceed with LLM execution
};
By enforcing a strict maximum threshold of chats/emails per user per day, the site remains highly interactive for real recruiters and prospective clients while being completely shielded from automated scraping bots.
Conclusion
Building this portfolio was an exercise in pragmatic engineering. While Java and Spring Boot remain my primary choices for building high-concurrency, enterprise-grade backends, a modern serverless stack comprised of Next.js on Vercel, Supabase PostgreSQL, and Cloudflare R2 proved to be the ultimate architecture for a portfolio. It delivers sub-second latency, provides rich interactive panels, and carries an active running cost of exactly $0.