Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

110 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Route

Route is a python webb application built with Dash whose goal is to store, show, and share hike trails. The objective of Route is to be lightweight and easily deployable on private clouds.

Installation

Building from source

0. Pre-setup

To install the application, go to the build directory.

Whether you are installing with the easy install command or doing it step by step, you need first to create a build/.env file with the following content

export DB_ROOT_USER = postgres
export DB_NAME      = route_db
export DB_USER      = user
export PGPASSWORD   = password
export DB_HOST      = localhost
export DB_PORT      = 5432

DB_ROOT_USER must be a valid username that has privileges to create databases and grant permissions to other users. DB_USER and PGPASSWORD will be used to connect to the database and interact with it.

1. Easy install

You can install the application by running the following command

make install
2. (Alternative) Step-by-step installation

Alternatively, it is possible to run the installation manually. The first step is to create the database which can be done with

make db-setup

Warning: make db-setup will remove any database with the same name for which the user has the CREATEDB privilege. This will erase any data in the database. Do a backup before running this command if you are unsure.

If necessary, one can just delete the database without creating a new one with the command

make db-clean

After that, the .env file from the /build directory is copied to the root directory so that the environment variables required to connect to the database are the same as those used for its creation.

To setup the environment, one can use the command

make env-build

If necessary, it is possible to remove the environment first with

conda deactivate
make env-clean

Note: the dash-leaflet version available on conda-forge or through the official pip integration of conda is not compatible with the rest of the libraries. Therefore, the current version of dash-leaflet is installed through pip. This may break and, thus, change in the future.

Once the database and the environment are built, the application can be launched with

conda activate Route
python app.py
Running the application in development mode

To run the application in development mode, simply use the following commands

conda activate Route
python app.py

Adding users to the database

In the current version of the application, there is no way for a new user to sign-in so this step must be handled on-server by running the following code

python insert_user_into_db.py -u username

replacing username by the username to add to the users table and typing the associated password in the terminal.

About

A small web app used to store, display, and share hiking trails

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages