PLACE Clone - Collaborative Pixel Canvas
A simplified r/place clone built for Neocities, featuring real-time collaboration, bot detection, and community moderation tools.
๐จ What is PLACE?
PLACE is a collaborative pixel art experiment where users can place one colored pixel on a shared canvas, then wait 2 minutes before placing another. The result is a constantly evolving piece of community-created art.
Inspired by Reddit's r/place (2017, 2022, 2023), this simplified clone is designed to be hosted on Neocities with a free backend.
โจ Features
Core Features
- 256ร256 pixel canvas - Smaller than original (1000ร1000) but still fun
- 16-color palette - Original r/place colors
- 2-minute cooldown - Per-user rate limiting
- Real-time updates - WebSocket-based live sync
- Pan & zoom - Smooth canvas navigation
- Mobile support - Touch gestures for mobile devices
Advanced Features
- Bot detection - Fingerprinting + behavior analysis
- Activity feed - See recent pixel placements
- Statistics page - Track community progress
- Admin panel - Moderation tools and user management
- Log export - Download bot detection data
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Frontend โโโโโโโโโโบโ Backend โโโโโโโโโโบโ Database โ
โ (Neocities) โ HTTP/ โ (Render) โ Realtimeโ (Firebase) โ
โ - HTML/CSS/JS โ WS โ - Node.js โ โ - Free tier โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
Technology Stack:
- Frontend: Vanilla JavaScript + HTML5 Canvas
- Backend: Node.js + Express + WebSocket
- Database: Firebase Realtime Database
- Hosting: Neocities (frontend) + Render (backend)
All free tier!
๐ Quick Start
1. Firebase Setup (5 minutes)
- Create project at Firebase Console
- Enable Realtime Database (test mode)
- Copy config values (API key, database URL, project ID)
2. Render Deployment (10 minutes)
- Fork/clone this repository
- Create Render account at render.com
- Deploy backend service from
backend/folder - Set environment variables:
FIREBASE_API_KEY=... FIREBASE_DATABASE_URL=... ADMIN_PASSWORD=your_secure_password CORS_ORIGIN=https://yourusername.neocities.org
3. Neocities Upload (5 minutes)
- Update
frontend/js/api.jswith your Render URL - Upload
frontend/contents to Neocities - Visit your site and place a pixel!
Detailed instructions: See docs/SETUP.md
๐ Project Structure
place-clone/
โโโ frontend/ # Upload to Neocities
โ โโโ index.html # Main canvas page
โ โโโ admin.html # Moderation panel
โ โโโ stats.html # Public statistics
โ โโโ js/
โ โ โโโ main.js # App initialization
โ โ โโโ canvas.js # Canvas rendering
โ โ โโโ api.js # Backend communication
โ โ โโโ ui.js # UI components
โ โ โโโ fingerprint.js # Device fingerprinting
โ โ โโโ behavior-tracker.js # Bot detection
โ โโโ css/
โ โโโ styles.css # Responsive styles
โ
โโโ backend/ # Deploy to Render
โ โโโ server.js # Main server
โ โโโ routes/ # API endpoints
โ โโโ services/ # Business logic
โ โโโ middleware/ # Auth, rate limiting
โ โโโ render.yaml # Render config
โ
โโโ docs/
โโโ SETUP.md # Deployment guide
โโโ API.md # API documentation
โโโ BOT_DETECTION.md # Bot detection details
๐ฎ How to Play
- Enter username - Identify yourself (saved locally)
- Select a color - Choose from 16 colors
- Navigate canvas - Drag to pan, scroll to zoom
- Place a pixel - Click on canvas to place your pixel
- Wait 2 minutes - Cooldown timer before next pixel
- Repeat! - Watch the canvas evolve
Mobile Controls
- One-finger swipe: Pan canvas
- Two-finger pinch: Zoom in/out
- Double-tap: Toggle zoom level
๐ค Bot Detection
The system automatically detects and flags bot activity using:
Fingerprinting
- Canvas fingerprinting
- WebGL fingerprinting
- Browser attributes (user agent, platform, etc.)
Behavioral Analysis
- Mouse movement patterns
- Click-to-placement timing
- Zoom/pan interactions
- Placement rate and timing patterns
Risk Tiers
| Score | Classification | Action |
|---|---|---|
| 0-25 | Human | No action |
| 26-50 | Likely Human | Monitor |
| 51-75 | Suspicious | Flag for review |
| 76-100 | Likely Bot | Flagged + highlighted |
Privacy: All data auto-deleted after 7 days. IP addresses hashed. No personal info stored.
See docs/BOT_DETECTION.md for details.
๐ ๏ธ Admin Panel
Access at https://yourusername.neocities.org/admin.html
Features
- Dashboard - Overview of sessions, flagged users, activity
- User Management - Sort/filter by bot score, ban/unban users
- Canvas Tools - Clear pixels, fill rectangles
- Log Export - Download bot detection data as JSON
Moderation Actions
- Ban/unban sessions
- Clear individual pixels
- Fill rectangles (for cleanup)
- Export flagged user data
๐ Statistics
Public stats page at https://yourusername.neocities.org/stats.html
Displays:
- Total pixels placed (all-time + today)
- Active users (last 24 hours)
- Canvas completion percentage
- Color distribution chart
- Top 10 contributors
- Bot detection stats
Auto-refreshes every 30 seconds.
๐ง Configuration
Canvas Settings
Edit frontend/js/api.js:
const CONFIG = { CANVAS_SIZE: 256, // 256x256 pixels COOLDOWN_SECONDS: 120, // 2 minutes ACTIVITY_FEED_DESKTOP: 30, // Activity items (desktop) ACTIVITY_FEED_MOBILE: 15, // Activity items (mobile) };
Color Palette
Original r/place 16-color palette in frontend/js/main.js:
const PALETTE = [ '#FFFFFF', '#E4E4E4', '#888888', '#222222', '#FFA7D1', '#E50000', '#E59500', '#A06A42', '#E5D900', '#94E044', '#02BE01', '#00D3DD', '#0083C7', '#0000EA', '#CF6EE4', '#820080' ];
Backend Settings
Environment variables on Render:
BOT_LOG_RETENTION_DAYS=7 AUTO_CLEANUP_ENABLED=true CORS_ORIGIN=https://yourusername.neocities.org
๐งช Testing
Local Development
# Backend cd backend npm install npm start # Runs on http://localhost:3000 # Frontend cd frontend npx serve # Or open index.html directly
Production Testing
- Visit your Neocities page
- Place a pixel
- Check cooldown timer
- Verify real-time updates
- Check stats page
- Test admin panel
Bot Simulation
Test detection with:
- Script that places pixels without mouse movement
- Automated clicks with perfect timing
- No zoom/pan interactions
Check admin panel for high bot scores.
๐ Scaling & Costs
Current Setup (Free)
- Neocities: Free (1GB storage, 200GB bandwidth)
- Render: Free (sleeps after 15min inactivity)
- Firebase: Free (1GB storage, 10GB/month bandwidth)
Estimated Capacity
- Concurrent users: 50-100 (free tier)
- Pixels per day: 5,000-10,000
- Storage: ~50MB for 10,000 pixels
Upgrade Path (If Needed)
- Render Hobby: $7/month (always-on server)
- Firebase Blaze: Pay-as-you-go (more bandwidth)
- Neocities Supporter: $5/month (more storage)
๐ Security
Implemented
- Server-side rate limiting (2-min cooldown)
- Input validation (coordinates, colors)
- CORS restrictions
- Admin password authentication (bcrypt)
- Session banning capability
Privacy
- IP addresses hashed (SHA-256)
- No personal identifiers stored
- Auto-deletion after 7 days
- Transparent data collection notice
Recommendations
- Use strong admin password
- Monitor flagged sessions regularly
- Update Firebase security rules for production
- Consider CAPTCHA for high bot score users
๐ API Documentation
Full API reference in docs/API.md
Key Endpoints
GET /api/canvas - Get full canvas state
POST /api/pixel - Place a pixel
GET /api/pixel/activity - Get recent activity
GET /api/stats - Get statistics
POST /api/admin/login - Admin authentication
GET /api/admin/users - List all sessions
POST /api/admin/ban/:id - Ban a session
GET /api/admin/export-logs - Export logs
WebSocket Events
Client โ Server: subscribe, ping
Server โ Client: canvas:sync, pixel:placed, cooldown:status, error
๐ Troubleshooting
Common Issues
"Failed to fetch canvas"
- Check backend URL in
api.js - Verify Render deployment succeeded
- Check browser console for errors
"Server sleeping"
- Free Render instances sleep after 15min
- First request takes ~30s to wake up
- Consider upgrading to Render Hobby ($7/month)
"Permission denied" (Firebase)
- Check security rules are published
- Verify database URL is correct
- Ensure backend has write access
See docs/SETUP.md for more.
๐ค Contributing
This is a community project! Feel free to:
- Fork and modify for your own Neocities site
- Report bugs via GitHub Issues
- Suggest new features
- Submit pull requests
Ideas for Improvement
- Discord/Slack integration for notifications
- More color palettes
- Canvas regions (team territories)
- Mobile app (React Native / Flutter)
- Timelapse recording
- Machine learning bot detection
๐ License
MIT License - Feel free to use, modify, and deploy!
๐ Credits
Inspired by:
- Reddit's r/place (2017, 2022, 2023)
- Original source: reddit-archive/reddit-plugin-place-opensource
Built for:
- Neocities community
- Free web hosting revival
Technologies:
- Firebase Realtime Database
- Render hosting
- HTML5 Canvas API
- WebSocket protocol
๐ Support
- Documentation: Check
/docsfolder - Setup Issues: See SETUP.md
- API Questions: See API.md
- Bot Detection: See BOT_DETECTION.md
๐ฏ Roadmap
Phase 1: Core (โ Complete)
- Canvas rendering
- Pixel placement API
- Cooldown system
- Real-time updates
Phase 2: Enhanced (โ Complete)
- Bot detection
- Admin panel
- Statistics page
- Mobile support
Phase 3: Future (Planned)
- Discord webhook notifications
- Canvas timelapse
- Team/region system
- Custom color palettes
- User profiles
Have fun creating! ๐จ