I built my portfolio as an API
Most developer portfolios are the same page. Big name, a photo, a row of skill bars, a “Let’s connect” button. I’ve built that page before. It was fine. Nobody remembers it, including me.
So this time I did something that fits my brain better. The whole site is an API, and every section is an endpoint.
GET /waqas is the intro. GET /projects is the open-source stuff. GET /posts is this blog, GET /history is where I’ve worked, and POST /contact is how you reach me. The address bar at the top even says GET waqasahmaddev.com/api/waqas and changes as you scroll.
It’s not just a costume
The JSON is real. Open a terminal and try it:
curl https://waqasahmaddev.com/api/waqasYou get my name, my role and a couple of links, as JSON. /api/projects and /api/history work the same way. The Send button in the address bar opens that JSON for whichever section you’re looking at.
One honest confession: POST /contact isn’t a real POST. It opens your mail app. I’m keeping the joke anyway.
What’s underneath
Boring on purpose. It’s an Astro site that builds to plain HTML, with hand-written CSS. The only JavaScript on the page is a few small helpers: the theme toggle, copy buttons and the blog filter. It uses system fonts, so there are no font files to download.
Everything personal lives in one TypeScript file. The homepage and the JSON endpoints both read from it, so they can’t disagree with each other. If I change my job title, I change one string and the page and the API both follow.
Three things that bit me
My laptop was too old for my own site. Astro 7 wants Node 22.22 or newer and I had Node 20. The build just refused. I added a .node-version file so every build uses Node 22 and nobody has to guess.
I advertised a URL that didn’t exist. The design showed curl waqasahmaddev.com/api/waqas. The file Astro built is called waqas.json. So the very first command a curious visitor would try returned a 404, on a page about APIs. Embarrassing. The fix is one line in a _redirects file, which rewrites /api/waqas to the JSON file without changing the URL. Both addresses work now. The lesson is dull but real: run the exact command you put on your own homepage.
The Send button did nothing. It was pure decoration, a green rectangle with a label. People click green rectangles. Now it opens the JSON.
Is it a gimmick?
A little. But it does one useful thing: it tells a developer what I do before I say a word, and it loads fast because there’s almost no JavaScript. It would be a bad idea if I wanted a photo gallery, or if the people reading it didn’t know what an endpoint was.
I’d do it again. The next thing I’d add is a real POST /contact, but that means a backend, spam, and an inbox I have to defend. For now an email link does the job.