A simplified Agar.io clone built with React for the front-end and Node.js (with Socket.io) for the back-end. This project uses a mono-repo structure to manage both the client and server efficiently.
This is a simplified implementation of Agar.io, enabling multiple players to connect to a shared map, move around, and interact in real time. The main player is controlled via the mouse and grows by consuming food.
-
Frontend:
- React
- Socket.io-client (for real-time communication)
-
Backend:
- Node.js
- Express (HTTP server)
- Socket.io (WebSocket communication)
- Node.js (v16 or higher)
- npm (v8 or higher)
- Clone the repository:
git clone https://github.com/your-username/my-agario-clone.git
cd my-agario-clone
- Install dependencies:
Backend:
cd backend
npm install
Frontend:
cd ../frontend
npm install
npm start
The backend will run on http://localhost:3000 by default.
- Open the React application in your browser.
- Move your mouse to control the main player.
- Check the backend terminal to verify that data is being received in real time.