Note: This project was originally developed as a commissioned work for a client who has graciously permitted its publication as part of my portfolio. The codebase has been sanitized and made public for educational and demonstration purposes.
HyperGamble is a full-stack web application that provides a modern and secure gambling platform integrated with the HyperLiquid protocol. The project consists of a Next.js frontend and a Node.js/Express backend, both written in TypeScript.
- 🔐 Secure wallet integration with HyperLiquid protocol
- 💰 Real-time balance tracking and transactions
- 🎮 Multiple game modes
- 🤖 Telegram bot integration
- 📊 User dashboard with transaction history
- ⚡ Real-time updates using WebSocket
- 🎨 Modern UI with Tailwind CSS and Radix UI
- 🔒 Session-based authentication
- Next.js 15.0.3
- React 19.0 RC
- TypeScript 5.x
- Tailwind CSS 3.4
- Radix UI Components
- Framer Motion 11.x
- Axios 1.7.x
- React Hot Toast
- React Cookie
- React QR Code
- Node.js 18+
- Express 4.21
- TypeScript 5.x
- PostgreSQL
- WebSocket (ws 8.18)
- Ethers.js 6.13
- Jest 29.x for testing
- Docker
- Node Telegram Bot API
- OpenAI Integration
- MessagePack for efficient data serialization
- Node.js 18 or higher
- Docker and Docker Compose
- PostgreSQL (if running without Docker)
- Git
- Clone the repository:
git clone https://github.com/yourusername/hypergamble-public.git
cd hypergamble-public
- Set up environment variables:
Backend (.env):
DB_HOST=localhost
DB_DATABASE=mydb
DB_USER=postgres
DB_PASSWORD=your_password
DB_PORT=5432
BOT_TOKEN=your_telegram_bot_token
VAULT_PRIV_KEY=your_vault_private_key
VAULT_ADDRESS=your_vault_address
OPENAI_API_KEY=your_openai_api_key
Frontend (.env):
NEXT_PUBLIC_BACKEND_URL=http://localhost:5000/
- Start the application:
cd backend
docker-compose up --build
This will start:
- Backend server on port 5000
- PostgreSQL database on port 5432
- Adminer (database management) on port 8080
- In a new terminal, start the frontend:
cd frontend
npm install
npm run dev
cd backend
npm install
npm run dev
cd frontend
npm install
npm run dev
GET /validateSession
- Validate user sessionPOST /endGame
- End a game session- WebSocket endpoints for real-time updates
- Telegram bot integration endpoints
- More endpoints documentation coming soon...
cd backend
npm test
Tests are written using Jest and Supertest for API testing.
cd frontend
npm run test
- The project uses TypeScript strict mode
- ESLint and Prettier are configured for code formatting
- Commit messages should follow conventional commits format
- Tailwind CSS for styling with custom animations and text shadow support
Database tables are automatically created when the backend starts. See backend/src/db/createTables.ts
for schema details.
- Environment variables for sensitive data
- Session-based authentication
- Rate limiting on API endpoints
- CORS protection
- Secure wallet handling
- MessagePack for secure and efficient data serialization
The backend is containerized and can be deployed to any Docker-compatible hosting service. The Dockerfile and docker-compose.yml are provided in the backend directory.
The frontend is a Next.js application and can be deployed to Vercel or any other hosting service that supports Next.js.
This project is licensed under the ISC License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- 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
- HyperLiquid Protocol
- Next.js team
- Radix UI Components
- OpenAI for AI integration
- All contributors and supporters