Pi Network Connected Marketplace & Wallet
Shop, sell, earn ZYN rewards & manage your wallet. Spin the wheel daily, deposit, withdraw & trade on ZynMart.
π Live Demo Β· π± Features Β· ποΈ Architecture Β· βοΈ Setup Β· π‘ API
- Product Catalog β Browse & search products by category
- Seller Dashboard β Add, edit, manage products & orders
- Cart & Checkout β Seamless Pi payments with SDK integration
- Reviews & Ratings β User feedback system
- Dual Balance β Pi & ZYN balance management
- Deposit β Pi SDK payment integration with blockchain validation
- Withdraw β ZYN withdrawal with daily limits & trustline verification
- Transaction History β Merged Firestore + blockchain records
- Daily Free Spins β Earn ZYN rewards every day
- Ad Rewards β Watch ads for extra spins
- Promo Codes β Redeem codes for bonus ZYN
- Auto-Credit β Winnings go directly to ZYN wallet balance
- Pi Authentication β Seamless Pi Browser login
- Profile Management β Avatar, country, wallet address
- Notifications β Real-time order & payment updates
- Multi-Language β Arabic, English, French
zynmart/
βββ π api/ # Vercel Serverless Functions
β βββ auth-login.js # Pi authentication endpoint
β βββ auth-verify.js # Token verification
β βββ payment-approve.js # Pi payment approval
β βββ payment-complete.js # Pi payment completion
β βββ payment-cancel.js # Pi payment cancellation
βββ π src/
β βββ π components/ # UI Components
β β βββ header.js # Navigation header
β β βββ router.js # Client-side router
β β βββ toast.js # Notification toasts
β β βββ ...
β βββ π lib/ # Core Libraries
β β βββ firebase.js # Firestore configuration
β β βββ pi-payment.js # Pi payment flow
β β βββ pi-rpc.js # Blockchain RPC calls
β β βββ system-config.js # App configuration
β β βββ ...
β βββ π pages/ # Page Renderers
β β βββ home.js # Product feed
β β βββ wallet.js # Wallet & transactions
β β βββ spin-wheel.js # Spin wheel game
β β βββ checkout.js # Pi checkout
β β βββ ...
β βββ π stores/ # State Management
β β βββ pi-auth-store.js # Auth state & Firestore sync
β β βββ cart-store.js # Shopping cart
β β βββ orders-store.js # Order management
β β βββ ...
β βββ π locales/ # i18n Translations
β β βββ ar.json
β β βββ en.json
β β βββ fr.json
β βββ main.js # App entry point
β βββ styles.css # Global styles
βββ π public/ # Static assets
βββ π js/ # Legacy Pi SDK scripts
βββ index.html # SPA entry with Pi interceptor
βββ vercel.json # Vercel deployment config
βββ vite.config.js # Vite build configuration
βββ package.json
- Node.js β₯ 18
- Pi Browser (for testing)
- Firebase project with Firestore
- Pi Developer Portal API Key
git clone https://github.com/zynmartpi/zynmartpi.github.io.git
cd zynmartpi.github.io
npm installCreate a .env file in the root:
PI_SERVER_API_KEY=your_pi_api_key
PI_API_BASE=https://api.minepi.com/v2
FIREBASE_API_KEY=your_firebase_key
FIREBASE_PROJECT_ID=your_project_idnpm run devnpm run build- Push to GitHub
- Import repository on vercel.com
- Vercel auto-detects Vite framework
- Add
PI_SERVER_API_KEYin Settings β Environment Variables - Deploy!
npm run build
# Deploy the `dist/` folder to any static host| Route | Method | Description |
|---|---|---|
/auth/login |
POST | Verify Pi access token & return user data |
/auth/verify |
POST | Verify Pi access token validity |
/payment/approve |
POST | Approve a Pi payment via Pi API |
/payment/complete |
POST | Complete a Pi payment with txid |
/payment/cancel |
POST | Cancel a Pi payment |
All API routes use Vercel Serverless Functions with req.body parsing built-in.
- Pi API key stored as environment variable (never in code)
- Blockchain trustline validation for withdrawals
- Firestore security rules for data access
- CORS headers on all API endpoints
- No sensitive data in client-side code
Contributions are welcome! See CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License β see LICENSE for details.
Built with β€οΈ for the Pi Network Community