If you want to run the code locally, you can do so against either the ITP Yorb server or a local server. If you want to change things on the "front end" (i.e. the style, objects in the space, the way people are shown in the space, the way the floor is laid out, etc.) but don't need to do any "server-side development," you can do so by following the first set of instructions here:
- Clone or fork the repository and download a local copy:
git clone https://github.com/AidanNelson/YORB2020.git
- Navigate into the repository and install dependencies:
cd YORB2020 npm install
- Create a new branch with a unique name and start developing:
git checkout -b add-cool-feature
- Start the build system which includes a local development server:
npm run watch
- Navigate your browser window to http://localhost:1234
- Note that you may need to restart this local development server / build system from time to time to ensure that your changes are being reflected in the browser!
-
Follow steps 1 - 3 from above,
-
Change the following variables in the
src/js/index.js
file to point to your local development server like this:// For running against local server const WEB_SOCKET_SERVER = "localhost:3000"; const INSTANCE_PATH = "/socket.io"; // For running against ITP server // const WEB_SOCKET_SERVER = "https://yorb.itp.io"; // const INSTANCE_PATH = "/experimental/socket.io";
-
Change directory in your terminal into the
/server
folder and install all required dependencies:cd server npm install
-
Change directory again back to the root directory of the project and start the server:
cd .. npm run start-server
-
In a separate terminal window (in the root directory of the project), start the build system (same as step #4 from above):
npm run watch
-
Navigate your browser window to http://localhost:1234. This page should now connect to your backend server at http://localhost:3000.
-
Note that you may need to restart this local development server / build system from time to time to ensure that your changes are being reflected in the browser!