This document explains how to set up a development environment and run the Pi Platform Demo App in the sandbox environment.
This guide assumes you have the following installed on your development machine:
- Node.js (recommended: v18 LTS or v20 LTS)
- Docker or MongoDB (MongoDB 7.0 compatible)
git clone git@github.com:pi-apps/platform-demo-app.git
cd platform-demo-appOpen https://develop.pinet.com in the Pi Browser on your mobile phone and complete the prerequisite steps (e.g., verifying your email address).
Create a new app by clicking the "New App" button.
- App Name: The name of your app
- Description: A public user-facing description of your app
- Network: Select "Pi Testnet"
Once you submit the form, it will bring you to your app's main page. From here, go to the Checklist to continue setup.
- Register an App - Completed in the previous step
- Configure App Hosting - Select "Self hosted"
- Create a Pi Wallet - See the Pi Wallet Introduction for more information
- Review Documentation - Check our Community Developer Guide
- Configure Development URL - Set the URL where your app runs:
- Running locally:
http://localhost:3314(default port)- Note: You can change the port in
frontend/.env.developmentusing thePORTvariable.
- Note: You can change the port in
- Running via Docker:
http://localhost(adjust accordingly if there's any change to docker files)
- Running locally:
- Whitelisted usernames: Leave blank for now
- App URL: Use your intended production URL (e.g.,
https://mydemoapp.com) or a placeholder (e.g.,https://example.com). Must be HTTPS.
Before proceeding, click the "API Key" button on your app's main page and save the generated key—you'll need it for setup.
You can run the demo app in two ways:
- Set up the frontend following the Frontend documentation
- Set up the backend following the Backend documentation
- Follow the Docker Setup documentation
To test all features, run the app in the Pi Sandbox.
The Sandbox enables running and debugging Pi Apps in a desktop browser, even though Pi Apps are designed for the Pi Browser.
For more information, see the Community Developer Guide.
On your desktop browser (use Firefox for this demo app), open the Sandbox URL from Step 6 of your App Checklist. Use your own URL, not the one shown in screenshots.
Warning
The demo app uses Express session cookies, which some browsers block in the Sandbox environment. For best results, use Mozilla Firefox.
Congratulations! Your app should now work in the Sandbox, allowing you to sign in, place orders, and make testnet payments.
For additional guidelines on registering apps and using the Sandbox, see the Pi Developer Guide.
