Battle.net OAuth is used to authenticate users.
To get started, go to the Battle.net developer portal and log in with your Battle.net account.
Go to the API Access page, and create a new client:
Client Namecan be whatever you want.Redirect URLsmust includehttp://localhost:5173/api/login/battlenet/callback.Service URLdoesn't seem to matter, but puthttp://localhost:5173to be safe.Intended Usecan be something like "Authenticate users by Battletag".
Once created, copy the Client ID and Client Secret to the respective fields within the .env file.
You should now be able to log in to the website using your Battle.net credentials. If the superadmin you created in the setup phase matches your Battletag, this will log you into the existing user account. If not, it will create a new (non-admin) account.
Cloudflare is used in two ways:
- File storage with Cloudflare R2. This is used for storing team logos and the landing page hero/trailer video. Any S3-compatible storage can technically be used, but R2 is preferred due to its generous free tier and easy integration with Images.
- Image serving and optimization via Cloudflare Images.
To set these up for yourself, create a Cloudflare account and navigate to the Dashboard.
Cloudflare may ask you for credit card information on sign up. Don't worry about that as your usage will fall well below the free tier threshold.
Create a new R2 bucket. The project is by default configured to use a bucket named "dunderligan", however you can pick any name as long as it's reflected in the environment file. Leave Location as is, and pick the the Standard storage class.
Navigate to the Settings tab, find Public Development URL and click Enable. Copy the url into the PUBLIC_CDN_ENDPOINT field of the .env file.
Go back to the main R2 page, find API Tokens on the right sidebar and click Manage.
Create a new API token. For permissions, pick Object Read & Write. The rest of the options are up to preference.
Cloudflare will now show the Access Key ID, Secret Access Key and S3 endpoint for the newly created API token. Copy the three values into their respective fields of the .env file. These will not be shown again!
R2 should now be working. However, team logos still won't show until you've setup Images as well. Nevertheless, you can still test it out by uploading a team logo via the admin page and, via the Cloudflare dashboard, check that it was added to the R2 bucket.
TODO: figure out how to do this in a dev environment without a purchased domain on cloudflare.