flow-debugger 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,6 +6,19 @@ Traces requests step-by-step, measures timing, classifies errors, detects root c
6
6
 
7
7
  ---
8
8
 
9
+ ![Flow Debugger Dashboard](https://raw.githubusercontent.com/sannuk79/debugerpackages/main/portfolio-repo/flowdebuger.png)
10
+
11
+ ## 🚀 Easy 3-Line Setup (Beginner Friendly)
12
+ Beginners can get a professional dashboard and request tracing with just **3 lines of code**:
13
+
14
+ ```typescript
15
+ const debug = flowDebugger({ enableDashboard: true }); // 1. Init
16
+ app.use(debug.middleware); // 2. Middleware
17
+ mongoTracer(mongoose, { getTracer: debug.getTracer }); // 3. Auto-Trace
18
+ ```
19
+
20
+ ---
21
+
9
22
  ## ✨ Features
10
23
 
11
24
  - **Request Tracing** — Every request gets a unique `traceId` with step-by-step timing
@@ -0,0 +1 @@
1
+ [image_data_placeholder]
Binary file
package/dashboard/app.js CHANGED
@@ -35,7 +35,14 @@ async function refreshData() {
35
35
  const res = await fetch(API_URL);
36
36
  if (!res.ok) throw new Error('API error');
37
37
  const data = await res.json();
38
- renderDashboard(data);
38
+
39
+ // Seed sample data if empty for a better first-look experience
40
+ if (!data.totalRequests || data.totalRequests === 0) {
41
+ const seededData = seedSampleData(data);
42
+ renderDashboard(seededData);
43
+ } else {
44
+ renderDashboard(data);
45
+ }
39
46
  } catch (err) {
40
47
  document.getElementById('statusBadge').textContent = '● OFFLINE';
41
48
  document.getElementById('statusBadge').className = 'badge badge-offline';
@@ -349,3 +356,37 @@ function formatDuration(ms) {
349
356
  const hrs = Math.floor(mins / 60);
350
357
  return hrs + 'h ' + (mins % 60) + 'm';
351
358
  }
359
+
360
+ function seedSampleData(data) {
361
+ return {
362
+ ...data,
363
+ uptime: 124000,
364
+ totalRequests: 1,
365
+ totalErrors: 0,
366
+ totalSlow: 0,
367
+ serviceHealth: [
368
+ { name: 'mongo', status: 'healthy', successRate: 100, totalChecks: 12 },
369
+ { name: 'redis', status: 'degraded', successRate: 92, totalChecks: 45 },
370
+ { name: 'postgres', status: 'healthy', successRate: 100, totalChecks: 5 }
371
+ ],
372
+ endpoints: [
373
+ { method: 'GET', path: '/api/users', totalRequests: 1, errorCount: 0, slowCount: 0, avgDuration: 42, p95Duration: 42, maxDuration: 42, commonIssues: [] }
374
+ ],
375
+ recentTraces: [
376
+ {
377
+ traceId: 'sample_trace_123',
378
+ endpoint: '/api/users',
379
+ method: 'GET',
380
+ totalDuration: 156,
381
+ classification: 'INFO',
382
+ language: 'node',
383
+ steps: [
384
+ { name: 'Auth Check', service: 'internal', status: 'success', classification: 'INFO', startTime: 2, endTime: 12, duration: 10, offset: 2 },
385
+ { name: 'DB Find User', service: 'mongo', status: 'success', classification: 'INFO', startTime: 15, endTime: 145, duration: 130, offset: 15 },
386
+ { name: 'Redis Cache', service: 'redis', status: 'success', classification: 'INFO', startTime: 148, endTime: 155, duration: 7, offset: 148 }
387
+ ]
388
+ }
389
+ ]
390
+ };
391
+ }
392
+
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flow-debugger",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "Production-safe flow-level debugging SDK. Traces requests, measures timing, classifies errors, detects root causes, and provides endpoint analytics with a live dashboard.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -64,9 +64,9 @@
64
64
  ],
65
65
  "repository": {
66
66
  "type": "git",
67
- "url": "https://github.com/sannuk79/debugerpackages.git"
67
+ "url": "https://github.com/sannuk79/PROJECTS-AND-NPM-PACKAGES-"
68
68
  },
69
- "homepage": "https://github.com/sannuk79/debugerpackages#readme",
69
+ "homepage": "https://github.com/sannuk79/PROJECTS-AND-NPM-PACKAGES-",
70
70
  "bugs": {
71
71
  "url": "https://github.com/sannuk79/debugerpackages/issues"
72
72
  },