See the code move. Then you remember it.
Watch requests travel through an Express app into MongoDB collections, and watch algorithms make decisions one block at a time.
Request → database, in 3D
The orange cube is one HTTP request. Pillars are middleware (violet), the router (grey) and handlers (cyan). Towers are MongoDB collections: one voxel per document, and the ones a query matches glow yellow. Drag to orbit, scroll to zoom.
- 1cors()
The request enters the Express app and walks the middleware chain in the order it was registered with app.use().
- 2requireAuth
requireAuth reads the Bearer token. If it were missing, the chain would stop here with a 401 and the handler would never run.
- 3usersRouter
The router matches the path and method, then calls the handler.
- 4listUsers
The handler turns the query string into a Mongo filter. User.find scans the users collection: 12 documents in the tower, 3 match and light up.
- 5User.find
The handler sends 200 with the 3 users. Always strip passwordHash before sending (select('-passwordHash')).
Algorithm playground
Pick a pattern, edit the input, and step through. Every frame says what the algorithm decided and why. Grid BFS renders as rising voxel waves you can orbit.
Grid BFS (3D voxels)
Waves of equal distance rise out of the grid: BFS explores level by level.