Tokenized Communities in Telegram
HathorChat is a comprehensive platform that integrates Telegram communities with the Hathor blockchain, enabling tokenized interactions, rewards, and content access. The platform consists of three main components:
- Frontend: A React-based web application for wallet management and token interactions
- Backend: A Node.js/Express server that interfaces with the Hathor blockchain
- Bot: A Telegram bot that provides the user interface within Telegram
- Wallet Management: Create, import, and manage Hathor wallets
- Token Transfers: Send and receive HTR and custom tokens
- Custom Token Creation: Create your own tokens on the Hathor network
- Transaction History: View past transactions and balances
- Token Gating: Access exclusive content based on token holdings
- Tipping: Send tokens to other users with simple commands
- Badges & Rewards: Earn NFT badges for community participation
- Quizzes & Raffles: Interactive ways to earn tokens
- Dashboard: Manage community settings and token thresholds
- Analytics: View token usage statistics
- Content Management: Configure token-gated content
HathorChat/
├── frontend/ # React web application
├── backend/ # Express API server
├── bot/ # Telegram bot
└── docker-compose.yml # Docker configuration
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Telegram │ │ HathorChat │ │ Hathor │
│ User │<─────│ Bot │<─────│ Backend │
└─────────────┘ └─────────────┘ └──────┬──────┘
│
┌──────┴──────┐
│ Wallet │
│ Headless │
└─────────────┘
- Node.js (v16+)
- Docker and Docker Compose
- Telegram Bot Token (from @BotFather)
- Hathor Wallet Headless
git clone https://github.com/yourusername/HathorChat.git
cd HathorChat-
Backend Setup
cd backend npm install cp .env.example .env # Edit .env with your configuration
-
Bot Setup
cd ../bot npm install cp .env.example .env # Add your Telegram Bot Token to .env
-
Frontend Setup
cd ../frontend npm install cp .env.example .env # Configure frontend environment variables
The easiest way to run the entire stack is using Docker Compose:
docker-compose up -dThis will start the following services:
- Backend API on port 5000
- Hathor Wallet Headless on port 8000
- Telegram Bot connected to the backend
-
Start Hathor Wallet Headless
docker run -d --name hathor-wallet-headless -p 8000:8000 \ -e HEADLESS_NETWORK=testnet \ -e HEADLESS_SERVER=https://node1.nano-testnet.hathor.network/v1a/ \ -e HEADLESS_TX_MINING_URL=https://txmining.testnet.hathor.network/ \ hathornetwork/hathor-wallet-headless
-
Start Backend
cd backend npm run dev -
Start Bot
cd bot npm run dev -
Start Frontend
cd frontend npm run dev
For detailed documentation on each component, please refer to their respective README files:
- Wallet Security: Seed phrases should be encrypted or stored securely
- API Authentication: Implement proper authentication for production use
- Environment Variables: Keep sensitive information in environment variables
- HTTPS: Use HTTPS for all API communications in production
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is proprietary software.
- Hathor Network - The blockchain platform powering HathorChat
- Telegraf - Framework for Telegram bot development
- React - UI library for the frontend
- Express - Web framework for the backend API
https://drive.google.com/drive/folders/19SHzhH-PvPX_64dAotD4yLapQWMHXGBz?usp=sharing