- User authentication via Auth0.
- Admin dashboard for managing news items and user interactions.
- Ability to like or dislike news stories.
- Pagination for news stories.
- User profile management.
- Frontend: HTML, CSS, Bootstrap v5.3
- Backend: Python (Flask)
- Database: SQLite3
- Testing: pytest, coverage
- Version Control: Git
- Clone Repository
git clone https://gitlab.com/jose-brouwer-website/josebrouwer.me.git cd josebrouwer.me
- Set Up Virtual Environment (optional)
python3 -m venv venv source venv/bin/activate
- Install Dependencies
pip install -r requirements.txt
- Database
- A provisional database "stories.db" is included but you can create a fresh database following these steps
sqlite3 stories.db < schema.sql
- Fetch the Latest News
- This will create a log file "fetch_log.txt" with the times the database has been updated
./run_fetch.sh
- Run the Flask App
python3 app.py
- Access the App
- Open web browser and go to
http://localhost
- Or go to:
http://127.0.0.1
- Make sure
run_pytest.sh
script is executeablesudo chmod +x run_pytest.sh
- Run shell script from repository root
- The script sets the working directory to be the repository root.
- Make sure to replace <path/to/project> with your path
#!/bin/bash export PYTHONPATH=<path/to/project>:$PYTHONPATH coverage run -m pytest "$@" coverage report
- Once you set your own path run the script as follows:
../josebrouwer.me$ ./run_pytest.sh
- The script runs the unit tests and provides a coverage report
- Flask: A micro web framework written in Python.
- Authlib: Authentication library for Flask.
- pytest: A framework for writing small tests in Python.
- coverage: A tool for measuring code coverage of Python programs.
- The
run_pytest.sh
script sets thePYTHONPATH
environment variable for the duration of the script's execution to ensure that pytest can find all necessary modules. - The
run_fetch.sh
script is used to fetch the latest news stories and should be set to run periodically (e.g., via a cron job). - Logo generated with DALL*E