A real-time collaborative drawing canvas where multiple users can draw, erase, and interact simultaneously. Designed for lightweight usage with minimal UX for smooth collaboration!
-
Real-time collaboration: Multiple users can draw on the canvas simultaneously.
-
Canvas types:
- Private: Only accessible by the creator.
- Public: Anyone can join and draw.
- Shared: Collaborators can be allowed to join via email.
-
Drawing tools: Pen, Eraser, A Color picker
-
Canvas sizes: Create canvases of different sizes based on your needs.
-
Session management: Users can join a session via a unique link.
-
Authentication: OAuth2 + JWT
-
Persistent state: Canvas updates are synced, and cached using Redis.
-
Firebase integration: Stores user and session data.
-
Node.js (v18+ recommended)
-
Redis Install Redis locally or use a hosted instance. For local installation:
- On macOS:
brew install redis - On Ubuntu:
sudo apt install redis-server - On Windows: Download from Redis official site
- On macOS:
-
Firebase Service Account JSON (see SERVICE_ACCOUNT_CREDS below)
-
Clone the repository:
git clone <repo-url> cd CANVuS
-
Install dependencies:
npm install
-
Configure environment variables in
.env:JWT_SECRET=<your-jwt-secret> SERVICE_ACCOUNT_CREDS=/path/to/serviceAccountKey.json REDIS_URL=<your-redis-url>
-
Start the server:
node server.js
-
Open the front-end in your browser to access the canvas.
- Go to https://console.firebase.google.com/
- Create a new project.
- Add a web app and generate a Service Account JSON for Admin SDK.
- Save the JSON locally and set the path in your
.envasSERVICE_ACCOUNT_CREDS.
Path to your Firebase Service Account JSON file, which contains:
project_idprivate_keyclient_email- Other credentials required for Firebase Admin SDK access
- Log in using Google OAuth2.
- Create a new canvas: select type (private, public, or shared) and size.
- Manage your canvas in your dashboard
- For shared canvases, invite collaborators by entering their email addresses.
- Owners of shared canvases have control over session management.
- Backend: Node.js, Express
- Real-time updates: WebSockets (Socket.IO)
- Caching: Redis
- Authentication: OAuth2 + JWT
- Database: Firebase for session and canvas state
- Front-end: HTML, CSS, JS (Canvas API)
- Contributions are welcome.