KudosPay is a decentralized platform designed to facilitate transparent and fair tipping for staff in the hospitality and tourism industry. Built on the Hedera Hashgraph network, the platform allows guests to directly send token-based tips and recognition notes to staff, ensuring accountability and equitable distribution.
-
Token-Based Tipping
- Allows guests to send cryptocurrency-based tips securely.
- Integrates with Hedera testnet for smooth and low-cost transactions.
-
Transparent Record of Tips
- All transactions are recorded on the Hedera network, ensuring transparency and traceability.
- Utilizes Hedera Mirror Nodes to fetch real-time transaction history.
-
Recognition Notes
- Guests can include personalized notes recognizing staff members for exceptional service.
- Messages are sent to a Hedera Topic ID, and real-time retrieval is performed via Mirror Nodes.
-
Tip Distribution
- Companies can optionally distribute tips among team members using predefined logic.
-
Company Dashboard
- View remaining balances after tip distributions.
- Manage staff, view transaction history, and access recognition notes.
-
Staff Management
- Register, update, activate, and deactivate staff members easily.
-
Company Management
- Register companies and activate them via admin approval.
- Manage company balance and tip distribution.
- Fetch and display guest recognition messages.
-
Real-Time Data with Hedera Mirror Nodes
- Retrieve real-time:
- Transaction Data: Incoming and outgoing token transfers for accounts.
- Topic Messages: Messages sent to a specific Hedera Topic ID.
- Retrieve real-time:
- React.js (Vite)
- Tailwind CSS for styling
- React Icons for icons
- Axios for API communication
- React Toastify for notifications
- Node.js with Express.js
- MongoDB for data storage
- Hedera SDK (
@hashgraph/sdk
) for blockchain transactions and topic creation - Hedera Mirror Nodes for retrieving real-time transactions and messages
- JWT for authentication
- Hedera Hashgraph (Testnet)
- Node.js (v14+)
- MongoDB installed or hosted
- Access to the Hedera Testnet
-
Clone the Repository:
git clone https://github.com/your-repo/kudospay.git cd kudospay
-
Install Dependencies:
npm install
-
Setup Environment Variables:
-
Create a
.env
file in the root directory. -
Add the following variables:
SYSTEM_ACCOUNT_ID=your_hedera_account_id SYSTEM_PRIVATE_KEY=your_hedera_private_key HEDERA_TOPIC_ID=your_topic_id HEDERA_NETWORK=testnet PORT=5000 MONGO_URI=your_mongodb_uri JWT_SECRET=your_jwt_secret
-
-
Automated Topic Creation:
-
Run the following script to create a Hedera Topic for recognition messages:
node scripts/createTopic.js
-
This script uses Hedera SDK to:
- Create a new Topic ID.
- Automatically update the
.env
file with the generatedHEDERA_TOPIC_ID
.
-
-
Run the Backend Server:
npm run dev
-
Run the Frontend Server:
- Ensure the frontend connects to the backend API running on port
5000
.
npm run dev
- Ensure the frontend connects to the backend API running on port
-
Access the App:
Open
http://localhost:5173/
in your browser.
POST /api/auth/login
- Login userPOST /api/auth/register
- Register guestPOST /api/auth/register/staff
- Register staffPOST /api/auth/register/company
- Register company
GET /api/staff
- View staff listGET /api/staff/:id
- Get staff details by ID
GET /api/companies
- Get all active companiesPOST /api/companies/register
- Register a companyPOST /api/companies/:companyId/distribute
- Distribute tips among staff
POST /api/transactions/sendTip
- Send tip to a staff memberGET /api/transactions/:accountId
- Get transaction history for an account (via Mirror Node API)
POST /api/recognition
- Send a recognition message to Hedera topicGET /api/recognition/messages/:recipientId
- Fetch messages for a specific recipient (via Mirror Node API)
- The platform uses Hedera SDK (
@hashgraph/sdk
) to:- Create a Hedera Topic.
- Send and Fetch Transactions securely on the Hedera network.
The scripts/createTopic.js
script handles:
- Creating a new Hedera Topic.
- Automatically updating the
.env
file with the generatedHEDERA_TOPIC_ID
.
const fs = require("fs");
const { TopicCreateTransaction } = require("@hashgraph/sdk");
const { client } = require("../config/client");
async function createTopic() {
const transaction = new TopicCreateTransaction();
const response = await transaction.execute(client);
const receipt = await response.getReceipt(client);
const topicId = receipt.topicId.toString();
console.log("New Topic ID:", topicId);
// Update the .env file
const envConfig = fs.readFileSync(".env", "utf8");
const updatedConfig = envConfig.replace(/HEDERA_TOPIC_ID=.*/, `HEDERA_TOPIC_ID=${topicId}`);
fs.writeFileSync(".env", updatedConfig);
console.log("Updated .env with the new topic ID.");
}
createTopic();
Run the script with:
node scripts/createTopic.js
- Transactions and messages are retrieved in real-time using Hedera Mirror Nodes.
- These endpoints ensure up-to-date visibility of:
- Account balances.
- Tip transactions.
- Recognition messages sent to a Hedera Topic.
Example Mirror Node API Endpoints used:
-
Fetch account details and transactions:
GET https://testnet.mirrornode.hedera.com/api/v1/accounts/{accountId}
-
Fetch topic messages:
GET https://testnet.mirrornode.hedera.com/api/v1/topics/{topicId}/messages
- Integration with other blockchains for cross-chain tipping.
- AI-based analytics to predict and enhance staff recognition trends.
This project is licensed under the MIT License.
For inquiries or support:
- Email: [email protected]
Thank you for using KudosPay! 🚀