This is a clone of the Excalidraw collaborative whiteboarding tool, built with modern web technologies.
- Real-time collaboration with WebSockets
- User authentication and authorization
- Create and join rooms
- Chat functionality within rooms
- Drawing tools (freehand, shapes, etc.)
- Frontend: Next.js, React, TypeScript
- Backend: Node.js, Express, WebSockets
- Database: PostgreSQL with Prisma
- Monorepo: Turborepo
- Node.js (v18 or higher)
- pnpm
- Docker
-
Clone the repository:
git clone https://github.com/AvinashK47/excalidraw.git
-
Install dependencies:
pnpm install
-
Set up environment variables. Create a
.env
file in the root of the project and add the following:DATABASE_URL="postgresql://<user>:<password>@<host>:<port>/<database>" JWT_SECRET="your-secret-key"
You will also need to create
.env
files inapps/http-backend
andapps/ws-backend
with the sameDATABASE_URL
. -
Start the development servers:
pnpm run dev
This will start the following services:
web
: Next.js frontend on port3001
http-backend
: HTTP server on port3000
ws-backend
: WebSocket server on port8000
This Turborepo includes the following packages/apps:
web
: The Next.js frontend application.http-backend
: The Express.js server for handling HTTP requests (authentication, room creation, etc.).ws-backend
: The WebSocket server for real-time communication.@repo/ui
: A shared React component library.@repo/db
: Prisma schema and client for database access.@repo/common
: Shared types and configuration.@repo/backend-common
: Shared backend utilities.@repo/eslint-config
: ESLint configurations.@repo/typescript-config
: TypeScript configurations.
Each package/app is 100% TypeScript.
This Turborepo has some additional tools already setup for you:
- TypeScript for static type checking
- ESLint for code linting
- Prettier for code formatting
To build all apps and packages, run the following command:
pnpm build
To develop all apps and packages, run the following command:
pnpm dev
cd my-turborepo
# With [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation) installed (recommended)
turbo login
# Without [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation), use your package manager
npx turbo login
yarn exec turbo login
pnpm exec turbo login
This will authenticate the Turborepo CLI with your Vercel account.
Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:
# With [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation) installed (recommended)
turbo link
# Without [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation), use your package manager
npx turbo link
yarn exec turbo link
pnpm exec turbo link
Learn more about the power of Turborepo: