Home Inventory DataBase
Note: this README is a work in progress.
The below steps are only meant for running this code in a development environment. If you intend to run this in production, please see "Running in a Production setting" below.
Use Pyenv to manage multiple Python versions.
# Developed using Python 3.9.5
$ pyenv install 3.9.5
# Set up a Python virtualenv
$ python3 -m venv env
$ source env/bin/activate
# Install dependencies
$ pip3 install -r requirements.txt
# Init the db schema
$ flask --app hidb init-db
# Run the app
# The web app will be accessable at http://localhost:5000/
# Add "-host=0.0.0.0" to allow access from the network; otherwise only localhost is allowed
# This should NOT be used in a production environment!
$ flask --app hidb --debug run
# Run unit tests
$ pytest
# Measure code coverage
$ coverage run -m pytest
$ coverage report
$ coverage html
Use one of the supported methods of deploying a Flask app. There are many options available, both commercial/third-party and self-hosted.
# Build release package
$ python setup.py bdist_wheel
This repository also contains the configuration necessary to deploy this app in a Docker container, which is another viable option for hosting this app.
# Build Docker container
# Note: must re-run this command to incorporate changes
$ docker-compose build
# Start up Docker container
$ docker-compose up
# Shut down Docker container
$ docker-compose down