This project contains a Django backend (with websockets) and a ReactJS frontend for a Trace Visualization Application.
These instructions will guide you on how to run the application on your local machine for development and testing purposes.
- Python
- Node.js
- Pipenv (for managing Python dependencies)
- npm (comes with Node.js, for managing JavaScript dependencies)
You can check the versions you have installed by running:
python3 --version
node --version
npm --version
pipenv --version
The repository is divided into two main parts:
trace-viz-backend
: This directory contains the Django backend.trace-viz-frontend
: This directory contains the ReactJS frontend.
The following steps will help you setup the Django backend on your local machine:
-
Navigate to the
trace-viz-backend
directory:cd trace-viz-backend
-
Install the required Python dependencies using Pipenv:
pipenv install
-
Activate the Pipenv shell:
pipenv shell
-
Run the Django migrations to setup your database:
python manage.py migrate
-
Start the Django server:
python manage.py runserver
By default, the server will start on http://127.0.0.1:8000/
Note: To fetch locations of ip addresses we are using ipapi.com, which has a limit of 1000 requests in free account. If you see only private addresses on running traceroute that implies 1000 limit is reached. You can create your own account in ipapi.com and just replace key in locations.py file in backend.
The following steps will help you setup the ReactJS frontend on your local machine:
-
Navigate to the
trace-viz-frontend
directory:cd ../trace-viz-frontend
-
Install the required Node.js dependencies:
npm install
-
Start the React development server:
npm run dev
By default, the server will start on http://localhost:5173/
Open http://localhost:5173 in your web browser to access the frontend of the application. The frontend will communicate with the backend, which is running on http://127.0.0.1:8000/
This project is licensed under the MIT License - see the LICENSE.md file for details