flux-manager
v1.0.7
Published
A comprehensive Node.js application management and debugging platform for the Flux.js ecosystem
Maintainers
Readme
🚀 Flux Manager
A powerful, framework-agnostic Node.js debugging tool for real-time HTTP request monitoring
Flux Manager is a comprehensive Node.js application monitoring and debugging platform. It provides real-time HTTP request tracking, supporting any Node.js HTTP framework including Express, Koa, Fastify, and native HTTP servers.
📦 Installation
npm install flux-manager🚀 Quick Start
✨ Ultra-Simple Integration (One Line!)
import express from 'express';
import FluxManager from 'flux-manager';
const app = express();
// 🎯 ONE LINE SETUP - Auto-detects framework and integrates!
const fluxManager = FluxManager.attach(app, {
route: '/flux-manager',
port: 3000,
maxRequests: 1000
});
// Your application runs on port 3000
app.listen(3000, () => {
console.log('✅ Your app: http://localhost:3000');
console.log('🔍 FluxManager dashboard: http://localhost:3000/flux-manager');
});
Koa.js Integration
import Koa from 'koa';
import FluxManager from 'flux-manager';
const app = new Koa();
// Auto-attach to Koa
const fluxManager = FluxManager.attach(app, { route: '/flux-manager' });
app.listen(3000);Fastify Integration
import Fastify from 'fastify';
import FluxManager from 'flux-manager';
const fastify = Fastify();
// Auto-attach to Fastify
const fluxManager = FluxManager.attach(fastify, { route: '/flux-manager' });
fastify.listen({ port: 3000 });Native HTTP Server
import http from 'http';
import FluxManager from 'flux-manager';
const server = http.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Hello World!');
});
// Auto-attach to HTTP server
const fluxManager = FluxManager.attach(server, { route: '/flux-manager' });
server.listen(3000);📍 Access Points:
| Service | URL | Purpose |
|---------|-----|----------|
| Your Application | http://localhost:3000 | Your main app, API endpoints, web pages |
| FluxManager Dashboard | http://localhost:3000/flux-manager | Monitoring dashboard, request inspection |
| WebSocket Connection | ws://localhost:3000/flux-manager/ws | Real-time updates for dashboard |
⚙️ Port Configuration Options:
// Option 1: Same port (Recommended - Simple Setup)
const fluxManager = FluxManager.attach(app, {
port: 3000, // FluxManager uses same port as your app
route: '/flux-manager'
});
app.listen(3000);
// Access: http://localhost:3000/flux-manager
// Option 2: Separate ports (Advanced - Better Isolation)
const fluxManager = FluxManager.attach(app, {
port: 3001, // FluxManager runs on separate port
route: '/flux-manager'
});
app.listen(3000); // Your app runs on port 3000
// Access: http://localhost:3001/flux-manager
// Option 3: Standalone mode
const fluxManager = FluxManager.attach(null, {
port: 3001, // FluxManager runs independently
route: '/flux-manager'
});
// Access: http://localhost:3001/flux-manager⚙️ Configuration Options
const fluxManager = new FluxManager({
// Dashboard route (default: '/flux-manager')
route: '/debug',
// server port (default: 3001)
port: 3001,
// Maximum stored requests (default: 1000)
maxRequests: 500,
// Enable/disable WebSocket (default: true)
enableWebSocket: true,
// Auto-start servers (default: true)
autoStart: true
});🛡️ Security Considerations
Production Deployment
⚠️ Important: Flux Manager captures complete request/response data including headers and bodies. Consider these security implications:
- Sensitive Data: Request/response bodies may contain sensitive information
- Authentication: No built-in authentication - secure the debugger route
- Memory Usage: In-memory storage grows with request volume
- Network Exposure: WebSocket connections should be secured
🚀 Performance Optimization
Memory Management
- Circular Buffer: Automatically removes old requests when limit is reached
- Configurable Limits: Adjust
maxRequestsbased on available memory - Efficient Filtering: In-memory filtering with minimal overhead
Network Optimization
- Pagination: API responses are paginated to reduce payload size
- WebSocket Compression: Automatic compression for real-time updates
- Static Asset Caching: Frontend assets served with appropriate cache headers
Monitoring Recommendations
// Monitor memory usage
setInterval(() => {
const memUsage = process.memoryUsage();
console.log('Memory usage:', {
rss: Math.round(memUsage.rss / 1024 / 1024) + 'MB',
heapUsed: Math.round(memUsage.heapUsed / 1024 / 1024) + 'MB'
});
}, 30000);🤝 Contributing
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
Development Setup
# Clone the repository
git clone https://github.com/thejesbin/flux-manager.git
cd flux-manager
# Install dependencies
npm install📝 License
MIT License - see LICENSE file for details.
Made with 💜 by the Flux Manager Team
For questions, issues, or feature requests, please visit our GitHub repository.
