First and foremost docker
and docker-compose
should be installed on your local machine.
The following commands will run the Flask
application on http://localhost:8000
.
docker-compose build
docker-compose up -d
API provides movie listing logic along with the index page content.
- Index:
GET /
- Get Movies :
GET /movies
- Get Movie :
GET /movies/:mid
redis
is utilized as the in-memory database.Cache aside strategy is applied in order to cache the movies.
pytest
is utilized for the testing. Start the local test with the following command:
sh ./test-local.sh
You can also test with your local virtual environment. ENV
variables are set within the conftest.py
, please
be aware to install redis
on your local machine.
pytest -v
.
├── Dockerfile
├── README.md
├── app
│ ├── __init__.py
│ ├── api.md
│ ├── index.py
│ └── movies.py
├── app.py
├── docker-compose.yml
├── requirements.txt
├── services
│ ├── __init__.py
│ └── ghibli_service.py
├── static
│ ├── errors.css
│ └── style.css
├── templates
│ ├── 404.html
│ ├── 429.html
│ ├── 500.html
│ ├── base.html
│ ├── get_film.html
│ ├── index.html
│ └── list_films.html
├── test-local.sh
├── tests
│ ├── __init__.py
│ ├── api
│ │ ├── __init__.py
│ │ ├── test_index.py
│ │ └── test_movies.py
│ ├── conftest.py
│ ├── services
│ │ ├── __init__.py
│ │ └── test_ghibli_api.py
│ └── tests-start.sh
└── utils
├── __init__.py
├── cache.py
└── error.py