Hacker-view (HW) is a Flask based project that scraps the latest top-30 articles and lists them in a searchable datatable.
HW stores the data in SQLite database as it is lightweight, small and current project scope does not require more advanced database type.
This application is dockerized as well as could be installed independently.
-
Clone the repository
-
Build the image
docker build --tag hacker-view . -
Create and run the container
docker run -d -p 5000:5000 hacker-view -
Navigate to
http://127.0.0.1:5000orhttp://localhost:5005
-
Clone the repository and create a virtual environment for it. Currently, HW uses Python 3.10
python3.10 -m venv venv source venv/bin/activate -
Install the requirements
pip install -r requirements-dev.txt -
Launch the application with
python -m applicationfrom the application's root folder -
Navigate to
http://127.0.0.1:5000orhttp://localhost:5005
SQLite database hacker-view.db is provided in the repository
-
Updating the database (article points or articles if they do not exist) can be executed via CLI (command line input)
FLASK_APP=application.py flask articles update-points
-
Open active container list with
docker ps -
Copy the CONTAINER ID of the running Hacker-view image
-
Launch the container's interactive bash command line, replacing the with an actual ID from the last step
docker exec -it <CONTAINER ID> bash -
Execute the CLI article points update command
FLASK_APP=application.py flask articles update-points
-
Launch the tests with
pytest tests -
No more tests. Sorry. :(
