A real-time collaborative whiteboard built with Next.js, WebSockets, and Prisma. This project allows multiple users to draw and interact on a shared canvas in real time, making it perfect for brainstorming, sketching, and online collaboration.
- 🎨 Real-time drawing with WebSockets
- 👥 Collaborative rooms for multiple users
- 🔐 Authentication (Sign In / Sign Up)
- 🖥 Responsive UI built with Tailwind CSS
- 💾 Database integration using Prisma and PostgreSQL
- 📂 Modular TurboRepo architecture
└── anudeep009-excalidraw-clone.git/
├── apps/
│ ├── web/ # Next.js frontend
│ └── ws-backend/ # WebSocket backend
├── packages/
│ ├── db/ # Prisma database schema
│ ├── eslint-config/ # Shared ESLint config
│ ├── typescript-config/ # Shared TypeScript config
│ └── ui/ # Reusable UI components
├── turbo.json # TurboRepo configuration
└── README.md # Project documentation
- Next.js - Server-side rendering & static site generation
- React - Component-based UI
- Tailwind CSS - Modern utility-first styling
- TypeScript - Strongly typed JavaScript
- WebSockets - Real-time collaboration
- Node.js - JavaScript runtime
- Express.js - Lightweight server framework
- WebSockets (ws) - Live communication between users
- Prisma - ORM for PostgreSQL
- PostgreSQL - Scalable relational database
- better-auth - Authentication
git clone https://github.com/0x4nud33p/sketch.git
cd sketch
pnpm install
Create a .env
file in the root directory and add the following:
# apps/web
NEXT_WS_URL=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
BETTER_AUTH_SECRET=
BETTER_AUTH_URL=
# apps/ws-backend
PORT=
# packages/db
DATABASE_URL=
pnpm db:migrate
pnpm dev:web
pnpm dev:ws
The app should now be running at http://localhost:3000
🎉
Method | Endpoint | Description |
---|---|---|
POST |
/api/auth/signin |
Log in a user |
Method | Endpoint | Description |
---|---|---|
GET |
/api/drawings |
Fetch all drawings |
POST |
/api/drawings |
Save a new drawing |
GET |
/api/rooms |
Get available rooms |
POST |
/api/rooms |
Create a new room |
- 🏷 User roles & permissions
- 🗃 Cloud storage for drawings
- 🎥 Live voice/video collaboration
Pull requests are welcome! If you'd like to contribute:
- Fork the repo
- Create a new branch (
git checkout -b feature-branch
) - Make your changes & commit (
git commit -m 'Add new feature'
) - Push to the branch (
git push origin feature-branch
) - Submit a pull request
This project is open-source and licensed under the MIT License.
🚀 Made with ❤️ by Anudeep Avula