- Rust 62%
- TypeScript 19%
- JavaScript 15%
- CSS 3%
- Docker <1%
- 2 more languages 0%
Minigames #
Roadmap | Guide | Manual | Install
Minigames and leaderboard for Discord servers. Challenge your friends to games, and determine who is the best (mini)gamer once and for all.
Development Environment Setup #
Preparation #
Before running the project by any method, the following setup steps must be completed:
- On the Discord Developer Portal, Create an application, and then a bot within that application.
- Set up an OAuth2 redirect for the
/oauth2route of where you will be running the server (likelyhttp://localhost:8000/oauth2) - Copy
bot/.env.exampletobot/.envand put the appropriate values in. - Copy
server/.env.exampletoserver/.envand put the appropriate values in. - Use OpenSSL to generate the RS256 key for signing JWTs:
openssl genrsa -out server/jwt.pem - Add the bot to the Discord server you wish to add it to by visiting the link that is output by
bot/scripts/add.
Docker #
For those who are only planning on building games (and not modifying the bot or server),
the docker-compose.yml in the root of this repository describes everything required to run the
bot and server. Install Docker and docker-compose and you will be able to run the server
with just docker-compose up.
This docker-compose.yml uses the images published on the GitHub container registry. When run
this way, they have nothing to do with the source code on your system. Using Docker for
developing the server and bot is not recommended for that reason. Instead, follow the
instructions below to run the bot and server directly on your machine.
There is an additional file docker-compose.src.yml, which can be used to run the source
versions, instead of the published versions. This file is still not recommended for
developing the server or bot, as rebuilding the Docker containers takes a long time. This
file is mainly intended for testing the that the Docker images actually work before
publishing a release.
Server and Bot #
The server uses Rust (1.56) and PostgreSQL (14). The bot uses Deno (1.16). Install all of those however you like.
Once installed, use cargo to further install sqlx-cli (with at least the postgres feature),
then you can set up the database:
- Create the database with
sqlx database create. - Migrate the database with
sqlx migrate run.
Once all preparation and database setup steps have been completed, you can run the app. To have it fully working requires that PostgreSQL is running already, then:
- If migrations have changed, before starting the server run
sqlx migrate run. - Run the server with
cargo runin theserverdirectory. - Run the bot with
bot/scripts/bot.
Games #
Games are developed independently of the server, and can really be built in any way you choose, so long as it can interact with the server via HTTP and WebSocket.
For now, games have only been developed using Node.js (17), so ensure that is installed before attempting to work on them.
From there, follow the directions in each game's individual README to get them set up and running:
For more information on how to build a game and connect it with a running server, see the Guide.
Contributing #
Pull Requests and Issues are always welcome. Do note that this project is in very early stages so things will be moving quickly. You may want to wait until it settles down a bit. If you want to get involved though, do reach out and a roadmap can be set out.
Do keep to a consistent style, as enforced by CI. The projects within this repository are set up with standard linting and formatting practices for their respective languages.
Pull requests will not be accepted until CI passes. For each type of project, these are the commands you need to ensure succeed:
# Rust
cargo clippy
cargo fmt
cargo check
cargo sqlx prepare
# Deno
deno lint
deno fmt
# Node
npm run lint
npm run stylelint
npm run fmt
npm run build