Skip to content

~ $ cat work/thinkboard.md

ThinkBoard

A notes app with a rate-limited Express API.

Full-stack · March – April 2026Built on my own.

OUTCOME
Refuses extra requests after 50 a minute, so it cannot be overloaded
SCOPE
Solo project
DECISION
Use a sliding-window limiter, then question the shared key when fairness broke down.
EVIDENCE
Interactive reproduction on this site plus the exact middleware source.

Built with

  • React
  • Node.js
  • Express
  • MongoDB
  • Redis

What it is

ThinkBoard is a simple notes app. You can write a note, edit it, and delete it, in a calm dark design with nothing in the way.

I built every part myself so I could follow one action all the way from a button click to the database and back. It also protects itself by limiting how fast anyone can use it.

What it can do

  • Write, edit, and delete notes

    Every action updates the page straight away, with no waiting for a reload.

  • No empty notes

    A note needs both a title and some content. The form and the database both check this.

  • Pop-up messages

    Small messages tell you when a note was saved, changed, or deleted, and when something went wrong.

  • A slow-down screen

    If too many requests come in at once, the app shows a friendly screen asking you to wait, instead of a confusing error.

  • A dark theme

    A minimal dark design that keeps the focus on your notes.

How a request flows

  1. React + TailwindAxios client, toasts
  2. Rate limiterUpstash Redis, sliding window
  3. Express routes/api/notes CRUD
  4. MongoDBMongoose schema, timestamps

Can you lock out another visitor?

This is the same sliding-window rule ThinkBoard runs in Redis, scaled to 10 requests per 10 seconds. Start with the shared key, burst your requests, then ask another visitor to send one.

Rate-limit key
Key "my-rate-limit" (everyone)0 / 10 used

Waiting for the first request

  1. Responses appear here.

How it works

  1. 01

    You press a button on the page, such as Save.

  2. 02

    The page sends your request to the server.

  3. 03

    The server first asks a counting service whether there have been too many requests in the last minute. The limit is 50.

  4. 04

    If there have been too many, the server says no and the page shows the slow-down screen.

  5. 05

    If not, the server saves the change to the database.

  6. 06

    The page updates and a small message confirms what happened.

Screenshots

Notes dashboard
Create a note
Validation feedback
Successful save

Why

I wanted a small app where I owned every layer, so I could follow a single request from a button click to the database and back.

What I built

  1. 01

    Built the React interface and Express API for full create, read, update, and delete on notes.

  2. 02

    Added Upstash Redis sliding-window rate limiting as Express middleware: 50 requests per 60 seconds, then HTTP 429.

  3. 03

    Handled 429 in the interface with a dedicated rate-limited screen instead of a generic error.

  4. 04

    Required title and content in both the form and the Mongoose schema, and added toast messages so every create, edit, and delete reports its result.

The code

backend/src/middleware/rateLimiter.js
// config/upstash.js: 50 requests per 60 seconds, sliding window
const rateLimit = new Ratelimit({
  redis: Redis.fromEnv(),
  limiter: Ratelimit.slidingWindow(50, "60 s"),
});

// middleware/rateLimiter.js
const ratelimiter = async (req, res, next) => {
  try {
    const { success } = await ratelimit.limit("my-rate-limit");
    if (!success) {
      return res.status(429).json({
        message: "Too many requests, please try again later",
      });
    }
    next();
  } catch (error) {
    next(error);
  }
};
Every request goes through this check first. It counts requests and turns away any beyond 50 per minute. It counts everyone together, which is the trade-off described below.

Outcome

A working notes app where every action gives clear feedback, and the API protects itself (and the Upstash free tier) from bursts of requests.

The trade-off

The limiter uses one fixed key, so all visitors share a single 50-request budget. That kept the code to a few lines and protects the free-tier quota, but one busy client can lock everyone out. Keying by IP address or user would isolate them, at the cost of more Redis keys.

What I learned

A rate limiter is only as fair as its key. Choosing what to count matters as much as the limit itself.

What I'd fix next

Key the limiter by IP, and return 400 with the field name when Mongoose validation fails. Right now a missing title falls through to a generic 500.