Backend server for Bowled.gg
.vscodelaunch.json: VSCode debug configurationsettings.json: VSCode Formatting settings
/appmain.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_scripscreate_tables.sql: SQL script to create tablesinsert_sample_data.sql: SQL script to insert sample data
/deploymentnginx: Nginx configuration and dockerfilerest_server: REST server dockerfilevolumes: Directory for persistent data
/dev: Dev scripts dustbin/gamelibcache_manager: Cache managerplayer: Player related functionsteam: Team related functionsdata_models: Data models for the game
/libcore: 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:HS256JWT_SECRET: Secret key for JWTJWT_AUDIENCE: Depends on your JWT authentication providerPOSTGRES_URL: Postgres connection URIPOSTGRES_SCHEMA: Postgres schema name
- Hit
F5to 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