Coder Social home page Coder Social logo

flask_orders_manager's Introduction

Running Docker

docker compose up -d

To access the application server, go to http://localhost:8180/

Using Makefile

To carry out operations, use the Makefile.

$ make help 
Please specify a build target. The choices are:
build                          Build all or c=<name> container
rebuild                        Stop containers (via 'down'), rebuilds services images (via 'build') and start services (via 'start')
up                             Start all or c=<name> containers in foreground
start                          Start all or c=<name> containers in background
stop                           Stop all or c=<name> containers
restart                        Restart all or c=<name> containers
logs                           Show logs for all or c=<name> containers
status                         Show status of containers
ps                             Alias of status
down                           Clean all data
clean                          Clean all data
install                        Install the poetry environment
check                          Run code quality tools.
flask                          Activate python and launch flask
ruffix                         Running ruff check --fix
test                           Test the code with mamba.
cov                            Coverage console mamba's tests
help                           Show help

Running locally for development

Setting up Poetry environment

This project utilizes Poetry for managing dependencies. To install dependencies, run:

poetry install

Running the server

To run the server with gunicorn, use the following command:

gunicorn -w 2 -b 0.0.0.0:8080 --reload 'wsgi:app'

Alternatively, you can run the native Flask server with:

export FLASK_APP="wsgi:app"
flask run -h localhost -p 8000

Running Tests

For running Mamba tests with mock and expects, use:

poetry run mamba tests/test_mamba/**/*.py

Mamba coverage reports

For console report, run:

poetry run mamba tests/test_mamba/**/*.py --enable-coverage && poetry run coverage report -m  --rcfile=pyproject.toml

To generate an html report, run:

poetry run mamba tests/test_mamba/**/*.py --enable-coverage && poetry run coverage html -d coverage  --rcfile=pyproject.toml
Unittest

For running unittests with mock

poetry run python -m unittest discover -s tests/test_unittest

Unittest coverage reports

For console report, run:

poetry run coverage run  --rcfile=pyproject.toml && poetry run coverage report -m  --rcfile=pyproject.toml

To generate an html report, run:

poetry run coverage run  --rcfile=pyproject.toml && poetry run coverage html -d coverage  --rcfile=pyproject.toml

flask_orders_manager's People

Contributors

koskelainen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.