A real-time, browser-based multiplayer mini-game platform.
Create a room, share the code with friends, and compete in a variety of fast-paced, exciting game modes!
- ๐ฎ Game Modes
- โจ Features
- ๐ ๏ธ Tech Stack
- ๐ Getting Started
- ๐ Available Scripts
- ๐ Monorepo Structure
Pixel Arena features a collection of unique games, each with its own objective and rules.
| Game Mode | Icon | Description |
|---|---|---|
| Tag | ๐โโ๏ธ | The classic playground game. Avoid being 'It' to score points. |
| Territory Control | ๐จ | Claim as much of the grid as possible with your color before time runs out. |
| Maze Race | ๐บ๏ธ | Be the first player to navigate a procedurally generated maze and reach the exit. |
| Hide and Seek | ๐ป | One Seeker hunts Hiders in a maze. Caught Hiders join the Seekers. Survive to win! |
| Heist Panic | ๐ฐ | Find the correct code pad to escape the vault. A wrong guess will stun you! |
| Infection Arena | ๐ฆ | One player is the 'Virus'. Evade infection or spread it. Last survivor wins! |
| Trap Rush | ๐ฃ | Race to the finish line across a field of hidden, debilitating traps. |
- โก๏ธ Real-time Multiplayer: Powered by Socket.IO for instant, low-latency action.
- ๐ช Dynamic Room System: Create private rooms with a unique code or join public rooms from the lobby.
- ๐น๏ธ Diverse Game Modes: A selection of games with unique mechanics, from racing to evasion.
- ๐ฑ Responsive & Mobile-First: Play seamlessly on both desktop and mobile devices with a virtual joystick and fullscreen support.
- ๐ Live Emoji Reactions: Send emojis that burst across everyone's screen in real-time.
- โจ Dynamic Theming: Choose from multiple color themes to customize your experience.
- ๐พ Persistent Username: Your name is saved in local storage for quick re-entry.
The project is a monorepo containing the React client and the Node.js server.
๐ Frontend (client/)
โ๏ธ Backend (server/)
โ๏ธ Deployment & Build
Follow these instructions to set up and run the project locally.
git clone https://github.com/ahad324/Pixel-Arena.git
cd Pixel-ArenaThe server runs on port 3000 by default.
# Navigate to the server directory
cd server
# Install dependencies
npm install
# Create an environment file from the example
# (No changes are needed for default local setup)
cp .env.example .env
# Start the development server
npm run devThe backend server will now be running at
http://localhost:3000.
In a new terminal window, set up the client. The client runs on port 5173 by default.
# Navigate to the client directory from the root
cd client
# Install dependencies
npm install
# Create an environment file from the example
# (No changes are needed for default local setup)
cp .env.example .env
# Start the development server
npm run devYou can now access the application at
http://localhost:5173.
Each package (client and server) has its own set of scripts. Run these commands from within their respective directories.
npm run dev: Starts the server in development mode with hot-reloading usingts-node-dev.npm run build: Compiles the TypeScript code to JavaScript in the/distdirectory.npm run start: Starts the compiled server from the/distdirectory.
npm run dev: Starts the Vite development server.npm run build: Builds the application for production.npm run preview: Serves the production build locally for testing.npm run lint: Lints the codebase using ESLint.
This project is organized as a monorepo with two primary packages:
pixel-arena/
โโโ client/ # Contains the React frontend application
โโโ server/ # Contains the Node.js backend server
client/: A React application built with Vite that handles the user interface, game rendering, and communication with the server. See the Client README for more details.server/: A Node.js and Express application that manages game logic, player state, and real-time communication via WebSockets. See the Server README for more details.
This project was built to demonstrate full-stack real-time application development. Feel free to fork, contribute, or get inspired!