Backend service for the MemeIndex Telegram Mini App, handling user interactions, coin registration, voting system, and task management.
-
👤 User Management
- User registration via Telegram
- Daily rewards system
- Vote balance tracking
-
🪙 Coin System
- Coin registration
- Voting mechanism
- Vote tracking and leaderboard
-
✅ Task System
- Daily tasks
- Task completion rewards
- Progress tracking
- Node.js
- Express.js
- MongoDB
- Mongoose ODM
- Node.js (v14 or higher)
- MongoDB (local or Atlas)
- npm or yarn
- Clone the repository:
git clone <your-repo-url>
cd MemeIndex/Backend- Install dependencies:
npm install- Create a
.envfile in the root directory:
MONGODB_URI=your_mongodb_connection_string
PORT=3000- Start the server:
# Development mode
npm run dev
# Production mode
npm start-
POST /api/user/register- Register new user{ "telegramId": "string", "username": "string" } -
POST /api/user/daily-reward- Claim daily reward{ "telegramId": "string" }
-
POST /api/coin/register- Register new coin{ "address": "string", "name": "string", "symbol": "string", "registeredBy": "string" } -
POST /api/coin/vote- Vote for a coin{ "userId": "string", "coinAddress": "string", "amount": "number" }
POST /api/task/complete- Complete a task{ "userId": "string", "taskId": "string" }
Backend/
├── src/
│ ├── models/ # Database models
│ ├── controllers/ # Request handlers
│ ├── routes/ # API routes
│ └── app.js # Main application file
├── .env # Environment variables
├── .gitignore # Git ignore file
└── package.json # Project dependencies
- telegramId (String, unique)
- username (String)
- votesBalance (Number)
- lastDailyReward (Date)
- completedTasks (Array)
- registeredAt (Date)
- address (String, unique)
- name (String)
- symbol (String)
- totalVotes (Number)
- registeredBy (String)
- registeredAt (Date)
- userId (String)
- coinAddress (String)
- amount (Number)
- votedAt (Date)
- title (String)
- description (String)
- rewardVotes (Number)
- isDaily (Boolean)
The API returns appropriate HTTP status codes:
- 200: Success
- 201: Created
- 400: Bad Request
- 404: Not Found
- 500: Server Error
To run in development mode with hot reload:
npm run devFor production deployment:
npm start- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.