Football bet rest server
Project description
Yak-toto
Requisites
- Ubuntu 22.04
- Postgres 17.2
How to build the project
Database
To setup a database, run yak env init. This will ask you to fill different configuration in order build env file.
Once done, you can run a docker script to start postgres database (at scripts/postgresrun.sh)
Backend
Run your project in a Python env is highly recommend. You can use venv python module using the following command:
uv venv
. .venv/bin/activate
Fetch all packages using uv with the following command:
uv pip install -e .
Before starting the backend, add JWT_SECRET_KEY and JWT_EXPIRATION_TIME in .env same as the Postgres user name and password. As
login system is using JSON Web Token, a secret key is required and an expiration time (in seconds). To generate one, you can use the python built-in secrets module.
>>> import secrets
>>> secrets.token_hex(16)
'9292f79e10ed7ed03ffad66d196217c4'
JWT_SECRET_KEY=9292f79e10ed7ed03ffad66d196217c4
JWT_EXPIRATION_TIME=1800
Also, automatic backup can be done through yak_server/cli/backup_database script. It can be run using yak db backup.
Finally, fastapi needs some configuration to start. Last thing, for development environment, debug needs to be activated with a additional environment variable:
DEBUG=1
And then start backend with:
uvicorn --reload yak_server:create_app --factory
Data initialization
To run local testing, you can use the script create_database.py, initialize_database.py and create_admin.py located in yak_server/cli folder. To select, set COMPETITION environment variable in .env. It will read data from yak_server/data/{COMPETITION}/.
Testing
Yak-server is using pytest to run tests.
Profiling
You can run the application with profiler attached. To do so, please run the following command
uvicorn --reload scripts.profiling:create_app --factory
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yak_server-0.63.2.tar.gz.
File metadata
- Download URL: yak_server-0.63.2.tar.gz
- Upload date:
- Size: 202.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46251f1e0447c1dca5392d56932ee00b4642c0726ba851468d094d625fede666
|
|
| MD5 |
5d8f926936b060fe203aea916f37846f
|
|
| BLAKE2b-256 |
e1cdefcb64bb8812415f2bd7967ce29984d95132bc5e3dcd0f6a7457ebae1e59
|
Provenance
The following attestation bundles were made for yak_server-0.63.2.tar.gz:
Publisher:
release.yml on yak-toto/yak-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yak_server-0.63.2.tar.gz -
Subject digest:
46251f1e0447c1dca5392d56932ee00b4642c0726ba851468d094d625fede666 - Sigstore transparency entry: 933815781
- Sigstore integration time:
-
Permalink:
yak-toto/yak-server@0cc40ad792d13f5c8de8653e0e14057c6ca28f7d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/yak-toto
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0cc40ad792d13f5c8de8653e0e14057c6ca28f7d -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file yak_server-0.63.2-py3-none-any.whl.
File metadata
- Download URL: yak_server-0.63.2-py3-none-any.whl
- Upload date:
- Size: 84.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cd71da2b4498b60c24f608ab6e550a53e0af703b27ae7960f023b42b0f6951c
|
|
| MD5 |
7cc644b4740652ae224b6e424f8d16f0
|
|
| BLAKE2b-256 |
fdade53b799a2fee74053eb891c64ee0de82697e9a6e55d28b45a2064f601757
|
Provenance
The following attestation bundles were made for yak_server-0.63.2-py3-none-any.whl:
Publisher:
release.yml on yak-toto/yak-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yak_server-0.63.2-py3-none-any.whl -
Subject digest:
5cd71da2b4498b60c24f608ab6e550a53e0af703b27ae7960f023b42b0f6951c - Sigstore transparency entry: 933815799
- Sigstore integration time:
-
Permalink:
yak-toto/yak-server@0cc40ad792d13f5c8de8653e0e14057c6ca28f7d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/yak-toto
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0cc40ad792d13f5c8de8653e0e14057c6ca28f7d -
Trigger Event:
workflow_dispatch
-
Statement type: