demo

Pi Platform Demo App: Development Environment

The following document explains how to set up a development environment and run the Pi Platform Demo App in the sandbox environment.

Prerequisites:

This guides assumes you have the following two tools installed on your development machine:

1. Clone the Github repo and navigate to the project directory:

git clone git@github.com:pi-apps/platform-demo-app.git
cd platform-demo-app

2. Register your app on the developer portal

Open develop.pi in the Pi Browser, on your mobile phone, and go through the prerequisite steps (e.g verifying your email address).

Create a new app by clicking the “Register an App” button.

The Process is as follows:

Registration Form for an App


This will bring you to the App Dashboard, from this screen you can continue the development of the demo app.

App Checklist


3. Run the frontend development server

Setup the frontend app following the Pi Demo App Frontend documentation.

4. Run the backend development server

Setup backend server following the Pi Demo App Backend documentation.

5. Open the app in the Sandbox

To test all of the Demo App features, you need to run it in the Pi Sandbox.

The purpose of the Sandbox is to enable running and debugging a Pi App in a desktop browser, although a Pi App is meant to be opened in the Pi Browser by end-users.

For more information on the Sandbox head to our Community Developer Guide.

Lastly, on your desktop browser open the sandbox URL from Step 6 of App Checklist:

Sandbox URL

Sandbox URL

WARNING

The demo app uses express session cookies which, in the Sandbox environment, are not correctly saved on the client on some browsers. To properly test all of the features of the Demo App, we recommend you to open the sandbox app using Mozilla Firefox.

Congratulations! The app should work in the developer portal and enable you to sign in, place an order and make a testnet payment.

More Information - Developing on Pi

For guidelines on how to register an app and get the Sandbox URL, please refer to the Pi Developer Guide.