DEV Community

Suryansh Soni
Suryansh Soni

Posted on

πŸš€ SuriLens: An Open-Source Real-Time Backend Execution Visualizer for Node.js

Backend debugging often relies on scattered console.log() statements, browser network tabs, and server logs. As applications grow, understanding how a request moves through middleware, controllers, services, databases, and external APIs becomes increasingly difficult.

To solve this problem, I built SuriLensβ€”an open-source real-time backend execution visualizer and observability toolkit for Node.js.

It helps developers understand exactly what happens inside their backend while requests are being processed.

✨ Why I Built SuriLens

While building production-grade Node.js applications, I often found myself asking questions like:

Which middleware executed first?
Where is this request spending most of its time?
Which controller handled the request?
Which database query was executed?
Which external APIs were called?
Which payload changed between different stages?
Why is this request slow?

Finding these answers usually meant adding temporary logs, restarting the server, and repeating the same process.

I wanted a tool that could visualize everything automatically.

That's how SuriLens was created.

πŸ” What is SuriLens?

SuriLens is a lightweight runtime observability package that automatically instruments your Node.js application and displays the complete execution flow inside an interactive dashboard.

Instead of reading logs, you can literally watch requests travel through your backend.

πŸš€ Features
⚑ Real-time request visualization
πŸ“Š Live execution graph
πŸ”„ Automatic request tracing
🧩 Dynamic node generation
πŸ“¦ Payload inspection
πŸ” Payload diff viewer
🎬 Execution replay
πŸ“ˆ Timeline visualization
πŸ“‘ WebSocket-powered live updates
πŸ”Œ Express support
πŸ”Œ Fastify support
πŸ”Œ Koa support
πŸ”Œ NestJS support
πŸ”Œ Hono support
🧠 Plugin SDK
πŸ” Sensitive data masking
πŸ“€ Session export/import
πŸ“Š Performance metrics
🚨 Slow request detection
🚨 Slow step detection
πŸš€ W3C Distributed Tracing support
πŸ“Έ How It Works

Every incoming request is automatically traced.

Instead of manually adding logs:

Client
β”‚
β–Ό
Express
β”‚
β–Ό
Middleware
β”‚
β–Ό
Controller
β”‚
β–Ό
Service
β”‚
β–Ό
Database
β”‚
β–Ό
External API
β”‚
β–Ό
Response

SuriLens visualizes this flow in real time with animated execution packets, timing information, payload transformations, and performance metrics.

πŸ’» Installation
npm install surilens
πŸš€ Quick Start
import express from "express";
import suriLens from "surilens";

const app = express();

app.use(suriLens());

app.get("/", (req, res) => {
res.json({
message: "Hello World"
});
});

app.listen(3000);

Open:

http://localhost:4444

and start watching your backend execute in real time.

πŸ–₯ Dashboard Includes
Live execution graph
Timeline
Payload inspector
Request details
Response details
Performance metrics
Search
Filters
Replay engine
Dynamic execution nodes
πŸ›  Supported Frameworks
Express
Fastify
NestJS
Koa
Hono
πŸ”’ Security

SuriLens automatically masks sensitive information such as:

Passwords
Authorization headers
Tokens
Cookies
API keys
Secrets

before broadcasting trace data.

⚑ Performance

Designed to be lightweight for development and observability.

Highlights include:

AsyncLocalStorage-based tracing
Automatic instrumentation
WebSocket streaming
Minimal runtime overhead
Dynamic execution graph
Live packet animations
🌍 Open Source

SuriLens is completely open source.

Contributions, issues, feature requests, and feedback are always welcome.

πŸ”— Links

GitHub

https://github.com/sonisuryansh/surilens

npm

https://www.npmjs.com/package/surilens

πŸ’™ Feedback Welcome

This is the first public release of SuriLens, and I'd love feedback from the developer community.

If you try it in your project, let me know:

What you liked
What could be improved
Which framework you'd like supported next
Features you'd like to see in future releases

Happy coding! πŸš€

Top comments (0)