A real-time 2D network traffic visualization tool similar to Cisco Packet Tracer, but for actual network traffic.
This project is made in large part using OpenCode (and the Oh-My-Opencode plugin), which is an AI tool. You have been warned!
- Real-time packet capture using tcpdump/libpcap
- 2D network topology visualization
- Cisco Packet Tracer-style interface
- Cross-platform compatibility (works with any tcpdump source)
- Protocol-based traffic color coding
- Interactive device inspection
- Backend: Node.js with packet capture and WebSocket streaming, CORS support
- Frontend: HTML5/TypeScript with Canvas rendering, API proxy for development
- Node.js 18+
- libpcap (included with most Linux distributions)
- Root/sudo access for packet capture
# Install all dependencies
npm run install:all
# Or install individually
npm install
cd backend && npm install
cd ../frontend && npm installOption 1: Run both backend and frontend simultaneously
npm run devOption 2: Run separately
Terminal 1 - Backend:
cd backend
npm run devTerminal 2 - Frontend:
cd frontend
npm run devOption 3: Use test script
chmod +x test-app.sh
./test-app.sh- Open the web interface (usually http://localhost:5173)
- Select a network interface to monitor
- Start capturing traffic (requires root/sudo for backend)
- View real-time network visualization
Note: Packet capture requires elevated privileges. Run backend with:
sudo npm run devOr set capabilities for tcpdump:
sudo setcap cap_net_raw,cap_net_admin=eip $(which tcpdump)# Backend
cd backend
npm run dev # Development mode
npm run build # Build for production
# Frontend
cd frontend
npm run dev # Development mode
npm run build # Build for production
npm run preview # Preview production build- Docker 20.10+
- Docker Compose v2.0+
- Host system needs libpcap capabilities for packet capture
# Build and start all services
docker-compose up --build -d
# Access the application
open http://localhost
# Stop services
docker-compose downUncomment line 19 in docker-compose.yml:
privileged: true # Uncomment for packet capture in productiondocker-compose -f docker-compose.dev.yml up --build -ddocker-compose up --build -d --privileged- Frontend: Available at http://localhost (Nginx on port 80)
- Backend: Available at http://localhost:3001 (Node.js API)
- WebSocket: ws://localhost:3001/ws (real-time packet data)
# Build individual services
docker-compose build backend
docker-compose build frontend
# Run specific service
docker-compose up backend
docker-compose up frontend
# View logs
docker-compose logs -f backend
docker-compose logs -f frontend- Packet capture requires
NET_RAWandNET_ADMINcapabilities or privileged mode - Backend runs as non-root user but still needs capabilities
- Frontend uses Nginx with security headers and gzip compression
- Health checks configured for both services
- See
DOCKER.mdfor detailed deployment guide
# Check container status
docker-compose ps
# View real-time logs
docker-compose logs -f
# Restart services
docker-compose restart
# Clean up containers and images
docker-compose down -v --rmi all📖 See DOCKER.md for comprehensive Docker deployment guide.
Multiple testing resources are provided:
./test-app.shQuick health check that verifies:
- Backend API accessible on port 3001
- Frontend running on port 5173
- HTML content loading correctly
chmod +x comprehensive-test.sh
./comprehensive-test.shAutomated test suite with 20+ tests covering:
- API endpoints (GET, POST, status)
- Frontend proxy functionality
- CORS headers verification
- Multiple start/stop cycles
- Error handling
- Concurrent requests
See TESTING_GUIDE.md for:
- Manual testing procedures
- API endpoint tests
- Browser test steps
- Troubleshooting checklist
- Success criteria
See these documentation files for detailed bug fixes and resolutions:
CORS_FIX.md- CORS network error fixBUG_FIXES.md- Complete bug logSTOP_CAPTURE_FIX.md- Stop capture issue fix
# 1. Start both servers
cd backend && npm run dev &
cd frontend && npm run dev &
# 2. Open browser
# Navigate to: http://localhost:5173
# 3. Test functionality
# - Select interface
# - Start capture
# - Generate traffic (ping, curl)
# - Verify visualization
# - Stop capture