Web app for Network Manager.
Lets the admin of a particular node to edit the details of their node.
Also gets information about other nodes from the node registry and stores that information locally for the admin to use.
Postgres database https://www.postgresql.org/
Coding style is enforced using the pre-commit package.
You can set up your local git repository so that these style checks are automatically triggered whenever you make a new commit.
pip install pre-commit # Install the pre-commit package
pre-commit install # Install the pre-commit hooks defined in .pre-commit-config.yaml to the .git/ directory for this repo
Now whenever you make a commit, the style checks will run automatically and suggest changes to your code!
Some things need to be done first before starting the app.
If needed, set the environment variable. Change the path as needed, but keep the last folder as 'venv'
export VENV=~/Documents/GitHub/node-manager/venv
Run after setting environment variable
$VENV/bin/pip install -e .
$VENV/bin/pip install -e ".[dev]"
When installing the Postgres database it will also install pgAdmin, the graphical user interface for administrating the database.
The installation process will guide you through setting up the database
Create the database with the following attributes
Database name: noderegistry Username: postgres Password: localpassword
If you decide to use a different database name, username, and password change the postgres database connection string in the development.ini and production.ini files to match
POSTGRES_DATABASE_URL = postgresql+psycopg2://username:password@localhost:5432/databasename
The database connection string will need to be set or changed in the following files:
- development.ini
- production.ini
Search for "sqlalchemy.url" and ensure it is set to "POSTGRES_DATABASE_URL"
sqlalchemy.url = %(POSTGRES_DATABASE_URL)s
Search for "Database connection strings" and ensure it is set to "POSTGRES_DATABASE_URL"
sqlalchemy.url = %(POSTGRES_DATABASE_URL)s
If the table has already been created there is no need to run anything.
If the table has not been created, run the following command in a terminal
alembic -c development.ini upgrade head
$VENV/bin/pserve development.ini --reload
$VENV/bin/pserve production.ini --reload
In a browser go to http://localhost:6543/node/update