Download Repository - ArnoldSmith86/virtualtabletop GitHub Wiki
Choose your operating system
Linux
This assumes a Debian based Linux. Find Node.js repositories for other Linux distributions at https://node.dev/node-binary. Consult your distribution's documentation for how to install the git and nodejs packages if your distribution does not use apt.
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - # adds a repository for Node.js v16
sudo apt install -y git nodejs # installs the required software
git clone https://github.com/ArnoldSmith86/virtualtabletop.git # downloads everything in this repository
cd virtualtabletop # changes to the newly created directory
npm install # uses the Node.js package manager to install all dependencies
MacOS
Using brew:
brew install node
git clone https://github.com/ArnoldSmith86/virtualtabletop.git
cd virtualtabletop
npm install
Windows
- Install Git and Node.js.
- Open the command prompt and cd to a directory where you want the project to live.
- Do
git clone https://github.com/ArnoldSmith86/virtualtabletop.gitwhich downloads the project. - Do
cd virtualtabletopto get into the project directory git created. - Do
npm installso Node.js downloads all the dependencies of the project.
If you use "GitHub Desktop" you should follow these steps:
- Install GitHub Desktop and Node.js.
- Follow steps to setup the programs. Then open GitHub Desktop.
- Go to Current repository -> Add -> Clone a repository and select this one or your fork.
- Go to Repository -> Open in Command Prompt.
- Do
npm installso Node.js downloads all the dependencies of the project.
Android
To run the server on an Android phone without another computer, download the VirtualTabletop APK and open it on the phone. The app supports Android 7.0 and newer.
- Tap Install to download Node.js, git, and VirtualTabletop. This step needs internet access and about 1.1 GB of storage.
- Tap Start server. Keep the phone on with the app running while people play.
- Connect the other devices to the same WiFi network as the phone, or to its hotspot, and open the address shown in the app's notification in their browsers. After installation, you can play without internet access.
Use Quit in the app or its notification to save the rooms and stop the server. The app's Update button fetches newer server files when you have internet access. See the Android app README for more details.
Starting the server
Now you can start the server by typing:
npm start
If that doesn't work, try:
node server.mjs
This will serve the project at localhost:8272.
If you close you terminal and wants to restart you server you will need to get back to you clone folder using cd
Debug
To debug client-side code, first start the server so that it doesn't compress the code:
npm run debug
On windows, enter SET NOCOMPRESS=1 in a terminal prior to starting the server with npm start.
In your browser, refresh to have it re-download the client code. Press F12 to show the developer tools.
In Chromium, select the Sources tab, then the select the file for the room. Press Ctrl-f to search for the code you want to set a breakpoint for an step through.
Testing
To run the unit tests (and get a coverage report):
npm test
To run them continuously (on each save) while you develop:
npm run test-cont