Written by Paladin of Ioun.
Welcome! This is a guide intended for people with none of the required tools installed or have little to no experience with Git and GitHub. This guide has steps for Windows and Linux development (because I don't have a Mac).
Before we start, let's go over formatting. code
represents some code you have to run, usually in your terminal.
Make sure to install everything in order (except possibly mongodb) because everything requires the previous thing to be installed.
The first (and most important) tool you need is NodeJS. This is the programming language the site uses, so it's pretty important you have it installed correctly.
Go to the NodeJS website. You should see two green buttons to download. Download the LTS version (12.18.2 at the time of writing). Important: when installing, make sure to select to install npm
as well.
To install NodeJS, you should have a package called node
or nodejs
in your repository. Similarly, you should install npm
or node-npm
. The exact package name varies from distribution to distribution.
On any operating system, open a terminal (Command Prompt on Windows) and run npm install -g yarn
.
Follow the instructions here.
Follow the instructions here. For a distribution like Arch or Manjaro, you can find a prebuilt binary in the community
library instead of building it yourself.
Download it here. The default options are usually acceptable.
You should have a package called git
in your repositories. It is almost certainly pre-installed though.
Download and build from the official site. Many tutorials and prebuilt binaries are out of date. This can potentially work, but Redis is not at all well-supported on native windows. Redis suggests WSL.
You should have a package called redis
or redis-server
in your repositories. See redis docs for details.
If your computer ever asks you to reboot, do so now.
Now comes the fun part. If you don't have a GitHub account, make one now. Go to the GitHub repository and click . This creates a copy of the code that you can edit. Then, GitHub should take you to the fork. Now, once you are on a fork, click . A box should appear with an option to type in a new branch name. You can name it whatever you want, but it's recommended to name it something like "YourGithubName-patch1" or something more descriptive of what you are adding. For example, "TestAccount-patch1" or "TestAccount-fixing-timer" is good. "patch" or "my-branch" is bad.
For this step, you need the URL of your fork and the name of your branch. Find the directory where you want to store the source code of the game. Then, open a terminal to that directory. Run git clone <your fork url> -b <your branch name>
. For example, I might run git clone https://github.com/TestAccount/secret-hitler -b TestAccount-patch1
.
Change directory into your clone (cd secret-hitler
on all operating systems). Run yarn
to install the dependencies. Then, run yarn dev
. A bunch of lines of debug should output. Wait for it to tell you Webpack compiled in <some number> seconds
(may take more than 30 seconds on some computers), then open localhost:8080
in your browser. The site should load! When entering the game lobby, you'll see a bunch of buttons to log in to testing accounts. The accounts don't exist yet. Open a new terminal (don't close the one you already have or the site will close) and run yarn create-accounts
in the same directory you ran yarn dev
. If that works, run yarn assign-local-mod
. Now, Uther is an admin and everything is working!
If you get an issue like yarn: command not found
when running yarn dev
, make sure yarn
is on your PATH. This is a pretty common issue with some installations. If you are on Windows and can't get yarn
to run, try following their installation instructions.
I can't really help with this step, but now, you have all the code.
Make sure you know what files you changed. For each file you changed (or the directory with all the files), run git add <file>
(from any folder in the main folder of the code). Next, you want to explain what you did. Come up with a message. Usually a sentence or two is enough. Important: if you are fixing an issue, make sure to write "fixes #<issue number>". Then run git commit -m "<your message>"
. Finally, run git push
.
This is the last step! Go to your branch on GitHub (if you never closed your fork on GitHub, you should be still on it). You should see a yellow banner that looks something like this (but with a different branch name) . Click the green button. If you did everything right, you can click . Fill out a name and description (remember to include "fixes #<issue number>" in the description if you fixed an issue). Make sure to check "Allow edits by maintainers". Click "Create Pull Request" and you're done!
A collaborator will review your pull request (usually Vigasaurus), and either merge it, close it, or request changes. If they merge it, congratulations, you successfully helped the project! If they request changes, make sure to look at what they mention and correct it. If they close it, make sure to check for a comment as to why (sometimes, if you forget to enable "Allow edits by maintainers", the collaborator will have to close your pull request and merge it in a different way).