Déjà Brew - A web based coffee ordering system
docker-compose -f production/local/docker-compose.yaml up
cd backend
pipenv shell && pipenv install
cp env.example.sh env.sh
# Modify env.sh with relevant environment variables
source env.sh
Without SSL:
FLASK_APP=deja_brew flask run --reload --debugger
Access site at http://localhost:5000
With SSL Required when needing to test Google Oauth
FLASK_APP=deja_brew flask run --reload --debugger --cert adhoc
Access site at https://localhost:5000
Alembic is used to manage database migration and to generate SQL code to apply to production instances.
To provision a new database simply run the following:
alembic upgrade head
To provision a remote database where you may only have an SQL console, an SQL dump can be obtained
by using the --sql
flag:
alembic upgrade head --sql
With the local database instance running the latest version of the schema, Alembic can be used to perform a diff of the existing schema with the new one and generate a migration for you:
alembic revision --autogenerate -m "Add cafe table"
Ensure that the generated schema looks sane. Once you are happy it can be applied with the
upgrade
command:
alembic upgrade head
cd frontend
npm start
Access "fake" (detached) mode by visiting http://localhost:3000/. Alternatively the backend will reference assets from the webpack server by default.
When a new build is pushed to master
an automated build will be triggered via
Docker Hub.
This script will deploy the container to Amazon Elastic Beanstalk. It will create a new deployment for the docker container tagged with the current commit SHA
./production/bin/deploy.sh
- Installing python mysqlclient library on OSX: https://ruddra.com/posts/install-mysqlclient-macos/