This is a real-time collaborative whiteboard application built with Next.js and TypeScript. It provides a feature-rich canvas for users to draw, sketch, and collaborate on ideas using various tools and shapes. The application uses rough.js
to give the drawings a hand-drawn, sketchy appearance.
- 🎨 Multiple Drawing Tools: Includes a variety of tools like Pen, Rectangle, Ellipse, Line, Arrow, Diamond, and Text.
- 👆 Selection & Transformation: A selection tool to move and resize single or multiple objects on the canvas.
- 🧼 Eraser: Easily erase parts of the drawing.
- 🖐️ Pan & Zoom: Navigate the infinite canvas with pan and zoom functionalities.
- ↩️ Undo/Redo: A complete history stack for undoing and redoing actions.
- ⚙️ Customizable Properties:
- Shapes: Adjust stroke color, background color, stroke width, style (solid, dashed, dotted), and roughness.
- Text: Customize font family, size, and alignment.
- 🌓 Dark/Light Mode: A theme toggle for user preference.
- Framework: Next.js
- Language: TypeScript
- Styling: Tailwind CSS
- Drawing Library: Rough.js
- Database ORM: Prisma
- Database: PostgreSQL
- UI Components: shadcn/ui
Follow these instructions to get a copy of the project up and running on your local machine for development and testing purposes.
- Node.js (version 18 or higher recommended)
- Bun (or your preferred package manager like npm/yarn)
- Docker (for running the local database)
-
Clone the repository:
git clone [https://github.com/your-username/draw_app.git](https://github.com/your-username/draw_app.git) cd draw_app
-
Install dependencies:
bun install
-
Set up environment variables: Create a
.env
file in the root of the project by copying the example file:cp .env.example .env
The
DATABASE_URL
is already configured for the local Docker setup. -
Start the local database: Run the provided script to start a PostgreSQL container using Docker.
./start-database.sh
-
Push the database schema: Apply the database schema to your local database using Prisma.
bunx prisma db push
-
Run the development server:
bun run dev
Open http://localhost:3000 with your browser to see the result.