Welcome to Pixelverse, a dynamic 2D metaverse platform that brings people together through real-time communication, interactive spaces, and immersive virtual experiences. Whether you're chatting globally, engaging in private conversations, or connecting via video calls, Pixelverse offers a seamless and secure environment for multiplayer interaction. Built with a Turborepo monorepo structure, it integrates an HTTP server, WebSocket server, frontend client, and database.
vid.1.mp4
- Register and log in securely to access the platform.
- Choose a custom avatar to represent yourself in the metaverse.
- Create your own virtual space with a unique Space ID.
- Share the Space ID with others so they can join your space.
- Join existing spaces by entering a valid Space ID.
- Move your avatar freely in a shared 2D environment using arrow keys.
- See other users' movements in real time, powered by WebSockets.
- Chat with everyone in the space through a shared group chat.
- Send private messages to users within 2 pixels of your avatar.
- Encourages natural, location-based conversations.
- Block unwanted users in private chats to stop communication from them.
- Start a proximity-based video call with another user when your avatars are close.
- Enjoy real-time video and audio powered by WebRTC for smooth peer-to-peer connections.
- Perfect for one-on-one interactions within the space.
- A bad words filter detects offensive language in chats.
- Warning System:
- First and second offenses trigger a warning message.
- Third offense results in automatic removal from the space.
- Banning Mechanism:
- Banned users can’t rejoin unless the space creator unbans them.
- Monorepo: Turborepo
- Frontend: React, Tailwind CSS
- Backend:
- HTTP Server: Express, Zod (for validation)
- WebSocket Server: WS
- Database: MongoDB
- Authentication: JWT (JSON Web Tokens)
- Video Chat: WebRTC
Pixelverse/
├── apps/
│ ├── http/ # HTTP server for authentication and space management
│ ├── ws/ # WebSocket server for real-time movement, chat, and video
│ └── frontend/ # Client-side UI built with React
├── packages/
│ └── db/ # Database models and setup
├── .gitignore
├── package.json
├── turbo.json
└── README.md
- Register and Log In: Sign up, log in, and pick an avatar to get started.
- Create or Join a Space: Create a new space or join one using a Space ID.
- Move Around: Use arrow keys (↑↓←→) to navigate your avatar in the 2D world.
- Chat Globally: Send messages to everyone in the space via the global chat.
- Chat Privately: When near another user (within 2 pixels), send a private message.
- Start a Video Call: When close to another user, initiate a video call for face-to-face interaction.
- Block Users: Block someone to stop private chats with them.
- Stay Respectful: Avoid offensive language—three strikes, and you’re out of the space!
-
Clone the Repository:
git clone https://github.com/xKrishnaSaxena/Pixelverse.git
-
Setup Environment Variables
- Create a
.envfile in the root directory of the project. - Add the following variables:
MONGODB_URI: Your MongoDB URI.JWT_SECRET: A secret key for JWT authentication.PORT: The port number for the HTTP server.
- Create a
-
Install Dependencies:
cd Pixelverse npm install -
Run the Application:
npm run dev
-
Access Pixelverse:
- Open your browser and go to
http://localhost:5173.
- Open your browser and go to
Pixelverse is your gateway to a fun, interactive 2D metaverse. Explore, chat, and connect with others in real time—jump in and enjoy!