A beautiful, interactive calculator for visualizing Pocket Network protocol revenue, token generation, and ecosystem rewards in real-time.
- 🎯 Real-time Calculations: Instant updates as you adjust network parameters
- 📊 Visual Metrics: Clear display of daily/annual POKT generation and revenue
- 💰 Reward Distribution: Breakdown of rewards for suppliers, validators, DAO, and source owners
- 🎨 Modern UI: Beautiful gradient design with Pocket Network branding
- 🔄 Live Price Updates: Real POKT price data from CoinGecko API
- 🏷️ Local Assets: Uses local Pocket Network logo and optimized assets
- 💱 Smart Formatting: Comma-separated numbers for better readability
- Node.js (version 14 or higher)
- npm or yarn
- Install dependencies:
npm install- Start the development server:
npm start- Open your browser and navigate to:
http://localhost:3000
For development with auto-restart on file changes:
npm run devcalculator/
├── index.html # Main calculator interface
├── server.js # Express server with CORS handling
├── package.json # Dependencies and scripts
├── .gitignore # Git ignore rules
└── public/ # Static assets
└── img/
├── logo-large-blue.png
└── logo-large-black.png
This project includes a proper CORS setup to prevent cross-origin issues:
- Server-side CORS: Configured to allow all origins (adjust for production)
- API Endpoints: All API calls are routed through the same server
- No External Dependencies: Eliminates CORS issues from third-party APIs
GET /- Main calculator interfaceGET /api/pokt-price- Real POKT price from CoinGecko APIGET /health- Health check endpoint
- ✅ Comma Formatting: Daily relays input now shows commas as you type
- ✅ Real-time Price Updates: Live POKT price from CoinGecko API
- ✅ Optimized UI: Clean, modern interface with Pocket Network branding
- ✅ Smart Input Handling: Intelligent cursor positioning during number formatting
- ✅ Removed unused CSS classes and variables
- ✅ Optimized logo usage with local assets
- ✅ Streamlined codebase for better maintainability
- ✅ Removed redundant animations and effects
- ✅ Updated to use Pocket Network blue logo
- ✅ Simplified project structure (single working version)
- Hero preview stats (simplified header)
- Unused CSS animations and effects
- Redundant design system variables
Adjust the default values in index.html to match current Pocket Network parameters:
- Daily Relays: 50,000,000 (default) - with comma formatting
- CUs per Relay: 2,500 (approximation)
- POKT Price: Auto-fetched from CoinGecko
- Reward Distribution:
- Supplier Share: 78%
- Validator Share: 14%
- DAO Share: 5%
- Source Owner Share: 3%
The calculator uses local Pocket Network logos:
public/img/logo-large-blue.png- Used in headerpublic/img/logo-large-black.png- Alternative version
This project is optimized for Vercel deployment:
- Connect your GitHub repository to Vercel
- Vercel will auto-detect it as a Node.js project
- Build Command:
npm install - Output Directory: Root directory
- Install Command:
npm install
For traditional server deployment:
- Set environment variables:
export PORT=8080
export NODE_ENV=production- Update CORS settings in
server.js:
app.use(cors({
origin: ['https://yourdomain.com'], // Restrict to your domain
methods: ['GET', 'POST'],
allowedHeaders: ['Content-Type']
}));- Use a process manager like PM2:
npm install -g pm2
pm2 start server.js --name "pocket-calculator"- Clone the repository:
git clone https://github.com/buildwithgrove/calculator.git
cd calculator- Install dependencies:
npm install- Start development server:
npm run dev- Open http://localhost:3000 in your browser
- HTML/CSS/JS: Edit
index.htmlfor UI changes - Server Logic: Modify
server.jsfor API changes - Dependencies: Update
package.jsonfor new packages
MIT License - feel free to use and modify as needed.