Project notes
Behind the build
ConnectDraw — Real-Time Collaborative Drawing & Chat
Overview
ConnectDraw is a browser-based real-time collaborative drawing and chat application that allows users to connect through private rooms and work together on a shared canvas.
Users can create or join private rooms using unique connection codes, exchange messages, see other participants' online presence, and collaborate through real-time drawing interactions.
Built with React, TypeScript, Node.js, Express, MongoDB, and Socket.IO, the application uses a shared client-server architecture for real-time communication and synchronized collaboration.
ConnectDraw is also designed as a Progressive Web App (PWA), supporting installation, a web app manifest, service-worker caching, and an offline application shell.
Key Features
Authentication & User Accounts
- User registration and login.
- JWT-based authentication.
- Access-token and refresh-token workflow.
- Token refresh and logout.
- User profile retrieval and updates.
- Protected application routes.
Private Collaboration Rooms
- Private room creation and management.
- Unique connection codes.
- Room connection requests.
- Accept, decline, and cancel connection requests.
- Room listing and disconnection.
- Private collaboration between connected participants.
Real-Time Collaborative Drawing
- Shared drawing canvas.
- Real-time drawing synchronization.
- Collaborative canvas interactions.
- Coordinate-related canvas tests.
- Socket.IO-powered real-time communication.
Real-Time Chat & Presence
- Room-based messaging.
- Live participant presence updates.
- Typing indicators.
- Real-time communication between room participants.
Progressive Web App
- Installable web application.
- Web app manifest.
- Root-scoped service worker.
- Offline fallback page.
- App-shell and static asset caching.
- Browser installation prompts.
- PWA icons and installation controls.
- Dedicated PWA documentation and acceptance tests.
Responsive Client Interface
- React and Vite frontend.
- Tailwind CSS styling.
- Zustand for client session state.
- React Query for server-state management.
- Axios-based HTTP client.
- Reusable UI components.
Technical Architecture
ConnectDraw follows a monorepo architecture with separate client and server workspaces and a shared TypeScript package.
| Layer | Technologies |
|---|---|
| Frontend | React 18, Vite 6, TypeScript |
| Styling | Tailwind CSS |
| Client State | Zustand |
| Server State | React Query |
| HTTP Client | Axios |
| Backend | Node.js, Express.js |
| Real-Time Communication | Socket.IO |
| Database | MongoDB, Mongoose |
| Authentication | JWT |
| Shared Contracts | TypeScript shared-types package |
| Security | Helmet, rate limiting |
| Deployment | Docker, Docker Compose |
| PWA | Web App Manifest, Service Worker |
Monorepo Structure
The application is organized into three primary workspaces.
Client — apps/client
The React and Vite frontend contains:
- Shared drawing canvas and coordinate tests.
- Chat and collaboration interface.
- Reusable UI components.
- PWA installation controls and assets.
- Axios HTTP services.
- Zustand-based session state.
Server — apps/server
The Express and Socket.IO backend handles:
- HTTP API endpoints.
- Authentication middleware.
- MongoDB models and persistence.
- Room and collaboration operations.
- Real-time Socket.IO events.
- Security and request handling.
Shared Types — packages/shared-types
A dedicated TypeScript package provides shared type definitions consumed by both the frontend and backend.
This helps maintain consistent data contracts across the client-server boundary.
Real-Time Communication
Socket.IO powers the application's collaborative features.
The server manages real-time collaboration events, while the React client receives updates and maintains the corresponding interface state.
The real-time system supports:
- Shared drawing interactions.
- Room-based messaging.
- Participant presence.
- Typing indicators.
- Room connection workflows.
The HTTP API handles regular application requests, while Socket.IO handles real-time communication.
PWA & Offline Architecture
ConnectDraw is designed to work as an installable Progressive Web App.
Its PWA implementation includes:
- Web app manifest.
- Root-scoped service worker.
- Offline fallback page.
- Application icons.
- Install prompts.
- Static application-shell caching.
The service worker intentionally caches the application shell and static assets rather than authenticated API data or Socket.IO traffic.
Offline limitation: Authentication, room data, drawing, and chat still require an active network connection. Offline authentication, local room persistence, and queued write replay are not implemented.
Security Implementation
The backend incorporates multiple security mechanisms:
- JWT-based authentication.
- Short-lived access tokens.
- Opaque hashed refresh tokens.
- Configurable secure cookie behavior.
- Helmet security headers.
- Rate limiting.
- Configurable client-origin restrictions.
- Environment-based secret management.
Production deployment is intended to run behind HTTPS.
Testing & Quality Assurance
ConnectDraw includes separate client and server test suites powered by Vitest.
Additional development tooling includes:
- TypeScript typechecking across workspaces.
- Prettier formatting.
- Shared type compilation.
- Dedicated PWA acceptance checks.
- Canvas coordinate tests.
- Testing and QA documentation.
Available commands
npm run typecheck
npm test
npm run format:check
Docker & Production Deployment
The application supports containerized deployment through Docker and Docker Compose.
The production architecture uses a single Express service to serve:
- The built React frontend.
- HTTP API endpoints.
- Socket.IO communication.
MongoDB runs alongside the application through Docker Compose, with persistent database storage using a Docker volume.
Development
npm install
npm run dev
Production build
npm run build
Docker deployment
docker compose up --build
Current Limitations
ConnectDraw is not a production-certified release. The documented unfinished areas include:
- Advanced collaborative undo and rebase.
- Drawing-log compaction.
- File attachments.
- Message read receipts.
- Push notifications.
- Full two-browser end-to-end test suite.
- Offline authentication.
- Local room persistence.
- Queued offline write replay.
These limitations are documented as part of the project's development status.
Project Details
- Project: ConnectDraw
- Type: Real-Time Collaborative Web Application
- Architecture: TypeScript Monorepo
- Frontend: React + Vite
- Backend: Express + Socket.IO
- Database: MongoDB
- PWA: Installable Web App
- License: GNU Affero General Public License v3.0 (AGPL-3.0)



