An intelligent whiteboard application powered by AI that provides real-time assistance, OCR, voice interaction, and automated help detection for students and learners.
- Interactive whiteboard using TLDraw
- AI-powered assistance with three modes: Feedback, Suggest, and Answer
- Optical Character Recognition (OCR) for handwritten and typed text
- Voice assistant with real-time workspace analysis
- Automatic help detection when you're stuck
- Persistent whiteboard storage with Supabase
- Frontend: Next.js 16, React 19, TypeScript
- UI: TLDraw, Radix UI, Tailwind CSS
- AI Services:
- OpenRouter API (GPT-4.1-mini, Gemini models)
- Mistral API (Pixtral for OCR)
- OpenAI Realtime API (Voice assistant)
- Database: Supabase
- Image Processing: Sharp
Before you begin, make sure you have:
- Node.js 20 or higher
- npm, yarn, pnpm, or bun package manager
- API keys for the following services:
npm install
# or
yarn install
# or
pnpm install
# or
bun installCopy the .env.example file to .env.local:
cp .env.example .env.localThen edit .env.local and fill in your API keys:
# Required API Keys
OPENROUTER_API_KEY=your_openrouter_api_key_here
MISTRAL_API_KEY=your_mistral_api_key_here
OPENAI_API_KEY=your_openai_api_key_here
# Required Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key-
OpenRouter API Key:
- Sign up at https://openrouter.ai
- Go to https://openrouter.ai/keys
- Create a new API key
-
Mistral API Key:
- Sign up at https://console.mistral.ai
- Navigate to API Keys section
- Generate a new API key
-
OpenAI API Key:
- Sign up at https://platform.openai.com
- Go to https://platform.openai.com/api-keys
- Create a new secret key
-
Supabase Configuration:
- Create a new project at https://supabase.com
- Go to Project Settings > API
- Copy the Project URL and anon/public key
- Create a
whiteboardstable with the following schema:create table whiteboards ( id uuid primary key default uuid_generate_v4(), title text not null, created_at timestamp with time zone default now(), updated_at timestamp with time zone default now(), preview text, data jsonb );
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the application.
You can customize the AI models and other settings in .env.local:
# Optional: AI Model Configuration
OPENROUTER_HELP_CHECK_MODEL=openai/gpt-4.1-mini
OPENROUTER_IMAGE_GEN_MODEL=google/gemini-3-pro-image-preview
OPENROUTER_VOICE_ANALYSIS_MODEL=google/gemini-2.5-flash
MISTRAL_OCR_MODEL=pixtral-12b-2409
OPENAI_REALTIME_MODEL=gpt-realtime
# Optional: Other Settings
MISTRAL_OCR_MAX_TOKENS=1000
CANVAS_ACTIVITY_DEBOUNCE_MS=3000
LOG_LEVEL=info
NEXT_PUBLIC_SITE_URL=http://localhost:3000- Create a Whiteboard: Click "New Whiteboard" on the dashboard
- Draw and Write: Use the drawing tools to work on problems
- Get AI Help:
- The app automatically detects when you might need help
- Choose from three help modes:
- Feedback: Visual annotations and highlights
- Suggest: Hints without giving away the answer
- Answer: Complete solution
- Voice Assistant: Click the microphone icon to activate voice interaction
- OCR: The app automatically extracts text from your drawings
npm run dev- Start development server with pretty logsnpm run dev:raw- Start development server with raw logsnpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
madhacks/
├── src/
│ ├── app/
│ │ ├── api/ # API routes
│ │ │ ├── check-help-needed/
│ │ │ ├── generate-solution/
│ │ │ ├── ocr/
│ │ │ └── voice/
│ │ ├── board/[id]/ # Whiteboard page
│ │ ├── layout.tsx
│ │ └── page.tsx # Dashboard
│ ├── components/ # UI components
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utilities
│ └── utils/ # Helper functions
├── public/ # Static assets
└── package.json
- API Key Errors: Make sure all required API keys are set in
.env.local - Supabase Connection: Verify your Supabase URL and anon key are correct
- Build Errors: Try deleting
node_modulesand.next, then reinstall dependencies - Voice Not Working: Ensure you have a valid OpenAI API key with Realtime API access
Contributions are welcome! Feel free to open issues or submit pull requests.
This project is open source and available under the MIT License.