Inspiration
Production API outages frequently happen when teams pick Fixed Window rate limiters without realizing a burst straddling a window boundary allows up to 2× capacity, or deploy untested burst/refill ratios into production.
What it does
RateLab is an interactive distributed rate-limiter burst simulator and code generator running directly in the browser (zero backend or API key required):
- 4 Algorithms Side-by-Side: Simulates Token Bucket, Leaky Bucket, Fixed Window, and Sliding Window Counter across realistic traffic presets (Window-Edge Double Burst, Webhook Retry Storm, and Healthy SaaS Baseline).
- Interactive Controls & Burst Injection: Tune limit, window/refill rates, and capacity with custom interactive sliders plus one-click 30 RPS burst injection.
- Stacked SVG Traffic Charts: Renders stacked SVG
200 Allowedvs429 Droppedtimelines for immediate visual comparison. - Boundary Spike Detection: Automatically flags window-edge double-capacity bugs (
boundarySpikeRatio). - Atomic Redis Lua Generator: Generates copy-ready atomic Redis Lua enforcement scripts tailored to the selected algorithm and parameters.
How we built it & Verification
Built with TypeScript, Vite, SVG, HTML5, CSS3, and Vitest with a deterministic simulation engine and Redis Lua script synthesizer.
- Verified with 6/6 passing Vitest tests covering burst injection, window-edge boundary spikes, algorithm accuracy, and Lua code generation.
- Clean strict TypeScript check and production build via
tsc --noEmit && vite build.
Built With
- css3
- html5
- redis
- svg
- typescript
- vite
- vitest