A collaborative canvas app with Neon Auth authentication and Zero real-time database.
- Real-time Collaboration: Multiple users can work on the same canvas simultaneously
- Neon Auth Authentication: Secure user authentication and management
- Smart Cursors: See other users' cursors with their name and email
- Post-it Notes: Create, edit, and drag colorful post-it notes
- User Permissions: Only creators can edit their own notes
- Zero Database: Real-time data synchronization with Neon PostgreSQL and Zero
- Bun (recommended) or Node.js
- Neon PostgreSQL database
- Neon Auth project setup
- Clone the repository
- Install dependencies:
bun install
- Copy the environment file:
cp .env.example .env
-
Configure your environment variables in
.env
:VITE_PUBLIC_SERVER
- Your Zero server URLVITE_STACK_PROJECT_ID
- Neon Auth project IDVITE_STACK_PUBLISHABLE_CLIENT_KEY
- Neon Auth publishable key
-
Set up the database schema by running the SQL in
migration.sql
-
Add the required Zero permissions to your database by running
bunx zero-deploy-permissions --schema-path='./src/schema.ts' --output-file='/tmp/permissions_canvas.sql' && cat /tmp/permissions_canvas.sql | pbcopy
. This will copy the permissions to your clipboard, so you can paste and run them in the SQL editor or psql.
Start the development server:
bun dev
Start the Zero cache development server:
bun run dev:zero-cache
If you want to run the Zero cache development server instead of using the remote server deployed on Neon, read the guide here.
The app uses two main tables:
post_its
- Stores post-it note datauser_cursors
- Tracks real-time cursor positions
See other users' cursors in real-time with their unique color.
- Create notes by clicking the add button
- Drag and resize notes (only your own)
- Edit content by double-clicking
- Delete with the trash button
- Color coding with the toolbar
- Real-time synchronization
- User presence indicators
- Permission-based editing
- Conflict-free collaborative editing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request