In this project, a simple Flask application is created to list the movies of Studio Ghibli.
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 -dAPI 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.shYou 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