Opus Motion ★ Star on GitHub

Data · api-request-flow

API request flow

A request / response round trip: client, server and database nodes in a row; labelled request packets travel between them, responses come back in a second colour, each arrival pulses the node and pops an HTTP status badge, and a call log fills in underneath.

A free, MIT-licensed animated chart from the Opus Motion Library — 616 motions for Remotion, React and plain HTML.

API request flow: three frames of the animated chart, start, middle and end
API request flow — start, middle and end of the 8.0-second motion.

What API request flow is for

Explaining how an API call works, backend architecture, REST / HTTP basics, error-handling stories (a 500 shakes the node), latency and developer-docs videos.

  • api
  • request
  • response
  • http
  • rest
  • server
  • client
  • database
  • backend
  • architecture
  • developer
  • status code
  • network
  • software
  • diagram

Details

Category
Animated charts & data visualisation
Length
8.0 s (240 frames at 30 fps)
Formats
16:9, 1:1, 9:16
Weight
light
Transparent overlay
yes
Seamless loop
no
Text props
title
Colour props
background panel ink accent accent2 okColor errColor
Mood
hud
Roles
subject

Use API request flow in Remotion, React or HTML

Remotion project

terminal
# copy this motion into your Remotion project
node cli/mgl.mjs add api-request-flow --to ../my-app/src

# render an mp4 (run in the library folder)
node cli/mgl.mjs render api-request-flow --props '{"title":"What happens on a request","background":"#0C0F16","panel":"#151A25","ink":"#EAEFF8","accent":"#4C8DFF","accent2":"#F5A524","okColor":"#2EC4A6","errColor":"#FF5C5C"}'

# or export for apps / editors: mp4 | webm-alpha | prores-alpha | gif | png | poster
node cli/mgl.mjs export api-request-flow --as webm-alpha --props '{"title":"What happens on a request","background":"#0C0F16","panel":"#151A25","ink":"#EAEFF8","accent":"#4C8DFF","accent2":"#F5A524","okColor":"#2EC4A6","errColor":"#FF5C5C"}'

React / Next.js

tsx
import {MotionPlayer} from 'opus-motion-library/web';

<MotionPlayer
  motion="api-request-flow"
  props={{
    title: 'What happens on a request',
    background: '#0C0F16',
    panel: '#151A25',
    ink: '#EAEFF8',
    accent: '#4C8DFF',
    accent2: '#F5A524',
    okColor: '#2EC4A6',
    errColor: '#FF5C5C',
  }}
  playOnView
  loop="auto"
/>

Plain HTML / WordPress

html
<script src="opus-motion.element.js" defer></script>

<opus-motion motion="api-request-flow"
  props='{"title":"What happens on a request","background":"#0C0F16","panel":"#151A25","ink":"#EAEFF8","accent":"#4C8DFF","accent2":"#F5A524","okColor":"#2EC4A6","errColor":"#FF5C5C"}'>
</opus-motion>

Compose spec (multi-scene video)

json
{
  "width": 1920,
  "height": 1080,
  "fps": 30,
  "scenes": [
    {
      "motion": "api-request-flow",
      "props": {
        "title": "What happens on a request",
        "background": "#0C0F16",
        "panel": "#151A25",
        "ink": "#EAEFF8",
        "accent": "#4C8DFF",
        "accent2": "#F5A524",
        "okColor": "#2EC4A6",
        "errColor": "#FF5C5C"
      }
    }
  ]
}

API request flow props

15 parameters — change any of them to make the motion yours.

PropDefaultWhat it does
nodes[{"label":"Client","kind":"client","sub":"web app"},{"label":"API server","kind":"serve…boxes in order [{label, kind?: 'client' | 'server' | 'database' | 'cache' | 'queue' | 'service', sub?}] (2–5)
steps[{"from":0,"to":1,"label":"POST /orders"},{"from":1,"to":2,"label":"INSERT order"},{"fr…packets in order [{from, to (node indexes), label, status? (HTTP code, 4xx/5xx = red + shake), statusText?, ms?, type? ('request' | 'response'; default: response when going back toward node 0)}]
title"What happens on a request"heading (empty = none)
showLogtrueshow the call log under the diagram
stepFrames42frames per packet
speed1timing multiplier
startAt0frame the flow starts
background"#0C0F16"page colour or 'transparent'
panel"#151A25"node / card colour
ink"#EAEFF8"text colour
accent"#4C8DFF"request colour
accent2"#F5A524"response colour
okColor"#2EC4A6"2xx badge colour
errColor"#FF5C5C"5xx badge / error colour
fontFamily""monospace font override (empty = JetBrains Mono)

Notes & credits

Technique sources:

  • original (generic developer explainer)