Paper Playground Installation Guide¶
This guide will walk you through setting up Paper Playground, including hardware recommendations, installation, and troubleshooting. Follow each section to ensure proper configuration.
Required Hardware for Paper Detection and Control¶
- Desktop or Laptop Computer
- Performance will increase with better computer specifications (CPU, GPU, RAM, etc.).
- All major operating systems and browsers should also work, though most testing has been done with Windows/MacOS and Chrome/Firefox.
- Secondary display (e.g., monitor, projector, TV, etc.)
- Webcam
- 720p is adequate, but be cautious with cameras having low-quality sensors, as they might not perform well under all lighting conditions.
- 1080p cameras are ideal for use when the camera cannot be close to the play area or paper dots are very small.
- Paper & A Way to Make Program Dots
- You can print the programs on colored paper or use colored markers to draw them.
- Alternatively, a black and white printer with coloring markers will do. Check Resources for templates.
- A simple piece of paper and a steady hand can also be effective!
- Try colored stickers too!
(Optional) Required Hardware for Projector Use¶
- Projector & Projector Suspension Mount
- Ideally, at least 2000 lumens. A 1000 lumens projector might suffice in certain conditions, but the dim light required for projections might be too dark for your camera to detect programs.
- If your projector is large, ensure the projector is secured to a load-bearing structure like a beam or stud. Command Strips or screws in drywall may not suffice. Note: You can project onto a wall and tape your programs there for a vertical setup. It is also possible to use a mirror at 45 degrees near the projector output to redirect the image!
- Note 1: Depending on your setup, you might need extension cables for your video (VGA, HDMI, DisplayPort, etc) and USB cables to connect the camera and projector to the computer.
- Note 2: A solid black rug or mat for projection. Note: a projector's brightness is limited by its bulb, and its darkness is determined by the surface it projects onto.
Package Installation Intructions (Preferred)¶
- Install Node.js Dependency: Paper Playground requires Node.js to run. You can download the latest version of Node.js from the official website. Latest tested Node.js version was LTS v22.12.0 (Dec 2024).
- Download the Package: Download the latest Paper Playground package from the Releases page on GitHub. Choose the package that matches your operating system (Windows, MacOS). For Linux, follow the advanced command-line installation below.
- Extract the Package: Extract the contents of the package to a directory of your choice.
- Change Configuration (optional): Check the
config.json
file in the root directory of the project.- By default, the server will run on port 3000. If you need to change the port, change the key:value pair in
config.json
. - You can also add an OpenAI API key to the
config.json
file if you want to use the AI Code Assistant in Creator. - You may also add a remote database URL to the config.json file if you want to create a remotely collaborative program space. See instructions below for Remote or Local database. →
- By default, the server will run on port 3000. If you need to change the port, change the key:value pair in
- Run the Executable: Run the executable (.exe or .dmg) to install and start the program.
- Access Paper Playground:
- Open http://localhost:3000 in a web browser to access the main interface.
- To access the camera page, go to http://localhost:3000/camera and ensure it’s working as expected.
- To close Paper Playground, close the terminal window or press
Ctrl+C
in the terminal.
Command Line Installation Instructions (Advanced)¶
-
Check & Install Dependencies: Ensure you have Git and Node.js (includes npm) installed by running the following commands in your preferred command line interface (e.g., Terminal, Command Prompt, etc.):
-
Install Paper Playground: Run these commands to clone the repository and install dependencies:
-
Change Configuration (optional): Check the
config.json
file in the root directory of the project. - By default, the server will run on port 3000. If you need to change the port, change the key:value pair in
config.json
. - You can also add an OpenAI API key to the
config.json
file if you want to use the AI Code Assistant in Creator. -
You may also add a remote database URL to the config.json file if you want to create a remotely collaborative program space. See instructions below for Remote or Local database.
-
Start Paper Playground: Run the following command to start the program:
-
Access Paper Playground:
- Open http://localhost:3000 in a web browser to access the main interface.
- To access the camera page, go to http://localhost:3000/camera and ensure it’s working as expected.
You should be good to go! Move on to setting up your devices or straight to the interface overview to get started creating and testing your paper programs!
Paper Playground comes with a host of spaces
and projects
that will be installed by default in your local storage found in root/server/default-data
. Check them out!
The programs you create are stored in root/server/data
.
Updating Paper Playground¶
Package Update Instructions¶
- Back up your programs by copying the
root/server/data
directory androot/config.json
to a safe location. - Delete the
paper-land
directory from your computer. - See the GitHub Releases page for the latest version of Paper Playground. You can download the latest package and follow the installation instructions above to update your version of Paper Playground.
- Replace the
root/server/data
directory with your backed-up programs and replace or copy in the text from your savedroot/config.json
to the newconfig.json
for quick setup.
CLI Update Instructions¶
If you'd like the latest changes to the Paper Playground, you can update the project by running the following commands:
git pull # Pull the latest changes
npm install # Install any new dependencies
npm start # Start the program
(OPTIONAL) Installing Database for Collaborative Editing¶
Remote Database¶
If you are using a remote program database, which you can find online by searching "PostgreSQL database hosting" (paid), or by setting up your own (advanced):
- Open the
config.json
file in the root directory of the project. -
Write a key:value pair on a new line to provide Paper Playground with a remote database address under
DATABASE_URL
. -
Example:
DATABASE_URL=postgres://someDatabaseAddressFromSomeHostingService
Note
Are you working with us? Send an email to brett dot fiedler at colorado dot edu
to request access to our database of programs!
Local Database¶
If you do not have access to a remote database, you can host a local database on your computer using PostgreSQL.
- You will need to install PostgreSQL.
Warning
The following instructions have not been verified in the latest version of Paper Playground, but may prove informative for troubleshooting. Also see Paper Programs tutorial documentation
- Open the
config.json
file in the root directory of the project. - Replace the
STORAGE_TYPE=local
key:value pair with:STORAGE_TYPE=postgresql
Setting up PostgreSQL database permissions¶
- Edit pg_hba.conf file (found in PostgreSQL installation directory) by changing auth method “scram-sha-256” for local to “trust”
- you can be risky and set everything to “trust” if you’re having trouble, just make sure to change that if you ever do anything else with SQL.
- Example paths:
- (WINDOWS) C:\Program Files\PostgreSQL\15\data\pg_hba.conf
- (MacOS) Library\PostgreSQL\15\data\pg_hba.conf
- In terminal (make sure PSQL is in your PATH for Windows):
- Add a new user that matches your OS username. Be careful to match the case of the OS user and include semicolon. Following commands:
psql -U postgres
create role "Username";
// replace Username with name matching your OS username (include quotes though)alter role "Username" superuser createrole createdb login;
\du
to see the roleexit
to leave the psql in the terminal
Initial Run¶
Run the following command to set up the database:
You only need to run this command the first time you set up your database.
Developer Details for Paper Playground Contribution¶
The Paper Playground client runs locally. For program storage, Paper Playground uses your device's local storage by default. If you would like to support multiple users editing or accessing paper programs, you can configure a remote, hosted database OR a local PostgreSQL database.
Additional recommended start up commands if following development¶
Install Paper Playground according to the CLI Installation Instructions.
If you're following the development of Paper Playground, it is recommended to regularly execute the following commands:
Packaging Paper Playground¶
To package the project so that it is sharable, we have custom build scripts that include necessary files and make it easy to install dependencies. While a standalone executable may be possible in the future, it is not currently available. For additional details and history on the packaging process, see https://github.com/phetsims/paper-land/issues/259.
We require that you have Node.js installed on your system to run these scripts. Once you have Node.js you can run paper-playground by clicking on the setup executables.
Building your own package¶
These steps need to be followed for Windows and MacOS separately on a device with the OS of choice. The resulting build scripts are platform-specific and will not work across platforms. Likewise, you cannot create a MacOS build on a Windows machine or vice versa. The build script will automatically detect your platform and build the correct version.
If you are interested in packaging the project yourself, you can use the following steps:
- Install pkg globally:
npm install -g pkg
. pkg is used to package setup scripts into an executable. - Run
npm run build
to build the project. This will create abuild
directory in the root of the project. - Within the build directory are platform specific executables that a user can run to install node modules and run the project.
-
It also includes a
config.json
file where you can configure variables for the project (see installation instructions above.)- Note that there are other build scripts to build individual parts of the project (front end, server, etc.). See
package.json
for more details. - Note that this process requires the user to have Node.js installed on their system. A fully standalone build is not supported at this time.
- Note that there are other build scripts to build individual parts of the project (front end, server, etc.). See