Skip to content

Navid's Blog

Ideas, Experiments, and Lessons Learned

Menu
Menu

How I Built a Real API in One Weekend (And What I’d Do Different)

Posted on April 10, 2026 by Navid

I decided to build a real API over a weekend. Not a tutorial. Not a toy project. Something I’d actually use in production later. Here’s what happened.

The Goal

I needed an API for a small internal tool at work. Nothing fancy — just a way to fetch, create, and update customer records. I told myself: one weekend, done.

What I Built

I went with Node.js + Express. Didn’t overthink the stack. Used SQLite for simplicity (we didn’t need scale yet). Added basic JWT auth because security isn’t optional.

The endpoints I shipped:

  • GET /customers — list all customers
  • GET /customers/:id — get one customer
  • POST /customers — create new customer
  • PUT /customers/:id — update customer
  • DELETE /customers/:id — delete customer

What Went Right

The basic CRUD was fast. Express makes it easy. I had a working API by Saturday afternoon. The auth took another couple hours. By Sunday morning, I was testing with Postman and feeling good.

What I’d Do Different

1. Start with validation from day one

I skipped input validation initially. Big mistake. Later I had to go back and add Joi/validation middleware. Should have done it first.

2. Set up logging earlier

I added console.log statements everywhere. Messy. Next time: proper logger (Winston or Pino) from the start.

3. Write tests as I built

I wrote zero tests over the weekend. Then spent an extra day writing them retroactively. Writing tests alongside each endpoint would have saved time.

4. Use an ORM from the start

Raw SQL works, but Prisma or Knex would have made migrations and schema changes less painful.

Lessons

You can ship a working API in a weekend. But “working” isn’t the same as “done.” The real work starts after — testing, documentation, error handling, monitoring.

If I had to do it again, I’d still aim for a weekend MVP. But I’d spend the first hour setting up the testing framework and validation library instead of jumping straight into routes.

Fast shipping beats perfect planning. But perfect planning makes fast shipping sustainable.

Categories

  • AI Experiments
  • Coding
  • Debugging Stories
  • Hot Takes
  • Ideas
  • Lessons Learned
  • Project Management
  • Uncategorized
  • Vibe Coding

Recent Posts

  • I Spent 3 Hours Debugging — It Was a Typo
  • I Spent 3 Hours on a Bug That Was a One-Line Fix
  • The Time I Accidentally Deleted Our Production Database
  • I Accidentally Deleted Production Data at 2 AM — Here’s What Saved Me
  • How I Found the Memory Leak That Was Killing Our Production Server