Skip to content

SprocketBot/sprocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sprocket

League Managment for Everyone


Discord Server Support us on Ko-Fi Twitter LinkedIn

Sprocket is a platform primarily used to manage and automate organized Esports leagues, one such example being Minor League Esports.

The platform uses a Microservice pattern, and this repository contains everything needed to quickly start a new microservice.

Running Locally

Sprocket comes with a Docker Compose file that can be used to easily run the platform locally.

Pre-requisites

You will need

  1. A Discord OAuth Application
    • Make sure that you have set up an OAuth Redirect URL of http://api.l.ocket.cloud:8080/oauth/callback/discord
    • If you are using a base url other than localhost; adjust the redirect url accordingly
  2. Docker (compose) Installed
  3. The Bun Javascript Runtime
  4. If you're on Windows, you'll need to install WSL and Node.js/NPM
  5. That's it!

You may want

  1. A Steam API Key This is used to link Steam Accounts
  2. An Azure OAuth Application This is used for Microsoft / Xbox account linking
  3. Other platform OAuth applications as they become available
  4. A database client such as datagrip or dbeaver
    • Make sure to not have a version of Postgres installed, as it could cause conflicting issues when you attempt to access the database using your client

Setup

  1. Once you have cloned the repository, copy .env.example to .env
    1. The root config.yaml is shared between all microservices, and can reference environment variables with sensible defaults. Some will be populated automatically (e.g. Postgres configuration), others will need to be set yourself
    2. You will need to configure:
      • AUTH_DISCORD_CLIENT_ID, AUTH_DISCORD_SECRET and AUTH_DISCORD_BOT_TOKEN
        • Bot token is only required if running the discord microservice
      • Your Discord application will also need to be configured with the redirect URL which this app uses: http://api.l.ocket.cloud:8080/oauth/callback/discord
  2. Install dependencies by running bun i from the root of the project.
    1. Sprocket uses Bun workspaces, which means that all dependencies are installed from the root of the project.
    2. When adding a new service or package, ensure that the root package.json is updated to include it
    3. Note for MacOS Users: Bun needs to be run within a linux container to properly install dependencies, as we're running the whole project within linux containers. To do this, run docker run -v .:/app -w /app oven/bun bun i instead of just bun i above. Make sure your node_modules/ folder is deleted before doing this!
  3. Once you have configured the environment to your liking, docker compose up, and navigate to l.ocket.cloud:8080.
  4. Add your discord username under the "initial admins" in the ./config.yaml file
  5. Run the ./migrate-up and ./seed scripts to initialize the database and populate it with some basic data

FAQ

Updating Bun Version:

About

Sprocket is a platform to manage and automate organized Esports leagues

Topics

Resources

Stars

Watchers

Forks

Contributors 16