https://github.com/mmt2048/2048-fullstack-old
2048 Game within Telegram Mini App
https://github.com/mmt2048/2048-fullstack-old
Last synced: 5 months ago
JSON representation
2048 Game within Telegram Mini App
- Host: GitHub
- URL: https://github.com/mmt2048/2048-fullstack-old
- Owner: TimNekk
- Created: 2024-12-25T11:51:24.000Z (over 1 year ago)
- Default Branch: prod
- Last Pushed: 2025-01-24T10:45:55.000Z (over 1 year ago)
- Last Synced: 2025-01-24T11:29:13.245Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 415 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
🎮 2048 Telegram Mini App
[](https://reactjs.org/)
[](https://www.typescriptlang.org/)
[](https://go.dev/)
[](https://www.python.org/)
[](https://www.docker.com/)
[](https://telegram.org/)
## 🌟 Overview
A modern implementation of the classic 2048 game as a Telegram Mini App, featuring a Telegram bot for game interactions and user engagement. This project combines the addictive gameplay of 2048 with seamless Telegram integration and a sleek, responsive design optimized for the Telegram platform.
## 🏗️ Project Structure
The project consists of three main components:
### 🎨 Web Frontend (`/web`)
- Telegram Mini App built with React 18 and TypeScript
- Telegram UI components for native look and feel
- Telegram Apps SDK for platform integration
- SWR for data fetching
- Vite as build tool
- Full responsive design optimized for Telegram
- Deployment ready for Telegram Mini App hosting
### 🔧 API (`/api`)
- Written in Go
- Clean architecture with internal/pkg structure
- Docker containerization
- Environment configuration support
- Makefile for common operations
- Air for live reload during development
- Configured for Dokploy deployment
### 🤖 Bot (`/bot`)
- Telegram Bot implementation in Python
- UV package manager for dependencies
- Containerized with Docker
- Modular source structure in src/
- Handles user interactions and game management through Telegram
- Integrated with Telegram Bot API
## ✨ Features
- 🎯 Classic 2048 gameplay optimized for Telegram
- 🤖 Telegram Bot for game management and user interaction
- 📊 Score tracking and statistics through Telegram
- 🎮 Smooth animations and responsive design
- 🌐 API for game state management
- 🐳 Docker support with Dokploy configuration
- 📱 Native Telegram UI integration
## 🚀 Getting Started
### Prerequisites
- Node.js (v18 or higher)
- Go 1.21+
- Python 3.8+
- Docker and Docker Compose
- Make (for API development)
- Telegram account for testing
### Installation
1. Clone the repository:
```bash
git clone https://github.com/yourusername/2048.git
cd 2048
```
2. Start the web application:
```bash
cd web
npm install
npm run dev
```
3. Start the API server:
```bash
cd api
make run
# Or with Docker:
docker-compose up api
```
4. Run the bot (optional):
```bash
cd bot
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
python -m src
```
### 🐳 Deployment
The project is configured for deployment using Dokploy:
```bash
# Deploy the entire stack
dokploy up
# Deploy specific services
dokploy up api
dokploy up bot
dokploy up web
```
Environment configuration is managed through Dokploy for each component.
## 🎮 How to Play
1. Use arrow keys or swipe gestures to move tiles
2. Combine matching numbers to create larger values
3. Win promocodes
## 🤖 Bot Features
- Implements advanced game-playing strategies
- Can be used to analyze game states
- Provides move suggestions
- Demonstrates optimal playing techniques
## 📝 License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## 🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## 🌟 Acknowledgments
- Original 2048 game by Gabriele Cirulli
- React and TypeScript communities
- Telegram community
- All contributors and players!