DEV Community

Vivek G Sindagi
Vivek G Sindagi

Posted on

Building and Testing My First API Project with Express, Supabase, and Keploy

I had never developed and implemented a complete backend project until recently. I had occasionally written little Express.js scripts, but nothing that required building APIs, linking them to an actual database, putting them into use, and writing tests.

"Build and host a real backend API with a live PostgreSQL database — and test it properly" was the challenge I set for myself.

Warning: I succeeded. And without writing a single test by hand, I was able to achieve 100% test coverage with the help of a tool called Keploy.

This is what I discovered.

🚧 Starting from Zero: My Stack

I wanted to build something simple but complete. So I created a Notes API — where users can create, read, update, and delete notes. Here's what I used:

  • Express.js – To build RESTful API endpoints
  • Supabase – As my PostgreSQL database in the cloud
  • Vercel – To deploy my backend serverless functions
  • Keploy – To auto-generate tests for my API

I named the project express-supabase-api, and hosted it on my subdomain:
🔗 https://express-supabase-api.vivs.live/api/notes

🤦‍♂️ The Testing Roadblock

At first, I tried writing tests manually with Jest and Supertest. It worked… sort of.

But I ran into issues:

  • How do I mock Supabase without messing up my real database?
  • How do I avoid inserting and deleting real data on every test run?
  • I kept rewriting boilerplate just to test basic routes

As a beginner, it felt like I was spending more time writing test cases than writing actual logic.

🤖 Discovering Keploy (and Getting 100% Coverage Instantly)

Here's what I did:

  1. Ran my API on vercel
  2. Installed Keploy using their one-liner installer
  3. Used my API like a normal user (created a note, updated one, deleted another)
  4. Keploy captured all the traffic
  5. Boom — it generated test cases based on those real interactions

🙌 Final Thoughts: Every Beginner Should Try This

If you’re building your first real backend project like I was — especially with Node.js and Express — I highly recommend trying Keploy.

It doesn’t replace manual testing forever, but it gives you a huge head start and teaches you the value of testing without overwhelming you with complexity.

🔗 Check out my API here: https://express-supabase-api.vivs.live/api/notes
📦 Repo: https://github.com/itsviv0/express-supabase-api

Top comments (0)