A comprehensive network visualization and management tool built with Django (backend) and React (frontend). This application allows you to create, manage, and visualize network devices and their connections in an interactive web interface.
- Device Management: Add, edit, and manage network devices (computers, servers, routers, switches, printers, mobile devices, IoT devices)
- Connection Visualization: Create and visualize connections between devices with different types (LAN, WiFi, Bluetooth, USB, Serial)
- Interactive Network Map: Visualize your network topology using React Flow
- Device Details: View detailed information about each device including IP addresses, MAC addresses, and device photos
- Configuration Files: Upload and manage configuration files for devices
- Computer
- Server
- Router
- Switch
- Printer
- Mobile Device
- IoT Device
- Other
- LAN
- WiFi
- Django 4.2.7 - Web framework
- Django REST Framework 3.14.0 - API framework
- Django CORS Headers 4.3.0 - Cross-origin resource sharing
- Pillow 10.1.0 - Image processing
- psycopg2-binary 2.9.9 - PostgreSQL adapter
- python-dotenv 1.0.0 - Environment variable management
- React 18.2.0 - UI library
- React Router DOM 6.20.0 - Client-side routing
- React Flow Renderer 10.3.17 - Network visualization
- Axios 1.6.2 - HTTP client
- React Scripts 5.0.1 - Build tools
Before running this application, make sure you have the following installed:
- Python 3.8+
- Node.js 14+
- npm (comes with Node.js)
- PostgreSQL (optional, SQLite is used by default)
-
Clone the repository
git clone <repository-url> cd network-visualizer
-
Make the run script executable
chmod +x run.sh
-
Run the application
./run.sh
The script will automatically:
- Check for required dependencies
- Set up Python virtual environment
- Install backend dependencies
- Apply database migrations
- Install frontend dependencies
- Start both Django and React servers
-
Navigate to backend directory
cd backend -
Create and activate virtual environment
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Apply migrations
python manage.py migrate
-
Create superuser (optional)
python manage.py createsuperuser
-
Run the Django server
python manage.py runserver
-
Navigate to frontend directory
cd frontend -
Install dependencies
npm install
-
Start the React development server
npm start
Once the application is running, you can access:
- Frontend Application: http://localhost:3000
- Backend API: http://localhost:8000/api/
- Django Admin: http://localhost:8000/admin/
network-visualizer/
βββ backend/
β βββ api/ # API endpoints
β βββ manage.py # Django management script
β βββ media/ # Uploaded files
β βββ network_api/ # Main Django app
β β βββ models.py # Database models
β β βββ serializers.py # API serializers
β β βββ views.py # API views
β β βββ urls.py # URL routing
β βββ network_backend/ # Django project settings
β βββ requirements.txt # Python dependencies
βββ frontend/
β βββ public/ # Static files
β βββ src/
β β βββ components/ # Reusable React components
β β βββ pages/ # Page components
β β β βββ Home.js # Home page
β β β βββ DeviceList.js # Device listing
β β β βββ DeviceDetail.js # Device details
β β β βββ DeviceForm.js # Device form
β β β βββ NetworkMap.js # Network visualization
β β βββ services/ # API services
β β βββ App.js # Main React component
β βββ package.json # Node.js dependencies
βββ run.sh # Automated startup script
βββ README.md # This file
Create a .env file in the backend directory for environment-specific settings:
DEBUG=True
SECRET_KEY=your-secret-key-here
DATABASE_URL=postgresql://user:password@localhost:5432/dbname
ALLOWED_HOSTS=localhost,127.0.0.1The application uses SQLite by default. To use PostgreSQL:
- Install PostgreSQL
- Create a database
- Update the
DATABASE_URLin your.envfile - Install
psycopg2-binary(already in requirements.txt)
GET /api/devices/- List all devicesPOST /api/devices/- Create a new deviceGET /api/devices/{id}/- Get device detailsPUT /api/devices/{id}/- Update deviceDELETE /api/devices/{id}/- Delete device
GET /api/connections/- List all connectionsPOST /api/connections/- Create a new connectionGET /api/connections/{id}/- Get connection detailsPUT /api/connections/{id}/- Update connectionDELETE /api/connections/{id}/- Delete connection
- Navigate to the "Devices" page
- Click "Add New Device"
- Fill in the device information:
- Hostname (required)
- IP Address (optional)
- MAC Address (optional)
- Device Type
- Photo (optional)
- Notes (optional)
- Click "Save"
- Navigate to the "Network Map" page
- Drag devices to create connections
- Select the connection type
- Save the connection
- Go to the "Network Map" page
- View your network topology
- Interact with the visualization:
- Pan and zoom
- Click on devices for details
- Drag devices to reposition
cd backend
python manage.py testcd frontend
npm test-
Build the frontend
cd frontend npm run build -
Configure Django for production
- Set
DEBUG=False - Configure static files
- Set up a production database
- Configure your web server (nginx, Apache)
- Set
Happy Network Visualizing! π