Skip to content

nitingupta95/draw-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎨 Draw App β€” Real-Time Collaborative Whiteboard

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.


πŸš€ Features

✏️ Drawing Tools

  • Rectangle, Circle, Diamond
  • Pencil
  • Arrow
  • Text
  • Image insertion
  • Eraser
  • Undo / Redo (coming soon)

⚑ Real-Time Collaboration

  • WebSocket-powered live drawing sync
  • Multi-user rooms
  • JWT-authenticated WebSocket connection
  • Cursor-based interactions (optional extension)

πŸ—„οΈ Reliable Persistence

  • All drawing operations are saved in PostgreSQL
  • Prisma-backed ORM
  • Efficient loading of existing shapes on room join

🧩 Modular Architecture

  • Turborepo-based monorepo
  • Shared backend utilities
  • Clean separation of concerns

🌐 Live Architecture Overview

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)]
Loading

πŸ—οΈ Project Structure

.
β”œβ”€β”€ 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

🐳 Docker Setup (Production-Ready)

1️⃣ Start PostgreSQL first

cd packages/db
docker compose up -d

Run Prisma migration:

pnpm prisma db push

2️⃣ Start full stack

cd ../../
docker compose up --build

Services:

Service URL
Frontend http://localhost:8000
HTTP Backend http://localhost:4000
WS Backend ws://localhost:8088

πŸ’¬ WebSocket Message Examples

Join Room

{
  "type": "join_room",
  "roomId": "abc-123"
}

Send Shape Event

{
  "type": "chat",
  "roomId": "abc-123",
  "message": "{"shape": {...}}"
}

πŸ“¦ Tech Stack

Frontend

  • Next.js 15
  • React 19
  • Tailwind CSS
  • Canvas API
  • Framer Motion

Backend

  • Express.js
  • WS WebSocket Server
  • Prisma ORM
  • PostgreSQL

DevOps

  • Docker
  • Turborepo
  • pnpm workspaces
  • Vercel ready (optional)

🀝 Contributing

  1. Fork the repo
  2. Create your feature branch
  3. Write clean commits
  4. Open a PR πŸ˜„

πŸ“„ License

Licensed under the MIT License.


πŸ“Ž Screenshots

UI Overview

Image Image Image Image Image Image

⭐ Support the Project

If you like this project, star the repo β€” it helps a lot πŸ™Œ

About

Screen recording of Draw-App

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published