horizontally scalable 📈 multiplayer 👩‍💻 🧑‍💻 chess ♟️ over ssh 🖥️ https://chessh.linux.usu.edu
Go to file
2023-05-06 10:53:09 -07:00
.github/workflows Update elixir.yml 2023-01-24 12:43:08 -07:00
buildscripts Update build_server.sh 2023-02-24 23:44:34 -07:00
config README changes, create thread on join, update package-lock (#21) 2023-04-22 23:32:55 -06:00
front README changes, create thread on join, update package-lock (#21) 2023-04-22 23:32:55 -06:00
lib/chessh send notification only from process where player joined and when discord thread id hasn't been created, set prod log level to info for better debugging 2023-05-06 10:53:09 -07:00
presentation Better README 2023-02-24 15:59:42 -07:00
priv Increase game moves column size 2023-03-13 14:43:51 -06:00
test Discord notifs (#14) 2023-02-01 14:57:14 -07:00
.env.example Better README 2023-02-24 15:59:42 -07:00
.formatter.exs Initial commit! 2022-12-19 01:39:10 -07:00
.gitignore Elixir cluster! 2023-01-31 19:07:47 -07:00
.tool-versions Presentation (#17) 2023-02-23 19:52:25 -07:00
Dockerfile Multicast instead of .hosts.erlang 2023-02-01 08:51:20 -07:00
mix.exs Move history (#18) 2023-03-13 14:13:11 -06:00
mix.lock Elixir cluster! 2023-01-31 19:07:47 -07:00
package-lock.json Web Client (#11) 2023-01-19 14:04:10 -07:00
README.md README changes, create thread on join, update package-lock (#21) 2023-04-22 23:32:55 -06:00

CheSSH

CheSSH is a distributed multiplayer implementation of the game of Chess over SSH, written in Elixir, with Discord integrations to deliver alerts when players are looking for opponents, or in games when it is one's turn.

https://user-images.githubusercontent.com/25559600/221317658-a80046ca-6009-456d-b43c-67d95baa4bf6.mp4

Usage

Dependencies

  • npm
  • elixir
  • postgresql
  • redis (which you can ignore if you only use the ETS backend for Hammer in config/dev.exs [set by default])

Installation

Do something among the lines of:

git clone https://github.com/Simponic/chessh
cd chessh

cp .env.example .env
vim .env # Fill it out mf
chmod 0700 .env
export $(cat .env | xargs)

# In one shell (after filling in your .env), migrate schema and start CheSSH
mix ecto.create
mix ecto.migrate
mix deps.compile

# Install frontend stuff
cd front
npm install

# Generate SSH keys
cd ../priv
./make_keys.sh

# Run the frontend and server concurrently!
cd ..
npm install -g concurrently
concurrently "mix run --no-halt" "cd front && npm start"

Architecture

The process of building the pi cluster is wholly contained in the awful buildscripts, which will individually ssh into separate pi's and build the services locally there as well as update the load balancer pi's configurations for nginx and HAproxy.

More architecture talk of CheSSH can be found in my (albeit kinda cringe) FSLC presentation on Elixir: https://github.com/Simponic/chessh/blob/main/presentation/chessh.org

Environment Variables (mostly optional)

  • REACT_APP_DISCORD_INVITE is the invite link to the discord server with the CheSSH bot
  • REACT_APP_DISCORD_OAUTH is the link (after replacing the GET URL params) that will be used to initiate discord OAUTH from the frontend
  • CLIENT_REDIRECT_AFTER_OAUTH & SERVER_REDIRECT_URI are self-explanatory
  • REACT_APP_SSH_SERVER and REACT_APP_SSH_PORT are used to build the .ssh config given to users on the home page of CheSSH after authentication
  • NEW_GAME_PINGABLE_ROLE_ID is the role id of the role to ping when one is looking for an opponent
  • REMIND_MOVE_CHANNEL_ID is the channel id to create private threads with players for move reminders and other communications
  • NEW_GAME_CHANNEL_ID is similar to the above
  • CLUSTER_NODES is a comma-separated list of nodes accepting connections to connect with libclustre