Backend for the TourDO app, written in TypeScript for the Deno runtime.
Needs to be linked to a postgreSQL database.
The server will listen on port 3000.
Run
deno run --allow-env --allow-net --allow-read ./src/index.ts
The server will listen to port 3000.
You can also use the docker-compose.yml file while developing.
- JWT_KEY : key to be used to sign JWT, use this command to generate a new key :
deno run ./src/jwt/generate.ts
- INIT_DB : initialize the database at start
- DATABASE_URL : url of the postgresql database, used before the next variables
- DB_HOST : hostname / ip of the DB
- DB_PORT : port of the DB
- DB_USERNAME : username to connect to the DB
- DB_PASSWORD : password to connect to the DB
- DB_DATABASE : name of the database to use
- DB_POOL_SIZE : number of connexions allowed in parallel to the db, 100 by default.
The bodies sent to and recieved from the api is using snake_case naming to keep compatiblity with the database
82CFEkUXq3mY5i4
- trigger : can’t add beyond max_teams teams on tournaments
- comments
- clean unused code
-
match_count_trigger
: Update total of matches played after the match ends -
tournament_participants_check
andtournament_organizer_check
: A user can’t be on 2 teams participating at the same Tournament / event and can’t be player and organizer of a Tournament / event
1----\
(1 vs 2)------\
2----/ \
(w12 vs w34)
3----\ /
(3 vs 4)------/
4----/
Column, Row
match 1 vs 2 :
column 0 row 0
match winner of 1vs2 vs winner of 3vs4 :
column 1 row 0
- Admin
- Tournament / event organizer
- Player