A real-time collaborative pixel canvas inspired by Reddit's r/place experiment. Place pixels on a shared canvas and watch as a community artwork emerges.
- Interactive Canvas: 50x50 grid where users can place colored pixels
- Color Selection: Choose from predefined colors or use a custom color picker
- Cooldown System: 15-second cooldown between placing pixels to prevent spamming
- Real-time Updates: Canvas refreshes every 5 seconds to show other users' changes
- User Attribution: Hover over pixels to see who placed them
- User Authentication: Sign in to track your pixels and cooldown
- Frontend: Next.js 15, React 19, Tailwind CSS, Zustand for state management
- Backend: Next.js server components and server actions
- Database: MongoDB for storing canvas state and user cooldowns
- Authentication: Clerk for user management
- Clone the repository
- Install dependencies
npm install
- Set up environment variables in a
.env.localfile:MONGODB_URI=your_mongodb_connection_string NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key CLERK_SECRET_KEY=your_clerk_secret_key - Run the development server
npm run dev
- Open http://localhost:3000 in your browser
- Sign in with your account
- Select a color from the color picker
- Click on any pixel on the canvas to change its color
- Wait for the 15-second cooldown to expire before placing another pixel
- Collaborate with others to create art, pixel by pixel
- Canvas data is stored in MongoDB with two collections:
canvasfor the pixel gridusersfor cooldown tracking
- User interactions trigger server actions that update the database
- Client-side optimistically updates the UI before server confirmation
- Canvas state includes color information, timestamp, and username for each pixel
The application can be deployed on Vercel or any platform that supports Next.js:
npm run build
npm run startOr deploy directly to Vercel:
vercelContributions are welcome! Feel free to open issues or submit pull requests.
MIT