This project aims to familiarize ourselves with a modern and more professional approach to creating web applications thanks to the use of such technologies as:
- Python 3.8 - (as it is natively available in the latest ubuntu 20.04 LTS)
- FastAPI - web framework for building APIs
- pytest - testing framework
- bash - auxiliary scripts
- sonarcloud - cloud-based code quality and security service
- Black - code formatter
- pylint - code linter
- pre-commit - pre commit hooks
- GitLab CI/CD
- Gitlab Container Registry
- Gitlab Issue Tracking System
- Docker
- Microsoft Azure - VM instance
- PostgreSQL 12 - permanent database
- SQLite - temporary database
- make - build automation tool
- bcrypt - password hashing
- OAuth2 - access authorization protocol
- SQLAlchemy - object-relational mapper
- Dynaconf - object-settings mapper
The back-end of steam-deals project - that is, this repository, is hosted on two environments at two different addresses - production and development:
- development: http://nwta.eastus.cloudapp.azure.com:5555
- production: http://nwta.eastus.cloudapp.azure.com:5000
Those two addresses correspond to the master
and develop
branches in this repository.
API documentation is available under the
/api/v1/docs
and/api/v1/redocs
endpoints.
python3.8
or higherpython3.8-venv
or higher (only when you're installing this package in a virtual environment)
We assume that you have already cloned this repository and you are in the project directory, so you have done:
git clone https://gitlab.com/rafit/steam-deals-backend.git
cd steam-deals-backend/
Check if you don't know what is PEP 517
Then you can choose:
Install automatically with make
You can check available commands with
make
ormake help
.
There are several variations of installation - all using a virtual environment installed in thevenv/
directory.For example if you want to build entire project with
development tools
:make build-dev # Create virtual environment in the `venv/` directory and build the package with development tools . venv/bin/activate # Activate virtual environment
Install in virtual environment manually
Use PEP 517 - install everything automatically
pip3 install build # Install PyPA correct PEP 517 build frontend python3.8 -m build --wheel # Build the package in an isolated environment, generating a wheel in the directory `dist/` python3.8 -m venv venv/ # Create virtual environment in the `venv/` directory . venv/bin/activate # Activate it find dist/ -name *.whl | xargs pip install # Find `steam-deals` .whl in the `dist/` directory and install itUpgrade your system packages and install as editable
python3.8 -m venv venv/ # Create virtual environment in the `./venv/` directory . venv/bin/activate # Activate it pip3 install -U pip setuptools wheel # Upgrade your packages used for building pip3 install -e . # Install `steam-deals` as editable
Install in your operating system scope (not recommended)
Do as above, but just omit the following parts:
pip3 install build pythom3.8 -m build --wheel python3.8 -m venv venv/ . venv/bin/activate
When you are in the steam-deals-backend/
directory, you can run the API server by running those command:
steam-deals
ORpython3 steam_deals/main.py
Available arguments are listed under the:
steam-deals -h
ORpython3 steam_deals/main.py --help
You can specify the environment by using the ENVIRONMENT_NAME
environment variable like:
ENVIRONMENT_NAME=testing steam-deals -h
ORENVIRONMENT_NAME=testing python3 steam_deals/main.py --help
There are 3 contributors of this project: