Tau is the debatecore debate tournament planner project's response cannon - also known as a backend.
The suggested way to develop and deploy requires you to use docker and cargo. You may also venture on your own, adapting the following instructions to your needs:
Set the following environment variables, via .env or your shell:
DOCKER_DB_ROOT_PASSWORDwill be used as the password for the database root user.DATABASE_URLis used for db connection. During development, this ispostgres://tau:tau@localhost:5432/tau.FRONTEND_ORIGINwill be used as an allowed origin for the purpose of CORS. Must be a valid URL.
Start the database with docker compose --profile dev (up -d/down).
Run the migrations via sqlx-cli with sqlx migrate run or by other means.
Compile and run the project with cargo.
For deploying via docker, set the following environment variables:
DOCKER_DB_PASSWORDwhich will be used as the password for the backend's database access user.DOCKER_DB_ROOT_PASSWORDwill be used as the password for the database root user.FRONTEND_ORIGINwill be used as an allowed origin for the purpose of CORS. Must be a valid URL (http://localhost:3000by default). Then, rundocker compose --profile prod.
SECRETwill be used as additional high entropy data used for generating tokens. By default, tau uses system entropy and the current UNIX timestamp.PORTwill be used as the port the server listens on. The default is 2023.
The following example .env file is geared for both scenarios:
DATABASE_URL=postgres://tau:tau@localhost:5432/tau
SECRET=CENTRUMRWLYSONOSTARPOZNANCDNSBCD4L52SPM
DOCKER_DB_ROOT_PASSWORD=superdoopersecretpasswordthatcannotbeleaked
DOCKER_DB_PASSWORD=wedoingsecurityinhere
FRONTEND_ORIGIN=https://example.com
PORT=2019Once the project is built, you can access the API documentation at localhost:2023/swagger-ui.