A real-time 3D visualisation of network traffic using Three.js and Flask framework. The application displays network packets traveling across a globe.
- Clone the repository:
git clone https://github.com/lolyhop/traffic-visualisation.git
cd traffic-visualisation- Build and start all services:
docker-compose up --build-
Access the application:
- Frontend: http://localhost
- Server API: http://localhost:1337
- Sender API: http://localhost:1338
-
Click "Start Sending Packets" to begin the visualization
The Three.js visualization may occasionally experience delays. If packets don't appear immediately after clicking "Start Sending Packets", please wait a few moments. The system will continue to process data in the background and visualization should resume shortly.
The project consists of three main components:
-
Frontend(Port 80)
- Three.js for 3D visualisation
- Chart.js for performance graphs
-
Server (Port 1337)
- Handles packet data collection
- Provides data to the frontend
-
Sender (Port 1338)
- Simulates network traffic
- Sends packet data to the server
To modify the visualisation:
-
Frontend files:
js/visualisation.js- 3D visualisation logicjs/chart-setup.js- Performance graphsjs/data-handling.js- Data processingstyles/main.css- Styling
-
Backend files:
server.py- Main server implementationsender.py- Traffic simulationsettings.py- Configuration
-
If services fail to start:
docker-compose down docker-compose up --build
-
Connection issues:
- Check if ports 1337 and 1338 are available
- Verify Docker network is created
- Check service logs:
docker-compose logs
