Skip to content
/ backend Public

The api to collect frontend data and store in db.

License

Notifications You must be signed in to change notification settings

logstr/backend

Repository files navigation

Python Docker Time

Logstr Api

Logstr api is the api backend for the logstr team. It collects data from npm package linked on a website. It handles request authprization and authentication, data storage from heatmap.

Rules

  • Do not share code with unauthorized personnels.
  • Make sure you send commits to branches with proper commit messages.
  • Comment code properly before commit.
  • Create pull requests and talk with teams.
  • DO NOT PUSH to MASTER Branch.

Getting started

Install Python and run code below, for the standalone web service:

pipenv install -r requirements.txt
python logstr.py

🎈 Visit http://localhost:5000/api/docs

To create models run the following command:

For Windows

set FLASK_APP=logstr.py
flask db init
flask db migrate
flask db upgrade

For MacOs and Linux

export FLASK_APP=logstr.py

flask db init
flask db migrate
flask db upgrade

Development

Create a new branch off the master branch for features or fixes.

After making changes rebuild images and run the app:

docker-compose build
docker-compose run -p 5000:5000 web python logstr.py

Tests

Tests are not a priority so skip tests if possible. Standalone unit tests run with:

pip install pytest pytest-cov pytest-flask
pytest --cov=web/ --ignore=tests/integration tests

Integration with docker:

docker-compose build
docker-compose up

Integration and unit tests run with:

docker-compose -f test.yml -p ci build
docker-compose -f test.yml -p ci run test python -m pytest --cov=web/ tests

After testing, submit a pull request to merge changes with master.

About

The api to collect frontend data and store in db.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published