Getting Started
Get up and running with the Solana Mobile PWA Template in minutes.
Prerequisites
- Node.js 20.0.0 or higher
- npm, yarn, or pnpm
- A mobile device or emulator for testing
For TWA (Android app) builds:
- Java JDK 17 or higher
- Android SDK (or let Bubblewrap install it)
Quick Start
Option 1: Using the CLI (Recommended)
bash
npx create-solana-pwa my-dapp
cd my-dapp
npm run devOption 2: Clone from GitHub
bash
git clone https://github.com/kshitij-hash/Solana-Mobile-PWA-Template.git my-dapp
cd my-dapp
npm install
npm run devOpen http://localhost:3000 on your mobile device or emulator.
CLI Options
bash
npx create-solana-pwa <project-name> [options]| Option | Description |
|---|---|
--network <net> | Default network: mainnet, devnet, testnet |
--npm | Use npm as package manager (default) |
--yarn | Use yarn as package manager |
--pnpm | Use pnpm as package manager |
--no-git | Skip git initialization |
Examples
bash
# Create with devnet as default
npx create-solana-pwa my-dapp --network devnet
# Create using yarn
npx create-solana-pwa my-dapp --yarnWhat's Next?
After creating your project:
- Customize your app - Edit pages in
src/app/ - Update branding - Modify
public/manifest.jsonand icons - Configure wallet - Set network in
WalletProvider.tsx - Build for production - Run
npm run build - Create Android app - Follow the TWA Guide
Testing on Mobile
Local Network Testing
- Find your local IP:
ipconfig getifaddr en0(Mac) orhostname -I(Linux) - Start dev server:
npm run dev - Open
http://YOUR_IP:3000on your mobile device
PWA Installation
- Open the app in Chrome on mobile
- Tap the browser menu (three dots)
- Select "Add to Home Screen"
- The app installs as a standalone PWA
MWA Testing
- Install a Solana mobile wallet (Phantom, Solflare)
- Open your PWA
- Tap "Connect Wallet"
- Approve the connection in your wallet app