Building a Custom Backend for My Portfolio
I wanted my portfolio to be more than a static showcase. I wanted a system I could update, extend, and control properly without redeploying my frontend every time I added a new project, blog post, or freelance entry.
So instead of reaching for a headless CMS or keeping everything in static files, I built a custom backend from scratch.
Tech Stack
- Java
- Spring Boot
- PostgreSQL
- Spring Security
- JWT authentication
Why Build It Myself?
A headless CMS would have been faster, and static files would have been simpler. But the goal of this project was not just convenience. I wanted to understand the fundamentals behind a real content management system.
Building the backend myself gave me full control over:
- How my data is structured
- How content is created and updated
- How the API is designed
- How authentication and admin access work
- How the frontend consumes portfolio data
It also gave me a better opportunity to practise backend engineering in a realistic, personal project.
Architecture
The backend is built with Spring Boot, which made it easier to structure the application around clear layers: controllers, services, repositories, and database models.
Different content types, such as projects, blog posts, and freelance entries, are handled through dedicated API endpoints and database entities. This keeps the system organised while still making it easy to expand later.
PostgreSQL stores the content persistently, while my static Next.js frontend can fetch the latest data through the API without needing a manual redeploy.
Securing the Admin Side
Because this backend controls the content on my portfolio, security was a key part of the project.
Public endpoints can be used by the frontend to display content, but admin endpoints need protection. I used Spring Security with JWT authentication so that only authenticated requests can create, edit, or delete content.
JWTs helped me keep the API stateless while still making sure admin actions are properly restricted.
Lessons Learned
One of the biggest challenges was configuring Spring Security correctly. Getting authentication, protected routes, and JWT validation working together took some careful debugging.
I also learned a lot from designing the initial database schema. Thinking through how projects, posts, and freelance entries should be represented forced me to treat the portfolio like a real application rather than just a personal website.
Final Thoughts
This project changed how I think about full-stack development. A frontend can look polished, but the backend is what makes it flexible, secure, and maintainable.
Building my own portfolio backend helped me understand the full path from database design to API responses to frontend rendering. It was a practical way to strengthen my backend skills while improving the site I actually use to present my work.
You can view the project on GitHub here: personal-site-backend.