Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Firewall strategy Remotion

Remotion compositions that animate the three rate limit strategies in Appwrite Firewall: fixed window, sliding window, and token bucket. Each composition mirrors the strategy illustrations from the Appwrite Console, using the same geometry, colors, and Inter typeface, and renders in a dark and a light variant.

The GIFs produced by this project are used in the Appwrite blog post on choosing a rate limit strategy.

Compositions

ID What it shows
fixed-window-dark / fixed-window-light Requests filling a clock-aligned window, one request going over the limit, and the counter resetting for everyone at the boundary
sliding-window-dark / sliding-window-light A window anchored to the first request that slides forward with time while older requests age out of the count
token-bucket-dark / token-bucket-light Tokens refilling at a steady rate, each request spending one token, and a burst draining accumulated tokens

All compositions render at 1460x822, 30 fps.

Usage

pnpm install

# preview in Remotion Studio
pnpm exec remotion studio src/index.ts

# render a GIF (15 fps output)
pnpm exec remotion render src/index.ts fixed-window-dark out/fixed-window-dark.gif --codec=gif --every-nth-frame=2

Render all six:

for id in fixed-window-dark fixed-window-light sliding-window-dark sliding-window-light token-bucket-dark token-bucket-light; do
  pnpm exec remotion render src/index.ts "$id" "out/$id.gif" --codec=gif --every-nth-frame=2
done

Structure

  • src/theme.ts holds the light and dark color tokens and the shared accent colors (#10b981 for passed requests, #f59e0b for rate limit tokens).
  • src/shared.tsx has the shared SVG building blocks: frame wrapper, request dots, window bands, and labels.
  • src/FixedWindow.tsx, src/SlidingWindow.tsx, src/TokenBucket.tsx are the three animated diagrams.
  • public/fonts/ bundles the Inter woff2 files loaded at render time.

About

Remotion compositions animating Appwrite Firewall rate limit strategies (fixed window, sliding window, token bucket)

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages