The UCJ Tournament website, a TypeScript express server with a React.js frontend.
-
Install dependencies Run
npm installin both thefrontendandbackenddirectories. -
Set server and website configurations
For the frontend:
- Copy
config-template.jsonin/frontend/srcand 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, orsnowfor respective theming) - For the normal tournament rules, update
NORMAL_TYPEto eithersingleordouble
For the backend:
- Copy
config-template.tsin/backend/srcand rename it toconfig.ts - Generally the
PG_PORTwill always be5432unless you have configured it differently, so you're fine to leave that as-is - Set your postgres username and password in
PG_USERandPG_PASSWORDrespectively - Set the database name in
PG_DATABASENote: 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_NAMEandADMIN_PASSWORDrespectively
- Copy
-
Run the server
For development:
- In the frontend, run
npm run devand it will start the local dev server. In the backend, runnpm run devand it will run the webserver with nodemon.
For production:
- In the frontend, run
npm run build, and after that, move thedistfolder 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.pyand write the needed details. - Install the libraries in
bot/requirements.txt - Run the bot with
python bot/main.py