Giter Club home page Giter Club logo

web-app-demo's Introduction

Build and run locally

  • Create a virtualenv: python3 -m venv .venv (only need to run once).
  • Activate the virtualenv: . .venv/bin/activate
  • Install requirements within virtualenv: pip3 install -r requirements.txt (only when requirements change)
  • Deactivate virtualenv (when done using it): deactivate

Run flask app:

export FLASK_APP=src.main
export FLASK_DEBUG=1  # hot-reloads application when code changes 
flask run

Visit http://localhost:5000 to view the app.

Lint

Within virtualenv: black src --check

Unit Tests

Within virtualenv: python -m pytest

Build and run with Docker

Build the repo and tag the resulting image with "web-app-demo:latest":

docker build . -t web-app-demo

Run the image in a container named "web-app-demo-container", and forward the container port 5000 to the host port 5000:

docker run -p 5000:5000 --name web-app-demo-container web-app-demo

Lint

docker run web-app-demo black src --check

If the container is already running (with container name "web-app-demo-container"), lint can also be executed with docker exec:

docker exec web-app-demo-container black src --check

Unit Tests

docker run web-app-demo python -m pytest

If the container is already running (with container name "web-app-demo-container"), unit tests can also be executed with docker exec:

docker exec web-app-demo-container python -m pytest

web-app-demo's People

Contributors

lbernick avatar

Stargazers

 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.