The UCJ Tournament website, a TypeScript express server with a React.js frontend.
-
Install dependencies Run
npm install
in both thefrontend
andbackend
directories. -
Set server and website configurations
For the frontend:
- Copy
config-template.json
in/frontend/src
and rename it toconfig.json
- Set your
SERVER_URL
(where your backend is listening, WITHOUT the ending\
) - Set your
DISCORD_WIDGET
(widget id for the Discord server on the front page) - Set your
STREAM_CHANNEL
, (Twitch username for embed on the front page) - Set your
TOURNAMENT_TYPE
(normal
,fire
,water
, orsnow
for respective theming) - For the normal tournament rules, update
NORMAL_TYPE
to eithersingle
ordouble
For the backend:
- Copy
config-template.ts
in/backend/src
and rename it toconfig.ts
- Generally the
PG_PORT
will always be5432
unless you have configured it differently, so you're fine to leave that as-is - Set your postgres username and password in
PG_USER
andPG_PASSWORD
respectively - Set the database name in
PG_DATABASE
Note: the database structure will automatically generate, however you must create the database manually - Set your salt value for password encryption in
SALT
(Recommended at least around 10) - Set your admin account name (for the website itself) and password in
ADMIN_NAME
andADMIN_PASSWORD
respectively
- Copy
-
Run the server
For development:
- In the frontend, run
npm run dev
and it will start the local dev server. In the backend, runnpm run dev
and it will run the webserver with nodemon.
For production:
- In the frontend, run
npm run build
, and after that, move thedist
folder to the public folder in the backend: (in the root directory)mv frontend/dist backend/public
. Finally, run in the backendnpm start
.
- In the frontend, run
-
You're done!
The helper is a third part of the repository meant for very basic API scraping used to collect data and display in OBS. It is very simple and is not worth touching unless you're the tournament host.
The discord bot will keep track of which players are to play and ping them. For it to work, the database must have been correctly updated to contain the correct discord usernames.
Bot setup:
- First, create the bot in Discord
- Then, go to
bot/config_template.py
, rename it tobot/config.py
and write the needed details. - Install the libraries in
bot/requirements.txt
- Run the bot with
python bot/main.py