draw.wine is a real-time collaborative whiteboard built with React, TypeScript, Express, and Socket.IO. It supports multiplayer drawing sessions, live cursor sync, room invitations, AI-assisted drawing generation, and shared room state.
- Real-time collaboration with room-based sessions and live cursor sync
- Drawing tools for select, pencil, text, image, rectangle, circle, diamond, line, arrow, eraser, and laser pointer
- Custom stroke styles with adjustable width and curated colors
- Export and import support for PNG, JPG, SVG, JSON, and Mermaid diagrams
- Save and restore drawings from project files or imported JSON
- Undo and redo history with up to 50 steps
- Invite collaborators by email via backend API
- Gemini-powered AI drawing generation (
vectorandrastermodes) - Installable PWA frontend for desktop and mobile use
.
├── be/ # Express + Socket.IO backend
├── fe/ # React + Vite frontend
├── docs/ # Product and architecture notes
└── Makefile
- REST API (OpenAPI / Swagger): served by the backend at
/apiwhen the backend is running. In development the Swagger UI is available athttp://localhost:3000/api(adjust the port if you use a differentPORT). The OpenAPI spec is generated from JSDoc annotations inbe/srcviaswagger-jsdoc. - WebSocket / Realtime events (AsyncAPI): the AsyncAPI JSON spec is available at
/asyncapi.jsonand an AsyncAPI web UI is served at/ws. In development you can visithttp://localhost:3000/wsto view the WebSocket event documentation and examples. The source spec lives atbe/src/asyncapi.json.
These docs make it easy to explore the backend's REST endpoints and the realtime socket messages supported by draw.wine.
- Node.js 18+
- npm 9+
- Clone the repository.
git clone https://github.com/pandarudra/draw.wine.git
cd draw.wine- Install dependencies (recommended).
make installAlternative manual install:
cd be && npm install
cd ../fe && npm install- Create backend environment file:
be/.env
PORT=3000
NODE_ENV=development
FE_URL_DEV=http://localhost:5173
FE_URL_PROD=https://your-frontend-domain.com
# Optional: enable real email sending in production mode
RESEND_API_KEY=
RESEND_FROM_EMAIL=Draw Wine <onboarding@resend.dev>
# Required for AI generation endpoints
GEMINI_API_KEY=your_google_gemini_api_key_here- Optional frontend environment file:
fe/.env
# If omitted, frontend uses http://localhost:3000 in development
VITE_ENV=prod
VITE_BE_URL=https://your-backend-domain.com- Start both apps.
make devAlternative manual start:
# Terminal 1
cd be
npm run dev
# Terminal 2
cd fe
npm run dev- Open the app:
- Frontend: http://localhost:5173
make install # install frontend + backend dependencies
make dev # run frontend and backend together
make build # build frontend and backend
make lint # lint frontend
make typecheck # typecheck frontend and backend
make check # lint + typechecknpm run dev # nodemon + ts-node (src/app.ts)
npm run build # compile TypeScript to dist/
npm run start # run dist/app.jsnpm run dev
npm run build
npm run preview
npm run lintPOST /api/rooms/send-invitations: send invitation emailsPOST /api/ai/generate: generate drawing layout from promptPOST /api/ai/chat: chat endpoint for AI assistant features
Note: there is currently no /health endpoint in the backend.
- Room lifecycle: join and leave room
- Presence: collaborators and cursor updates
- Canvas sync: drawing element operations and laser pointer activity
/: landing page/board/:id: drawing board/collab: collaborative room view
- Backend CORS allow-list is composed from
FE_URL_DEVandFE_URL_PROD. - Frontend API base URL defaults to
http://localhost:3000unlessVITE_ENV=prod. - Invitation emails are simulated in development mode and sent with Resend in production mode when configured.
- On small screens (
<768px), the app currently renders a mobile fallback screen instead of the full board UI.
Detailed notes are available in docs/:
architecture.mdcanvas-interactions.mdcollaboration.mddrawing-tools.mdexport-import.mdpwa.mdstate-management.md
This repository provides a machine-readable context map for use with LLM tools (for example, Aider).
- Generate the repo context map (requires
aider):
make create-map- View LLM workflow help:
make llm-help-
The generated file
repo-context.txtcontains a structured summary of the project (folders, key files, APIs, and workflows) and is intended to be attached to LLM prompts or passed to tools likeaiderwith--llm-context. -
Note:
.aiderignoreis now allowed in the repository (see.gitignore). To add your local.aiderignoreto the repo:
git add .aiderignore
git commit -m "Add .aiderignore"
git push- Frontend: React 19, TypeScript, Vite, Tailwind CSS 4, Radix UI, Rough.js, Socket.IO client
- Backend: Express 5, Socket.IO, TypeScript, Helmet, CORS, compression, express-rate-limit, Resend, Google Generative AI SDK
The diagrams below show the high-level structure and flow of draw.wine.
In short, the frontend handles drawing and collaboration UI, the backend manages rooms, permissions, and AI requests, and Redis keeps shared session state reliable across users.
- Create a feature branch.
- Make and test your changes.
- Open a pull request with a clear description.
ISC

