Skip to content

Commit

Permalink
installation for local storage updates
Browse files Browse the repository at this point in the history
  • Loading branch information
brettfiedler committed Jun 3, 2024
1 parent ecdf48a commit 7f7effd
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 33 deletions.
1 change: 1 addition & 0 deletions docs/projects/codesign.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{placeholder}
1 change: 1 addition & 0 deletions docs/projects/craft.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{placeholder}
1 change: 1 addition & 0 deletions docs/projects/microcontroller.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{placeholder}
1 change: 1 addition & 0 deletions docs/projects/scenerystack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{placeholder}
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ mkdocs-minify-plugin==0.6.4
# via -r docs/requirements.in
packaging==23.1
# via mkdocs
pygments==2.15.1
pygments
# via mkdocs-material
pymdown-extensions==10.0.1
pymdown-extensions
# via mkdocs-material
python-dateutil==2.8.2
# via ghp-import
Expand Down
47 changes: 27 additions & 20 deletions docs/setup/install.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,45 @@

# Installation

!!! warning "Under Construction"

We are working on updating our documentation - more details coming soon!
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.

The Paper Playground client runs locally and can utilize a remote, hosted database for collaboration over sets of paper programs. You may also use a local PostgreSQL database. To run the client, you need a command-line interface and a few other software components:
To run the client, you need a command-line interface and a few other software components.

1. Install [Node.js/npm](https://nodejs.org/en/), [Git](https://git-scm.com/), and a command-line interface (e.g., Bash, Terminal, Command Prompt, etc.).
## Install the Client
1. Install [Node.js/npm](https://nodejs.org/en/), [Git](https://git-scm.com/), and a command-line interface, CLI (e.g., Bash, Terminal, Command Prompt, etc.).
> :red_circle: **Note:** Some users have reported issues installing newer versions of Node.js/npm on older macOS versions. Verify the last supported Node.js/npm version for your operating system.
2. Clone the repository using the following command: `git clone https://github.com/phetsims/paper-land.git`
3. Install the dependencies: `npm install`
4. Set up the database (see instructions below for Remote or Local database).
5. Start the tool: `npm start`
6. Open [localhost:3000](http://localhost:3000/) in your browser and follow the links on the landing page.
2. In your CLI, navigate to the directory your wish to install Paper Playground: e.g., `cd {insert directory}`
3. Clone the repository using the following command: `git clone https://github.com/phetsims/paper-land.git`
4. Install the dependencies: `npm install`
5. (OPTIONAL) Set up the database (see instructions below for Remote or Local database).
6. Start the tool: `npm start`
7. Open [localhost:3000](http://localhost:3000/) in your browser and follow the links on the landing page.

## Start up Paper Playground

You should be good to go! Move on to [setting up your devices](../setup/device-setup.md) or straight to the [interface overview](../setup/interface-overview.md).
You should be good to go! Move on to [setting up your devices](../setup/device-setup.md) or straight to the [interface overview](../setup/interface-overview.md) to get started creating and testing your paper programs!

### Recommended Start Up
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`.

### Recommended start up if following development

Currently, Paper Playground must be run from the command line. If you're following the development of Paper Playground, it is recommended to regularly execute the following commands:

1. `git pull`
2. `npm install`
3. `npm start`

## (OPTIONAL) Installing Database for Collaborative Editing

1. create a `.env` file (no prefix, usually creates a hidden file in your OS) in the root of paper-land and
2. Write a key:value pair on a new line to provide Paper Playground with: `STORAGE_TYPE=postgresql`


### Remote Database

If you are using a remote program 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):

1. create a `.env` file in the root of paper-land and
2. Write a key:value pair on a new line to provide Paper Playground with a remote database address under `DATABASE_URL`.
Expand All @@ -40,7 +51,7 @@ If you are using a remote program database:

### Local Database

If you do not have access to a remote database, you'll need to host a local database on your computer.
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](https://www.postgresql.org/download/).

Expand All @@ -49,7 +60,7 @@ If you do not have access to a remote database, you'll need to host a local data

#### 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”
- :red_circle: 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).
- :red_circle: 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
Expand All @@ -63,8 +74,4 @@ If you do not have access to a remote database, you'll need to host a local data

#### Initial Run
- [FIRST TIME - INITIAL SETUP ONLY] Use following command to create the database the first time in terminal
- `npm run dev`

#### Example Programs
- Once you have set up a local database, you can find a copy of all paper programs, including functional examples like **altitude-demo**, **lunar-lander**, **density-demo**, **simple-demos**, and more, in the maintainer's remote database located at `root/paper-programs-backup`. Please note that some spaces contain individual test programs or works-in-progress and may not have functional paper programs.

- `npm run dev`
8 changes: 3 additions & 5 deletions docs/use/resources.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# Resources
# Downloadable Resources

## Paper Program Blank Template

Don't have a color printer, but do have markers/colored pencils? Use this template to fill in the color dot sequences for your paper programs on the fly.

!!! info "Advice"

Try to color in the dots as uniformly as possible to improve detection by your camera.
Try to color in the dots as uniformly as possible to improve detection by your camera.

[Blank Dot Template (GitHub)](https://github.com/phetsims/paper-land/blob/main/docs/use/resources/draw-dots-paper-template.pdf)

[Blank Dot Template](./resources/draw-dots-paper-template.pdf)

!!! tip

Dot sequences are tied to the program number/ID. When using Creator, you can change the number of the programs you create. This means that you can re-use papers over and over! Just note the number of the paper you have printed and change the program numbers before sending them to the Playground.
Dot sequences are tied to the program number/ID. When using Creator, you can change the number of the programs you create. This means that you can re-use papers over and over! Just note the number of the paper you have printed and change the program numbers before sending them to the Playground.
16 changes: 10 additions & 6 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,19 @@ nav:
- Device Setup: setup/device-setup.md
- Interface Overview: setup/interface-overview.md
- Creator Tutorial: setup/creator.md
- Projects:
- Multimodal Codesign: projects/codesign.md
- Paper Craft: projects/craft.md
- Microcontroller Integration: projects/microcontroller.md
- SceneryStack: projects/scenerystack.md
- Media Gallery: media-gallery.md
- Resources:
- Walkthroughs: use/walkthroughs/walkthroughs.md
- MVC Framework: use/mvc.md
- About Model-View-Controller: use/mvc.md
- paperLand API: use/paperland-api.md
- Extra Resources: use/resources.md
- Design Tips: use/designing-programs.md
- Example JS Papers: use/example-program.md
- Examples:
- Gallery: media-gallery.md
- Downloadables: use/resources.md
- Project Design Tips: use/designing-programs.md
- Example Custom JS Papers: use/example-program.md
- Community:
- Join Us: community.md
- Contribute: CONTRIBUTING.md
Expand Down

0 comments on commit 7f7effd

Please sign in to comment.