A Next.js 15 application that consumes the Pi DEX backend to offer portfolio tracking, liquidity management, and swap tooling.
- Node.js 18+
- npm 10+
- Running instance of the Pi DEX backend (see
backend.md)
pnpm installThis project relies on the following environment variables:
# .env.local
NEXT_PUBLIC_API_URL=http://localhost:8000pnpm run devAdministrative actions (minting tokens, managing fees, etc.) require a backend JWT. Authenticate via the Admin Access card in Settings:
- Launch the app within Pi Browser (or with the Pi SDK available).
- Click Sign in as admin. The Pi SDK prompts for authentication.
- The frontend exchanges the Pi access token with
/v1/users/signinand stores the returned JWT. - Admin-only hooks automatically attach the bearer token using
setAuthToken.
To revoke access, use Sign out of admin in the same card.
Profile → Account Service allows a user to call /v1/account/import by providing either a secret key or mnemonic. The backend responds with the derived public key, which the frontend stores locally (no secrets are persisted). This is the recommended way to register the wallet used across dashboard, swap, and liquidity tools.
Manual checks to verify the integration:
- Dashboard loads live balances and operations for the authenticated wallet (
/v1/account/*). - Swap quotes and executes against
/v1/swapendpoints. - Liquidity lists pools, allows deposit/withdraw via
/v1/liquidity-pools/*. - Mint Token requires admin login, then POSTs to
/v1/tokens/mint. - Trustline submits to
/v1/tokens/trustline. - Settings → Admin Access signs in/out and persists session tokens.
After significant changes run the lint suite:
npm run lintaxios– HTTP client for API modules.jwt-decode– Validates admin JWT expiry for session management.lucide-react– Icon set used across the UI.