A web-based dashboard for managing cryptocurrency transaction requests. Users can submit transactions through the mobile app, and you can approve/reject them through this dashboard.
- Real-time Transaction Management: View all pending, confirmed, and failed transactions
- Status Updates: Change transaction status from pending to confirmed or failed
- Transaction Hash: Add blockchain transaction hash when confirming
- Statistics: View total, pending, confirmed, and failed transaction counts
- Filtering: Filter transactions by status
- Test Interface: Submit test transactions directly from the dashboard
cd web_dashboard
npm install
npm start
The dashboard will be available at: http://localhost:3000
Open your browser and navigate to http://localhost:3000
- Users submit transaction requests through the mobile app
- Transactions appear in the dashboard with "Pending" status
- Users wait for approval/rejection
- Once approved, they receive the transaction hash
- View all incoming transaction requests
- Review transaction details (from, to, amount, token)
- For each pending transaction:
- Confirm: Enter the blockchain transaction hash and mark as confirmed
- Fail: Mark the transaction as failed
The server provides these endpoints for mobile app integration:
GET /api/transactions
- Get all transactionsGET /api/transactions/pending
- Get pending transactionsPOST /api/transactions/submit
- Submit new transactionGET /api/transactions/:id/status
- Check transaction statusPOST /api/transactions/:id/cancel
- Cancel a transaction
Update your Flutter app's .env
file:
WEB_SERVER_BASE_URL=http://YOUR_SERVER_IP:3000/api
Replace YOUR_SERVER_IP
with:
localhost
for emulator- Your computer's IP address for physical device (e.g.,
192.168.56.1
)
- Use the "Submit Test Transaction" form on the dashboard
- Enter test addresses and amounts
- Click "Submit Transaction"
- The transaction will appear in the pending list
- Enter a test hash and confirm, or mark as failed
Mobile App Dashboard Blockchain
| | |
|-- Submit Tx ----->| |
| | |
|<-- Pending -------| |
| | |
| (waiting...) |-- Manual Tx ------>|
| | |
| |<-- Tx Hash ---------|
| | |
|<-- Confirmed -----| |
| + Hash | |
- Add authentication to the dashboard
- Use HTTPS instead of HTTP
- Implement rate limiting
- Use a proper database (PostgreSQL, MongoDB)
- Add input validation and sanitization
- Implement webhook notifications
- Add transaction signing verification
Edit server.js
:
const PORT = process.env.PORT || 3000; // Change 3000 to your desired port
Example with basic auth:
app.use((req, res, next) => {
const auth = req.headers.authorization;
if (!auth || auth !== 'Bearer YOUR_SECRET_TOKEN') {
return res.status(401).json({ error: 'Unauthorized' });
}
next();
});
Replace in-memory storage with MongoDB:
const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/transactions');
const Transaction = mongoose.model('Transaction', {
from: String,
to: String,
amount: Number,
tokenType: String,
status: String,
hash: String,
timestamp: Date
});
- Create a Heroku app
- Add this to
package.json
:"engines": { "node": "18.x" }
- Deploy:
git init heroku create your-app-name git add . git commit -m "Initial commit" git push heroku main
- Install Node.js on your server
- Clone the repository
- Install PM2:
npm install -g pm2
- Start with PM2:
pm2 start server.js
- Setup Nginx reverse proxy
For issues or questions, please check the main project repository.