nikmons / screwdriver

Manage/Monitor IT hardware servicing lifecycle
MIT License
1 stars 1 forks source link
alembic android-client api api-rest flask flask-restful hardware-servicing-lifecycle js jwt-authentication monitor python tracker

Build Status made-with-python GitHub contributors Percentage of issues still open Average time to resolve an issue

screwdriver

Manage/Monitor IT hardware servicing lifecycle

The repository contains a total of 3 projects.

  1. api - A python REST API (flask)
  2. client - Client Application (Android)
  3. Tracker - Helper Application (Js)

API

The API is responsible for handling user authentication/authorization (requested by the client app) and resource serving.

database

Persistent data storage is handled by postgresql.\ SQLAlchemy ORM is used for model/data handling and communication with the db.\ Database migrations are performed using alembic,

pipenv

This project uses pipenv for virtual environment management. To get started with pipenv you need to install it via pip.

cd api
pip install pipenv

Then following command initializes a new virtual environemnt, that will be used for the current project,

pipenv install

To use the virtual environment we can either start a new shell inside it.

pipenv shell

Or run single commands by using the run argument

pipenv run python --version

As pipenv also offers package manager capabilities we no londer need to use pip for package installation/removal.\

pipenv install pylint

To update Pipfile.lock we can use the following command.

pipenv lock

flask

To start a local development server of flask use the following command (always in the virtual environment)

pipenv run flask run

migrations

As stated previously, migrations are managed and executed using alembic. Any changes to models script\ should also be applied to the local instance of postgresql database by creating and executing the migration script locally.

Migration on the remote db is performed automatically as long as the new migration script has been commited

The following 3 commands are use to initialize,create and run migration scripts against the db.

pipenv run manage.py db init #Initialize db, create migration dir

pipenv run manage.py db migrate #Create a new migration script with applied changes

pipenv run manage.py db upgrade #Upgrade target db using migration script (or downgrade)

Client

[TODO]

Tracker

[TODO]