a flask api boilerplate with authentication backed by postgres
- flask: python web framework
- flask-sqlalchemy: sql toolkit / ORM
- flask-migrate: sql migrations
- flask-login: authentication helpers for flask
- flasgger: used to generate the swagger documentation
- apispec: required for the integration between marshmallow and flasgger
- postgres: database
you should only need to install or set these up once
brew install pipenv
brew install pyenv
brew install pyenv-virtualenv
- optional for
oh-my-zsh
:-
git clone https://github.com/mattberther/zsh-pyenv ~/.oh-my-zsh/custom/plugins/zsh-pyenv
-
update
.zshrc
plugins=( ... zsh-pyenv pipenv )
-
-
install with homebrew
brew install postgresql@14
-
start
brew services start postgresql@14
-
run config script
make db-setup
-
checkout lastest from remote repository
-
install/update requirements
pipenv install
-
check for and run migrations
pipenv run pythom -m flask db check pipenv run python -m flask db upgrade # only if necessary
-
start the server
pipenv run python -m flask run
The code is covered by tests, to run the tests please execute
pipenv run python -m unittest