This is based off the most excellent Flask-RestX-Boilerplate
Note: this is in active development approaching 1.0 - i'm trying not to leave it in a broken state day to day, but I'm working on this no my own, and AFAIK noone else is looking at it, so I'm not being super paranoid about good commit practices; fear not, this will change once it gets to a minimum viable version. And in the interim, if it's snapped, chuck in an issue and I'll aim to fix it ASAP
Note: make sure you have pip
, virtualenv
, and npm
installed.
Initial installation: make install
To run test: make tests
To run application: make run
To run all commands at once : make all
Make sure to run the initial migration commands to update the database.
> flask db init
> flask db migrate --message 'initial database migration'
> flask db upgrade
or run:
make initdb
Bear in mind that this will drop any existing database, so use with extreme caution.
The best way of running things is using docker:
To run the back end, from the main directory, run:
docker run -p 5000:5000 -w /app --name sol-server-dev -v "$(pwd):/app" python:3 sh -c "make installServerDevDocker && make runDocker"
or, if you want to retain your existing DB:
docker run -p 5000:5000 -w /app --name sol-server-dev -v "$(pwd):/app" python:3 sh -c "make installServerDocker && make runDocker"
To run a hot-reloading dev server for the front end, cd to the client dir, and run:
docker run -p 8080:8080 -w /app --name sol-client-dev -v "$(pwd):/app" node:lts-alpine sh -c "npm install && npm run serve"
Open the following url on your browser to view client
http://127.0.0.1:5000/index.html
Or the following to browse the API's swagger documentation
http://127.0.0.1:5000/api
Authorization header is in the following format:
Key: Authorization
Value: "token_generated_during_login"
TBC