|
1 | | -# zoe_challenge |
| 1 | +# zoe_challenge |
| 2 | + |
| 3 | +## Prerequisites |
| 4 | + |
| 5 | +These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. |
| 6 | + |
| 7 | +The code is run and tested with Python 3.7.7 on macOS 10.14.6. |
| 8 | + |
| 9 | +### Environment |
| 10 | + |
| 11 | +Clone the repo to your local machine. |
| 12 | + |
| 13 | +Create a virtual environment for Python 3 with: |
| 14 | + |
| 15 | + python3 -m pip install virtualenv |
| 16 | + python3 -m virtualenv -p python3 env |
| 17 | + |
| 18 | +Activate the virtual environment with: |
| 19 | + |
| 20 | + source env/bin/activate |
| 21 | + |
| 22 | +Install the required Python packages with: |
| 23 | + |
| 24 | + pip3 install -r requirements.txt |
| 25 | + |
| 26 | + |
| 27 | +## Run the app |
| 28 | + |
| 29 | +The `Dockerfile` can be used to build an image and deploy it locally: |
| 30 | +Make sure you have Docker installed: |
| 31 | + |
| 32 | + docker -v |
| 33 | + |
| 34 | +Build the image with: |
| 35 | + |
| 36 | + docker build --tag emoji-app:latest . |
| 37 | + |
| 38 | +Run the container locally: |
| 39 | + |
| 40 | + docker run --name emoji-app:latest -p 3001:3001 app |
| 41 | + |
| 42 | +You can now trigger the endpoint (`localhost:3001`), for example using `nc`. |
| 43 | + |
| 44 | +<!-- TODO --> |
| 45 | +<!-- Include usage info --> |
| 46 | + |
| 47 | +## Development and testing |
| 48 | + |
| 49 | +Use the `Makefile` you can run `make <cmd>` where `<cmd>` is one of: |
| 50 | + |
| 51 | +* `sort-imports` to ensure Python imports are in the correct PEP format |
| 52 | +* `format` to format Python files using black |
| 53 | +* `type-check` to run `mypy` static type checking |
| 54 | +* `test` to run unittests using `pytest` |
| 55 | +* `all` to run all the above steps |
| 56 | + |
| 57 | +or just type `make`/`make all`, which will run all of the above. |
| 58 | + |
| 59 | +## Authors |
| 60 | + |
| 61 | +* Manuel Zander |
0 commit comments