A real-time collaborative drawing application built for hackathons and presentations, allowing presenters to create slides with reference images and audience members to submit drawings.
The application follows a modern web architecture with:
-
Frontend: Next.js React application with TypeScript
- Client-side drawing capabilities using Fabric.js
- Real-time updates using React Query
- State management with Zustand
-
Backend: Express.js server with SQLite database
- RESTful API endpoints for slides and drawings
- SQLite for persistent storage
- CORS enabled for cross-origin requests
-
Database Schema:
slides: Stores slide information (id, title, etc.)drawings: Stores audience drawing submissionsreference_images: Stores reference images for slides
- Presenter Mode: Create and manage slides with reference images
- Audience Mode: View slides and submit drawings
- Real-time Drawing: Interactive canvas with various drawing tools
- Countdown Timer: Time-limited drawing sessions
- Drawing History: View and navigate through drawing history
- Node.js (v18 or higher)
- npm or pnpm
-
Clone the repository:
git clone <repository-url> cd hackathon-draw
-
Install frontend dependencies:
npm install # or pnpm install -
Install server dependencies:
cd server npm install
-
Start the backend server:
cd server npm run devThe server will run on http://localhost:3001
-
Start the frontend development server:
# From the root directory npm run dev # or pnpm dev
The frontend will run on http://localhost:3000
GET /api/slides/:slideId- Get a slide with its reference imagePOST /api/slides- Create or update a slidePOST /api/slides/:slideId/image- Save a reference image for a slide
GET /api/drawings/:slideId- Get all drawings for a slidePOST /api/drawings- Save a drawing submission
/src/app- Next.js app router pages/src/components- React components/src/store- Zustand state management/src/api- API client functions/src/hooks- Custom React hooks/src/utils- Utility functions
/server/src/index.js- Express server and API routes/server/src/db.js- Database connection and schema
- Navigate to the home page
- Create a new slide or select an existing one
- Upload a reference image (optional)
- Start a presentation session
- Control the countdown timer
- View and manage audience submissions
- Join a presentation using the slide ID
- View the reference image (if provided)
- Draw on the canvas during the countdown
- Submit your drawing
- View other participants' submissions
-
Frontend:
- Next.js 14
- React 18
- TypeScript
- Fabric.js
- Ant Design
- Zustand
- React Query
-
Backend:
- Express.js
- SQLite3
- Node.js
- [Your Name/Team]