A real-time multiplayer physics-based Jenga game where players compete to remove blocks without toppling the tower.
Jenga Race is a full-stack web application that allows players to:
- Create accounts and manage profiles
- Join matchmaking queues to find opponents
- Play real-time Jenga games with physics-based block manipulation
- Chat with opponents during gameplay
- Track statistics and climb the leaderboard
- Node.js with Express for the server
- Socket.io for real-time communication
- MongoDB for data storage
- JWT for authentication
- bcrypt for password hashing
- Vanilla JavaScript with modular architecture
- Bootstrap for responsive UI
- Socket.io client for real-time updates
- Unity WebGL for the game client (placeholder implemented)
- User registration with email/password
- Login/logout functionality
- Profile creation and editing
- JWT-based authentication
- Password hashing with bcrypt
- Skill-based player matching
- Queue management
- Dynamic skill range expansion
- Real-time match finding
- Socket.io game room management
- Turn-based gameplay
- Block movement and removal
- Game state tracking
- Winner/loser determination
- Game statistics tracking
- Player performance metrics
- Leaderboards
- Usage analytics
JengaRace/
├── backend/ # Node.js server
│ ├── middleware/ # Auth middleware
│ ├── models/ # MongoDB schemas
│ ├── routes/ # API endpoints
│ └── server.js # Main server file
├── frontend/ # Web client
│ ├── js/ # JavaScript modules
│ │ ├── api.js # API service
│ │ ├── auth.js # Authentication service
│ │ ├── game.js # Game service
│ │ ├── main.js # Main entry point
│ │ └── ui.js # UI service
│ ├── index.html # Main HTML file
│ └── styles.css # CSS styles
├── game/ # Unity WebGL game client
│ └── index.html # Game placeholder
├── .env # Environment variables
└── README.md # Project documentation
- Clone the repository:
git clone https://github.com/attt84/gengarace.git
cd JengaRace
- Install dependencies:
cd backend
npm install
- Set up environment variables:
Create a
.env
file in the root directory with the following:
PORT=3000
MONGO_URI=mongodb://localhost:27017/jengarace
JWT_SECRET=jenga_race_secret_key_2025
NODE_ENV=development
- Start the server:
npm start
- Open the application in your browser:
http://localhost:3000
POST /api/users/register
- Register a new userPOST /api/users/login
- Login and get JWT tokenGET /api/users/me
- Get current user profile
POST /api/game/create
- Create a new gamePOST /api/game/join
- Join an existing gamePOST /api/game/ready
- Set player ready statusPOST /api/game/move
- Make a move in the gamePOST /api/game/remove-block
- Remove a block from the towerPOST /api/game/end
- End a game (tower collapsed)
POST /api/matchmaking/join
- Join matchmaking queuePOST /api/matchmaking/leave
- Leave matchmaking queueGET /api/matchmaking/status
- Get current matchmaking status
GET /api/analytics/usage
- Get general usage analyticsGET /api/analytics/games
- Get game-specific analyticsGET /api/analytics/leaderboard
- Get leaderboard dataGET /api/analytics/user-stats
- Get authenticated user's statistics
joinGame
- Join a game roommoveBlock
- Move a blockremoveBlock
- Remove a blockchatMessage
- Send a chat messageleaveGame
- Leave a game
playerJoined
- A player joined the gamegameStarted
- Game has startedblockMoved
- A block was movedblockRemoved
- A block was removedgameEnded
- Game has endedchatMessage
- New chat message
- Complete Unity WebGL game client integration
- Implement comprehensive error handling
- Add more advanced game physics
- Develop comprehensive testing suite
- Implement production deployment scripts
- Add friend system and private games
- Implement tournaments and special events
This project is licensed under the MIT License - see the LICENSE file for details.
- Initial development by [Your Name]
- Inspired by the classic Jenga game
- Built with modern web technologies