{"id":24968142,"url":"https://github.com/artrixdotdev/tournoza","last_synced_at":"2025-03-29T03:14:06.079Z","repository":{"id":228453271,"uuid":"774041594","full_name":"artrixdotdev/tournoza","owner":"artrixdotdev","description":"A self-hostable, all-in-one osu! tournament bot","archived":false,"fork":false,"pushed_at":"2024-03-31T19:08:46.000Z","size":172,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-03T13:11:17.194Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/artrixdotdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-18T20:56:23.000Z","updated_at":"2024-03-18T20:57:45.000Z","dependencies_parsed_at":"2024-03-31T20:22:33.162Z","dependency_job_id":"338717a7-f58d-47b5-96db-0bd9bc3270c6","html_url":"https://github.com/artrixdotdev/tournoza","commit_stats":null,"previous_names":["artrix9095/tournoza","artrixdotdev/tournoza"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artrixdotdev%2Ftournoza","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artrixdotdev%2Ftournoza/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artrixdotdev%2Ftournoza/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artrixdotdev%2Ftournoza/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artrixdotdev","download_url":"https://codeload.github.com/artrixdotdev/tournoza/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246131331,"owners_count":20728303,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-03T13:10:54.891Z","updated_at":"2025-03-29T03:14:06.063Z","avatar_url":"https://github.com/artrixdotdev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Tournoza\n\n_A self-hostable, all-in-one osu! tournament bot_\n\n![Repobeats](https://repobeats.axiom.co/api/embed/bf9ed2939598d47d5f7eeec429a6a960be49c619.svg \"Repobeats analytics image\")\n\n\u003c/div\u003e\n\n# Setup\n\nThis guide assumes that you have already created your bot application and invited the bot to your tournament server.\n\n## Prerequisites\n\n- [Bun](https://bun.sh) - Our primary runtime \u003csub\u003e\u003csup\u003eYou're free to use [Nodejs](https://nodejs.org) if you like\u003csup\u003e\u003csub\u003e\n- [Git](https://git-scm.com/downloads) - Used to stay synced with the latest version of this project\n- [Visual Studio Code](https://code.visualstudio.com/) - Convenient place to edit code \u003csub\u003e\u003csup\u003e_Optional_\u003c/sup\u003e\u003c/sub\u003e\n- [Ngrok](#deploying-locally) - We need this to expose our **LOCAL** bot to the discord webhook api\u003csub\u003e\u003csup\u003e_Optional_ Only needed if you plan to host the bot locally\u003c/sup\u003e\u003c/sub\u003e\n- [Vercel](#deploying-to-vercel) - \u003csub\u003e\u003csup\u003e_Optional_ Only needed if you want to host the bot in the cloud\u003c/sup\u003e\u003c/sub\u003e **Recommended**\n\n- Acquired your **token** and **public key** from the discord.js guide on [Creating your bot account](https://discordjs.guide/preparations/setting-up-a-bot-application.html#creating-your-bot) and [Adding your bot to your server](https://discordjs.guide/preparations/adding-your-bot-to-servers.html)\n\n## Creating a sheet\n\n**WIP**\n\n## Getting the Bot online\n\nAssuming you've already gotten your [token](#prerequisites) and [public key](#prerequisites), the first thing we're going to need to do is clone the repo and install the dependencies:\n\n```bash\ngit clone https://github.com/Artrix9095/tournoza\n\ncd tournoza\n\nbun install # If you used nodejs use npm here\n```\n\nInstalling all the dependencies might take awhile, while you're waiting we should set up our _Environment Variables_ \u003csub\u003e\u003csup\u003eenv for short\u003c/sup\u003e\u003c/sub\u003e\n\n### Environment Variables\n\nRename the [.env.example](.env.example) file to just `.env`\n\nAnd fill in your `BOT_TOKEN` and `BOT_PUBLIC_KEY` with there corresponding values you got earlier.\n\n#### Creating a osu! API key\n\nHead on to [you're osu! settings page](https://osu.ppy.sh/home/account/edit),\nscroll all the way down and create a new Legacy API Key\n\n![Legacy API Key Button](misc/legacy-api-key.png)\n\ntype in your tournament name as your \"application name\" and `https://tournoza.vercel.app` as the application url.\n\nOnce you've created your API key, press \"Show Key\", copy the API key and paste it in .env file under `OSU_API_KEY`\n\n#### Creating a service account\n\n**WIP**\n\nFor now just watch [this video explaining it better than I can lmao](https://www.youtube.com/watch?v=tSnzoW4RlaQ).\n\n**MAKE SURE YOU GIVE THE SERVICE ACCOUNT ADMIN OR OWNER ROLES. DO NOT RESTRICT ITS ACCESS LIKE THEY DO IN THE VIDEO**\n\nOnce you have your private key `.json` file, drag it into the project folder and rename it to `secrets.json` so the bot knows where to find it.\n\n### Start the server\n\nOnce you have all the required environment variables and everything is configured, you can start the server with:\n\n```bash\nbun scripts/register.ts # Registers all the slash commands\n\nbun run build \u0026\u0026 bun run start\n```\n\nIf you plan to actively edit the code for the bot, run:\n\n```bash\nbun run dev\n```\n\nWe're almost about halfway there. Now you just have to deploy it and link it to discord!\n\nSee the [Deployment](#deploying) section.\n\n## Deploying\n\nVercel... or Local? Where should I run my bot?\n\n_PSA: you don't have to use vercel, its just my personal preference, you are free to use things like [netlify](https://www.netlify.com/) as an alternative_\n\nWell first, you need to ask yourself a few questions:\n\nAre you looking for ease of deployment and management, or do you prefer more control over your environment? Running your Discord bot on Vercel offers simple deployment with automatic scaling and easy integration with GitHub for continuous deployment. However, running it locally gives you more control over the environment, allowing you to tweak settings and test locally before deploying changes. Consider your needs and preferences before deciding.\n\nOverall, I recommend the Vercel option for most tournaments, especially beginners to programming.\n\n### Deploying to vercel\n\n**WIP**\n\n#### Installing the CLI\n\n```bash\nbun install -g vercel # If you used nodejs use npm here\n\nvercel login # Links your vercel account to the CLI\n```\n\n### Deploying Locally\n\nWhen deploying to our local machine, we need our bot's URL to be publicly accessible so that discord can interact with it. To do this we need a proxy; this is where [Ngrok](https://ngrok.com/) comes in.\n\n1. Firstly, you must create an account [here](https://dashboard.ngrok.com/)\n   Afterwards it should prompt you to download the CLI. Do so and afterwards, run the command here:\n   ![Example pointing at the command that should be ran](misc/ngrok-login.png)\n\n2. [Start the bot server](#start-the-server)\n3. Run `ngrok http 3000` and leave the terminal open.\n4. [Link the URL ngrok gives you with your discord bot](#setting-up-interactions)\n\n## Linking your deployment to discord\n\nHey remember that discord bot application you made earlier? We're going to need that so keep it open.\n\nMake sure to keep your URL that you got from [the deployment section](#deploying) handy.\n\nIn the general information tab\n\n![discord-general-information-tab](misc/discord-general-information-tab.png)\n\nScroll down and enter in the \"Interactions endpoint url\" input your URL you got from [deploying](#deploying).\n![dicord interactions url](misc/discord-interactions-url.png)\n\n**MAKE SURE TO ADD THE FOLLOWING TO THE END OF THE URL**\n\n`/api/interactions`\n\nWith this, you should end up with a URL similiar to `mytourny.vercel.app/api/interactions` or its Ngrok equivalent.\n\nAND THATS ALL FOLKS, All slash commands should work in your tournament server! GLHF\n\n\u0026ensp;\u0026ensp;\u0026ensp;\u0026ensp;\\- Artrix\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartrixdotdev%2Ftournoza","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartrixdotdev%2Ftournoza","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartrixdotdev%2Ftournoza/lists"}