Backend server for Bowled.gg
.vscode
launch.json
: VSCode debug configurationsettings.json
: VSCode Formatting settings
/app
main.py
: FastAPI application entrypointimport_routes.py
: HTTP Endpoint routersmiddleware.py
: Middleware hooks (ex: Logging)
/bowled_match_engine
- This directory is a submodule of the match engine repo (currently private)
/db_scrips
create_tables.sql
: SQL script to create tablesinsert_sample_data.sql
: SQL script to insert sample data
/deployment
nginx
: Nginx configuration and dockerfilerest_server
: REST server dockerfilevolumes
: Directory for persistent data
/dev
: Dev scripts dustbin/gamelib
cache_manager
: Cache managerplayer
: Player related functionsteam
: Team related functionsdata_models
: Data models for the game
/lib
core
: Core libraries for rest serverauth_bearer
: Authentication handlercache_store
: Redis connectordata_store
: Postgres connectorlogger
: Logging handler
utils
: Utility functions
/logs
: Directory to store persistent logs/rest_server
: HTTP endpoint handlers.pre-commit-config.yaml
: Pre-commit configurationdocker-compose.yml
: Docker compose configurationdocker-local.yml
: Docker compose configuration for local developmentdoppler.yaml
: Doppler configuration for secretspyproject.toml
: Python project configuration
- Install Poetry
- Install VSCode
- Clone the repo
git clone https://github.com/bunsamosa/bowled_server.git
- Change directory
cd bowled_server
- Install project dependencies with poetry
poetry install
- Install pre-commit hooks
pre-commit install
- The project uses Doppler for secrets management. However, you can use the environment variables listed below.
- Setup the following environment variables
REDIS_HOST
: Redis connection URIJWT_ALGORITHM
:HS256
JWT_SECRET
: Secret key for JWTJWT_AUDIENCE
: Depends on your JWT authentication providerPOSTGRES_URL
: Postgres connection URIPOSTGRES_SCHEMA
: Postgres schema name
- Hit
F5
to start the server (VS Code will automatically start the debugger) - Visit http://127.0.0.1:9009/docs to view the API docs
- Setup tables and sample data using scripts in
/db_scripts