Skip to content
Case study · Developer SaaSLive

Status
Live
Built with
Go, React, Redis
LimitYourAPI: API rate limiting SaaS, built end to end.
Limit strategies
4 Lua scripts
Token bucket, sliding window, quota, AI token cost
CI checks
5 jobs
Go, frontend, edge, Terraform, SDK
SDKs
Node.js, Go, Python
Plus a Cloudflare Workers limiter

Overview

LimitYourAPI is an API rate limiting and usage metering SaaS. Developers add it to their API with an SDK or a REST call, then manage keys, limits and usage in a dashboard.

I built it end to end: the Go API and Redis Lua limiters, the React dashboard, SDKs for Node.js, Go and Python, a Cloudflare Workers edge limiter, the CI pipeline, and a Terraform setup for AWS that is not deployed yet (the API runs on Render).

Problem

Most API rate limiting implementations either become inconsistent under concurrency or depend heavily on infrastructure-specific edge products.

A lot of existing tooling lacks application-level context, flexible quota control, or developer-friendly integration flows.

The goal was a product with predictable behavior under load, low operational overhead, and a clean SDK and dashboard experience.

Constraints

The main engineering constraint was keeping every limit exact under concurrent load without adding a coordination layer.

Usage logging could not slow the request path, so request logs are batched in memory and written to PostgreSQL in the background.

As a one-person product, it also had to be cheap to run and safe to change often, which is why every push runs the full CI.

Architecture

The API is written in Go (Gin). Each limiting strategy (token bucket, sliding window, quota and AI spend) is one Lua script that Redis runs atomically, so concurrent requests cannot overshoot a limit.

PostgreSQL stores accounts, API keys and usage history. Request logs are batched and flushed in the background, and a Prometheus-format metrics endpoint reports the service's health.

The dashboard is React with Vite, React Router and Chart.js. Auth uses JWTs with TOTP two-factor. Stripe and Razorpay billing code exists, but paid plan upgrades are not wired up yet.

SDKs for Node.js (published on npm), Go and Python wrap the API and fail open by default; the Node.js and Python SDKs also retry. A Cloudflare Workers limiter runs checks at the edge.

GitHub Actions runs on every pull request and every push to main: the Go build, vet and tests with the race detector, the frontend build, a syntax check of the edge workers, Terraform validation and an SDK package check. The API runs on Render as a Docker image and the dashboard on Vercel. The repository also holds a Terraform setup for AWS (ECS Fargate, RDS, ElastiCache and autoscaling) and a manual deploy workflow for it that signs in to AWS with OIDC instead of stored keys. Neither has been run yet.

Request path

  1. Your API

    Node.js, Go or Python SDK, or a REST call

  2. Go API

    Stateless; scales out

  3. Redis

    One Lua script per strategy, run atomically

Usage, off the hot path

  1. Request logs

    Batched in memory

  2. PostgreSQL

    Usage and quota history

  3. Dashboard

    React and Chart.js

Delivery

  1. GitHub Actions

    Go tests, frontend build, Terraform validate

  2. Render and Vercel

    API as a Docker image; dashboard

  3. Terraform for AWS

    ECS, RDS, ElastiCache; written, not deployed yet

Every allow or deny is one atomic Lua script in Redis; usage is logged in batches, off the request path.

Tradeoffs

The system puts exact, application-level quotas ahead of network-level protection.

Stateless API instances made scaling simple but put all coordination on Redis, which is why every limit is a single atomic script.

When Redis cannot answer, each rule either fails open or fails closed. Failing open is the default, because refusing every request while the limiter is down is usually worse than letting traffic through for a while.

What I'd do differently

Shipping a whole product alone taught me as much about the parts around the core as the core itself: the dashboard, SDK ergonomics, billing edge cases, and a deploy pipeline I can trust.

It also reinforced how much developer trust depends on documentation quality and stable behavior under failure conditions.

GoReactRedisPostgreSQLDockerTerraformGitHub Actions

Building something similar?

We can walk you through how this was built on a free call.

Free consultation

Have a project in mind?

Tell us what you're building. We'll suggest the simplest way to ship it, and tell you honestly if we're not the right fit.

Email us
  1. 1

    Tell us about the project

    A few quick questions in the chat, or an email.

  2. 2

    Reply within 24–48 hours

    With questions, a rough scope and a starting price.

  3. 3

    Free call, then a written quote

    No commitment until you're happy with it.