-
Notifications
You must be signed in to change notification settings - Fork 3
Server Setup
By following this guide, you should be able to have all of the necessary software required for working on chessBots!
Note
There may be differences in the setup process for PC vs. Mac. Overall, both processes will be very similar.
- Git
- Text Editor (vsCode)
- NodeJS
- Python
Git is the software that allows users to collaborate with their code! Having this allows you to pull the latest version of the ChessBot Repository onto your computer. If you already have Git installed, you can bypass this step. If you aren't sure, follow along. The simplest way to ensure Git is set up properly is to use a client like GitHub Desktop. This is how we will install moving forward.
- Create an account at Github.com
Tip
If you already have an account, you can use your existing one
- Download GitHub Desktop for your system (Download Here!)
- Open the installer and proceed with the install process.
- When prompted, log in with your GitHub account.
- Choose to allow GitHub to configure Git. Do not configure manually.
- If you are on MacOS, when prompted, allow GitHub Desktop to be moved to the Application folder.
- Done!
VSCode is simply a text editor with a lot of great features for software development, such as powerful extensions, syntax hinting, and Git integration. This is what we recommend for all chessBot development for its ease of use. If you want to use another text editor, you may have a more difficult time moving forward since some of our extensions may not be compatible.
- Download VSCode (Download Here!)
- Proceed with install process
Note
If you are using MacOS, make sure to move to the application folder! It is not automatic for VSCode!
- Done!
Node is the software package that the chessBot web engine is built upon. Installing it is crucial for the install NPM packages and compiling the software.
- Download NodeJS (Download Here!)
Important
Select the LTS version, not current version
- Proceed with installer setup.
- If prompted, allow it to be added to the PATH
- Done!
Python is required for PlatformIO, the software that allows us to upload code to the chessBot MicroControllers.
- Download Python Installer (Download Here!)
- Proceed with install process
- Done!
Now that all the software is installed, we can setup our environment for chessBots! The way I describe is my personal preference, so you can make some changes along the way if preferred. For simplicity, feel free to follow my steps exactly.
Having a dev folder is important. This is a location where git can pull your projects to, and a central location for all of your development work. It is important to avoid syncing your code in a cloud location, such as OneDrive, iCloud, Google Drive, Box, or Dropbox. This can cause issues when working with git, and should be avoided! Instead, backup your files the old fashioned way with an external drive, or make sure your work is pushed to Git.
- Open Explorer
- In the Explorer Address Bar, navigate to
C:/Users
- Choose your user folder
- Create a new folder called "dev" in your user folder.
Warning
Saving your dev folder to Desktop or Documents is risky. These locations may be synced by Onedrive on your system, which can cause damage!
Setting up a dev folder on MacOS is simple!
- Open Finder
- Click "Go" at the top of the screen
- Click "Home"
- This will open your home folder, you should see things like "Downloads" and "Pictures" in here
- Create a new folder called "dev" in the home folder.
Warning
Saving your dev folder to Desktop or Documents is risky. These locations may be synced by iCloud on your system, which can cause damage!
Now, we need to pull the latest version of the chessBot project to our computer. For this, we will use Github Desktop. If you prefer to use the command line, feel free, we will not be explaining that in this guide.
- Open GitHub Desktop
- In your web browser, navigate to ChessBot Repo (Click Here!)
- Click the green "Code" button
- Click "Open with GitHub Desktop" and accept the prompt.
- GitHub Desktop will open with the project.
- Type in the correct folder, for macOS, that looks like this:
Important
Make sure to include the /chessBot
at the end. This will create a chessBot folder for the project.
Our last step is to setup VSCode for the project.
- Open VSCode
- Select "Open Folder" and choose the chessBot folder located in "dev"
- VSCode will prompt you to install the recommended extensions, click yes.
- VSCode is ready to use!
ChessBots rely on a variety of external software in order for our code to run. To do this, we use yarn to manage the packages needed.
- Open Terminal
- Type in
npm install --global yarn
Note
You may need to provide elevated access. Use sudo on MacOS and Administrator on Windows
- Type in your user password
- This will install yarn to your system using NPM
- Open VSCode
- Open the chessBot project
- Open a new Terminal in VSCode (Ctrl + Shift + `)
- Run
yarn install
- Run
yarn dev
- In your in browser, open
localhost:3000
- Done!
In some situations, Windows will claim you do not have permission to run commands. Follow these steps to fix:
- First, Open PowerShell with Run as Administrator.
- Then, run this command in PowerShell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
- Close and Re-Open VSCode
- Open the project in VSCode
- Open a Terminal in VSCode
- Type in "yarn dev"