You can run the application with docker or without it. In the last case, you'll need a postgres db up. In both cases, you can visit the site at localhost:8000.
Execute the command below to start the application and its dependencies:
docker-compose up
Visit localhost:8000 for overview the app.
This tutorial from Docker was followed to set up the environment.
Make sure you have a postgres database. You'll probably need to change database default config.
Run the commands below:
pip install -r requirements.txt
./bin/run.sh
Visit localhost:8000 for overview the app.
- Migrations: Used migrations utility for database changes.
- DB Model: Two tables are implemented:
- Repo: Three fields for all information required.
name
is PK because is no repeatable for the required scenarios. - Stats: Is a table with a unique row where is stored the last request of the Api? The name of the stat is also the PK.
- Repo: Three fields for all information required.
- PEP 8: Passed Pycharm PEP 8 inspection. Only using bare
except
is warning. - forms: Only one form is used for the search feature.
- Unit tests: Implemented unit tests mainly for services.py. I assume test coverage can be improved.
- Coverage:
coverage
library is used, and Coveralls service is applied for easy coverage report viewing - urls.py: Two endpoints are implemented. One for each action of the user: List all repos, and search by name. Common templates and services are reused for each action.
- I've used lambdas for Searcher algorithm
- Travis has been implemented for test passing
- Is not possible to invert order in list
- Ordering for results returned from cache are not ordered
You can run them with coverage:
coverage run --source=webapp manage.py test
Or without it:
python3 manage.py test
- Implements test for
views.py
- Create end to end tests