this is demo version of this project : https://drwsync-j3icnfbjx-snk-git-hubs-projects.vercel.app/
A collaborative whiteboard which have a websocket that syncs in real-time, also which has AI integrated features, like it will help to get AI assistance in your planning, or if you're solving DSA math or any logical or architecture planning, it will help or assist you by just selecting the portion with an AI lens tool with in canvas. Some of the benefits are that you don't need to take screenshots/snapshots and put them in an AI. You can get help within the Canvas itself, and it saves your time, and it also helps students or kids to ask doubts in maths or their homework. Also, it helps to solve math problems. Just check out the video below to understand how to use : )
- Add bcrypt integration
- Validate token on frontend
- Use cookies for authentication/session management
- Add more shapes
- Improve chat schema
- Integrate RAG (Retrieval-Augmented Generation) for AI features
- Frontend: Next.js
- Backend: Node.js ,Flask
- Real-time: WebSocket
- Monorepo: Turborepo
Before setting up the project, ensure you have the following installed:
- Node.js (version 16 or higher)
- pnpm (package manager)
- Python (for Flask backend)
- Git
git clone https://github.com/snk-git-hub/Drw.git
cd DrwSince this is a monorepo using pnpm workspaces, install all dependencies from the root:
pnpm installCreate environment files for different services:
NEXT_PUBLIC_API_URL=http://localhost:3001
NEXT_PUBLIC_WEBSOCKET_URL=ws://localhost:8080PORT=3001
WEBSOCKET_PORT=8080
JWT_SECRET=your_jwt_secret_key_here
DATABASE_URL=your_database_connection_stringIf your project uses a database, set up the database and run any necessary migrations. Check the backend directory for specific database setup instructions.
From the root directory:
# Start all services
pnpm dev
# Or start specific apps
pnpm dev --filter=web
pnpm dev --filter=backendStart the Backend (Node.js):
cd apps/backend # or wherever your backend is located
pnpm dev
# or
npm run devStart the Flask Backend (if separate):
cd apps/flask-backend # adjust path as needed
python app.py
# or
flask runStart the Frontend:
cd apps/web # or main frontend directory
pnpm dev
# or
npm run devStart WebSocket Server:
cd apps/websocket # adjust path as needed
pnpm start
# or
node server.jsIf you prefer using Docker:
# Build and run with Docker Compose
docker-compose up --build
# Or build individual containers
docker build -t drw-app .
docker run -p 3000:3000 -p 3001:3001 -p 8080:8080 drw-appOnce all servers are running:
- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
- WebSocket: ws://localhost:8080
Drw/
├── apps/
│ ├── web/ # Next.js frontend
│ ├── backend/ # Node.js backend
│ └── flask/ # Flask AI services (if applicable)
├── packages/ # Shared packages
├── docker/ # Docker configuration
└── .vscode/ # VS Code settings
# Install new dependency
pnpm add <package-name> --filter=<app-name>
# Run linting
pnpm lint
# Run tests
pnpm test
# Build for production
pnpm build
# Clean node_modules and reinstall
pnpm clean && pnpm install- Real-time Collaboration: Open multiple browser tabs to test WebSocket synchronization
- AI Integration: Test the AI lens tool by selecting portions of the canvas
- Authentication: Test user registration and login (once bcrypt integration is complete)
- Drawing Tools: Test various shapes and drawing tools
- Chat Functionality: Test the chat feature within the canvas
- Port conflicts: Ensure ports 3000, 3001, and 8080 are available
- pnpm not found: Install pnpm globally with
npm install -g pnpm - WebSocket connection failed: Check if the WebSocket server is running on the correct port
- Environment variables: Ensure all required environment variables are set
Run with debug logs to troubleshoot issues:
DEBUG=* pnpm devWhen making changes:
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
