Skip to content

MoratNZ/simple-operational-logbook

 
 

Repository files navigation

Simple Operational Logbook

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

Terminal commands

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.

Setting things up with docker for development

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"

Viewing the app

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

Using Postman

Authorization header is in the following format:

Key: Authorization
Value: "token_generated_during_login"

Full description and guide for the underlying flash-restx

https://medium.freecodecamp.org/structuring-a-flask-restplus-web-service-for-production-builds-c2ec676de563

Contributing

TBC

About

A simple, API-first, operational logbook

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 56.9%
  • Vue 34.2%
  • JavaScript 7.5%
  • Makefile 0.7%
  • HTML 0.4%
  • Less 0.3%