A repo for integrating Pi Network’s Pi Coin with Twitter (X) APIs, focusing on wallet and micro-payment features for seamless social transactions.
PiX-Pay-Integration is a cutting-edge, super-advanced application that seamlessly integrates Pi Network’s cryptocurrency (Pi Coin) with Twitter (X) for innovative micro-payments, social mining, AI-driven commerce, and real-time interactions. This project pioneers decentralized finance on social platforms, enabling users to mine Pi through social engagement, send instant tips, and leverage AI for personalized recommendations and fraud detection. Built with Node.js, Express, MongoDB, and modern web technologies, it includes features like OAuth authentication, WebSocket real-time updates, Progressive Web App (PWA) capabilities, and enterprise-level security.
git clone https://github.com/KOSASIH/PiX-Pay-Integration.git
cd PiX-Pay-Integration
npm install
.env.example to .env.MONGO_URI in .env.npm run setup # Runs migrations and seeds data
Edit the .env file with the following variables:
PORT=3000MONGO_URI=mongodb://localhost:27017/pixpayJWT_SECRET=your_super_secret_jwt_keyPI_API_KEY=your_pi_api_keyX_API_KEY=your_x_api_keyX_API_SECRET=your_x_api_secretX_BEARER_TOKEN=your_x_bearer_tokenX_WEBHOOK_SECRET=your_x_webhook_secretOPENAI_API_KEY=your_openai_api_keyOAUTH_CALLBACK_URL=http://localhost:3000/auth/x/callbackFor production, use NODE_ENV=production and adjust configs in config/production.js.
npm start
The app runs on http://localhost:3000.
http://localhost:3000.npm run dev # Uses nodemon for auto-restart
Run tests with:
npm test
docker build -t pix-pay .
docker run -p 3000:3000 pix-pay
docker-compose up
Apply manifests:
kubectl apply -f k8s/
npm run deploy:heroku
For production, ensure HTTPS, monitor logs, and scale as needed.
POST /auth/register - Register user.POST /auth/login - Login user.GET /auth/x - OAuth login with X.PUT /auth/profile - Update profile.POST /auth/setup-2fa - Setup 2FA.POST /wallet/link - Link Pi and X accounts.GET /wallet/balance - Get balance.POST /wallet/mine - Mine Pi.POST /payments/tip - Send tip.GET /payments/history - Transaction history.POST /payments/suggest - AI suggestion.GET /payments/report - AI report.GET /admin/users - View users.POST /admin/bulk-tip - Bulk tip.POST /webhooks/x - X webhook handler.GET /metrics - Prometheus metrics.For detailed API docs, see docs/api-docs.md.
git checkout -b feature/your-feature.git commit -m 'Add your feature'.git push origin feature/your-feature.Please follow the code style, add tests, and update documentation.
This project is licensed under the MIT License - see the LICENSE file for details.
For issues or questions, open an issue on GitHub or contact the maintainers.