Skip to content

🔥[gitlab-mirror] API server written in FastAPI related to one subject during CS studies aimed at learning the modern approach to application development and various technologies

License

mzebrak/steam-deals-backend

Repository files navigation

steam-deals-backend

License: MIT

Description

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

Code quality:

Others:

Additional:


The back-end of steam-deals project - that is, this repository, is hosted on two environments at two different addresses - production and development:

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.

Requirements

  1. python3.8 or higher
  2. python3.8-venv or higher (only when you're installing this package in a virtual environment)

Installation

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 or make help.
There are several variations of installation - all using a virtual environment installed in the venv/ 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 it
  • Upgrade 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

Usage

When you are in the steam-deals-backend/ directory, you can run the API server by running those command:

steam-deals OR python3 steam_deals/main.py

Available arguments are listed under the:

steam-deals -h OR python3 steam_deals/main.py --help

You can specify the environment by using the ENVIRONMENT_NAME environment variable like:

ENVIRONMENT_NAME=testing steam-deals -h OR ENVIRONMENT_NAME=testing python3 steam_deals/main.py --help

Authors and acknowledgment

There are 3 contributors of this project:

About

🔥[gitlab-mirror] API server written in FastAPI related to one subject during CS studies aimed at learning the modern approach to application development and various technologies

Topics

Resources

License

Stars

Watchers

Forks