Welcome, future agents! This document outlines the roles and best practices for developing Void Draw.
- Focus: Aesthetic consistency, responsiveness, and interaction design.
- Tools: TailwindCSS (v4), Framer Motion, Phosphor Icons.
- Mandates:
- Maintain the "dark/glassmorphism" aesthetic.
- Ensure all new components are mobile-friendly.
- Use
framer-motionfor meaningful transitions.
- Focus: Backend schema, secure mutations, and frontend state management.
- Tools: Convex, idb-keyval, React 19.
- Mandates:
- Storage Strategy: Adhere to the hybrid storage model. Local-only for unauthenticated users, cloud-sync for authenticated users.
- Security: Always use
getAuthUserId(ctx)in Convex mutations. Throw explicit "Unauthorized" errors. - Performance: Use optimistic updates or local state for immediate feedback on the canvas.
- Focus: Low-level rendering, shape utilities, and export logic.
- Tools: HTML5 Canvas API, jsPDF.
- Mandates:
- Keep
Canvas.tsxas optimized as possible. Avoid unnecessary re-renders. - Ensure
shapeUtils.tsremains the single source of truth for rendering and hit-testing logic.
- Keep
- Code Style: TypeScript (strict), functional components, custom hooks for logic separation.
- Testing: Verify both local and cloud storage paths. Check auth boundaries rigorously.
- Documentation: Update
DESIGN.mdwhen introducing major architectural changes.