Skip to content

zynmartpi/zynmartm.github.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›’ ZynMart

Pi Network Connected Marketplace & Wallet

Vercel Vite Pi SDK Firebase License

Shop, sell, earn ZYN rewards & manage your wallet. Spin the wheel daily, deposit, withdraw & trade on ZynMart.

πŸš€ Live Demo Β· πŸ“± Features Β· πŸ—οΈ Architecture Β· βš™οΈ Setup Β· πŸ“‘ API


πŸ“± Features

πŸ›οΈ Marketplace

  • 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

πŸ’° Wallet

  • 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

🎑 Spin Wheel

  • 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

πŸ‘€ User System

  • Pi Authentication β€” Seamless Pi Browser login
  • Profile Management β€” Avatar, country, wallet address
  • Notifications β€” Real-time order & payment updates
  • Multi-Language β€” Arabic, English, French

πŸ—οΈ Architecture

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

βš™οΈ Setup

Prerequisites

  • Node.js β‰₯ 18
  • Pi Browser (for testing)
  • Firebase project with Firestore
  • Pi Developer Portal API Key

Install

git clone https://github.com/zynmartpi/zynmartpi.github.io.git
cd zynmartpi.github.io
npm install

Environment Variables

Create 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_id

Run Locally

npm run dev

Build for Production

npm run build

πŸš€ Deployment

Vercel (Recommended)

  1. Push to GitHub
  2. Import repository on vercel.com
  3. Vercel auto-detects Vite framework
  4. Add PI_SERVER_API_KEY in Settings β†’ Environment Variables
  5. Deploy!

Manual

npm run build
# Deploy the `dist/` folder to any static host

πŸ“‘ API Routes

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.


πŸ” Security

  • 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

🀝 Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.


πŸ“„ License

This project is licensed under the MIT License β€” see LICENSE for details.


Built with ❀️ for the Pi Network Community

⬆ Back to Top

About

No description, website, or topics provided.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors