This repository is a Webapp that displays a catalog of games pulled from Steam. Users are able to create accounts which they can use to leave reviews and create wishlists. Everything is stored in a SQLite Database.
The webapp protects against CSRF attacks, stores passwords as salted hashes and ensures users use secure passwords.
Installation via requirements.txt
Windows
$ cd <project directory>
$ py -3 -m venv venv
$ venv\Scripts\activate
$ pip install -r requirements.txt
MacOS
$ cd <project directory>
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
When using PyCharm, set the virtual environment using 'File or PyCharm'->'Settings' and select your project from the left menu. Select 'Project Interpreter', click on the gearwheel button and select 'Add Interpreter'. Click the 'Existing environment' radio button to select the virtual environment.
Running the application
From the project directory, and within the activated virtual environment (see venv\Scripts\activate above):
$ flask run
After you have configured pytest as the testing tool for PyCharm (File - Settings - Tools - Python Integrated Tools - Testing), you can then run tests from within PyCharm by right-clicking the tests folder and selecting "Run pytest in tests".
Alternatively, from a terminal in the root folder of the project, you can also call 'python -m pytest tests' to run all the tests. PyCharm also provides a built-in terminal, which uses the configured virtual environment.
The project directory/.env file contains variable settings. They are set with appropriate values.
FLASK_APP
: Entry point of the application (should always bewsgi.py
).FLASK_ENV
: The environment in which to run the application (eitherdevelopment
orproduction
).SECRET_KEY
: Secret key used to encrypt session data.TESTING
: Set to False for running the application. Overridden and set to True automatically when testing the application.WTF_CSRF_SECRET_KEY
: Secret key used by the WTForm library.
The data files are modified excerpts downloaded from:
https://huggingface.co/datasets/FronkonGames/steam-games-dataset