This contains all the needed files to run the program. Please be aware of the following dependencies:
- bcrypt
- PyJWT
- flask
- flask_cors
- numpy
These should be included in the python standard library, but are mentioned just in case:
- sqlite3
- json
This program was developed with Python version 3.13.2.
main.py
: This is the main entry point, and includes the API bindings & control logic.db.py
: Contains utilities to load the Sqlite database from thedata.sqlite
file.graph.py
: Includes graph based logic for path finding.nodes.py
: Includes utilities for loading and saving information from the database, specifically for nodes.usr.py
: Includes utilities for loading and saving information from the database, specifically for users.data.sqlite
: A database contaning the nodes, node tags, and any users that are saved with the program. The program will not run without this file.dijkstra.json
: A file that contains the precomputed shortests path table. The program will not run without this file.table_create.sql
: A file used to validate the database. This is required.
Note that data.sqlite
, and dijkstra.json
can be re-made, using the graph
utility included with this software bundle. Please see its documentation for more information.
To run this program, ensure that your current working directory is the same as the script's location. Then, invoke this command:
python3 main.py
Or, on Windows:
python main.py
This will boot up the software, and it will report where it is hosting. Please use the front end software to communicate with this software.
The intended deployment destination for this application, is the Google Cloud Compute Engine.
In order to host on this platform, an account and ample credits are required. These credits can be purchased here.
One an account and ample credits are procured, the next step is firewall configuration.
-
Go to the Google Cloud Console.
-
Navigate to
VPC network
>Firewall rules
. -
Click "Create firewall rule".
-
Complete the following:
Field | Value |
---|---|
Name | allow-port-5000 |
Network | default (or your network) |
Priority | 1000 (default is fine) |
Direction | Ingress |
Action on match | Allow |
Targets | All instances in the network (or specify a target tag if needed) |
Source IP ranges | 0.0.0.0/0 (allow from anywhere) |
Protocols and ports | Specified protocols and ports > check tcp and enter 5000 |
- Click Create.
This application requires several dependancies, all of which can be found in the 'Dependancies.txt' file.
To install them, begin by creating a virtual python environment (Conda or Venv).
Create environment
python3 -m venv <environment name here>
Activate (Windows)
venv\Scripts\activate.bat
Linux
source venv/bin/activate
Install dependancies
pip install -r Dependencies.txt
In order to securely expose the back ender server which is being served on 127.0.0.1:5000
, an NGROK tunneling service is required.
Follow below to install NGROK:
Linux (Debian)
curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null && \
echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list && \
sudo apt update && sudo apt install ngrok
Windows
-
Download the ZIP from https://ngrok.com/download
-
Extract it
-
Move the executable to a folder in your PATH (e.g.,
C:\ngrok\ngrok.exe
)
Sign in and generate token:
-
Sign up and copy your authtoken
Then run this command once:
ngrok config add-authtoken <your_token_here>
To start the server, run the following command form the src
folder.
python3 main.py
To engage the tunneling service, run the following command from anywhere in you virtual environment:
ngrok http https://127.0.0.1:5000
Now, the server should up and broadcasted through the public NGROK url.