A powerful, modern real-time collaboration drawing system built using Next.js, WebSockets, Express, Prisma, and Turborepo.
Draw App allows multiple users to sketch, brainstorm, and design together instantly on a shared canvas β with persistent storage and live sync.
- Rectangle, Circle, Diamond
- Pencil
- Arrow
- Text
- Image insertion
- Eraser
- Undo / Redo (coming soon)
- WebSocket-powered live drawing sync
- Multi-user rooms
- JWT-authenticated WebSocket connection
- Cursor-based interactions (optional extension)
- All drawing operations are saved in PostgreSQL
- Prisma-backed ORM
- Efficient loading of existing shapes on room join
- Turborepo-based monorepo
- Shared backend utilities
- Clean separation of concerns
flowchart TD
A[Frontend - Next.js Canvas] -- WebSocket --> B[WS Backend - Realtime Updates]
A -- REST --> C[HTTP Backend - Prisma + Express]
B -- DB Queries --> C
C -- Prisma --> D[(PostgreSQL Database)]
.
βββ apps/
β βββ frontend/ β Next.js 15 collaborative canvas UI
β βββ http-backend/ β Express API (Prisma CRUD)
β βββ ws-backend/ β WebSocket real-time sync server
β
βββ packages/
β βββ db/ β Prisma schema + generated client
β βββ ui/ β Shared UI components
β βββ backend-common/ β Shared env + constants + JWT secret
β
βββ docker-compose.yml β Full stack container orchestration
βββ turbo.json
cd packages/db
docker compose up -dRun Prisma migration:
pnpm prisma db pushcd ../../
docker compose up --build| Service | URL |
|---|---|
| Frontend | http://localhost:8000 |
| HTTP Backend | http://localhost:4000 |
| WS Backend | ws://localhost:8088 |
{
"type": "join_room",
"roomId": "abc-123"
}{
"type": "chat",
"roomId": "abc-123",
"message": "{"shape": {...}}"
}- Next.js 15
- React 19
- Tailwind CSS
- Canvas API
- Framer Motion
- Express.js
- WS WebSocket Server
- Prisma ORM
- PostgreSQL
- Docker
- Turborepo
- pnpm workspaces
- Vercel ready (optional)
- Fork the repo
- Create your feature branch
- Write clean commits
- Open a PR π
Licensed under the MIT License.
If you like this project, star the repo β it helps a lot π