- docker is installed
- virtualenv is installed
- npm is installed
- AWS user with efficient roles to manage lambdas, RDS
- initialize virtual env
python3 -m venv env
- start your virtual env
source env/bin/activate
- install dependencies
pip install -r requirements.txt
- copy .env.sample to .env and fill in all variables
- start local database
cd docker && docker-compose up -d database && cd ..
- migrate local database
python manage.py db upgrade
- run flask app
flask run
To prevent formatting conflicts I would strongly suggest to use "black" via git hooks
- setup git hooks via
python -m python_githooks
- install serverless globally
npm install -g serverless
- install serverless packages
npm install
- ensure that the AWS variables are set correctly in .env and run
source .env
- deploy by running
sls deploy
- adjust the model in models.py
- create new migration
python manage.py db migrate
- edit new migration if needed
- go to AWS => Lambda => Environment variables => use the database host and port ini your .env file
- source your .env file
source .env
- migrate database
python manage.py db upgrade
- the following command will emulate a local lambda environment
sls offline