A comprehensive web application featuring three major components:
- Canvas-Based Sticker Designer - Create custom circular stickers with images, text, and layers
- Customer Care Chat Widget - Real-time chat support widget
- Custom Invoice Generator - Dynamic invoice creation with PDF export
- Framework: Next.js 14+ (App Router)
- Language: TypeScript
- Canvas Library: Fabric.js
- Real-time: Socket.io
- PDF Generation: jsPDF + html2canvas
- State Management: Zustand
- Styling: CSS Modules + Tailwind CSS (optional)
- Image upload (drag-and-drop, file browser)
- Circular canvas workspace
- Image manipulation (resize, rotate, position, crop)
- Layer management
- Text addition with fonts and colors
- Undo/Redo functionality
- Zoom controls
- Design templates
- Export as PNG/PDF
- Submission flow with cart
- Real-time messaging
- File attachments
- Typing indicators
- Read receipts
- Chat history persistence
- Pre-chat form
- Admin panel (bonus)
- Dynamic invoice layout
- Company header with logo
- Itemized list with images
- Automatic calculations
- Multiple templates
- PDF download
- Print functionality
- Node.js 18+
- npm or yarn
- Install dependencies:
npm install- Run the development server:
npm run dev- Open http://localhost:3000 in your browser
Create a .env.local file (optional):
NEXT_PUBLIC_SOCKET_URL=http://localhost:3001
Note: The chat widget currently uses simulated responses. For full real-time functionality, you would need to set up a Socket.io server.
├── app/ # Next.js App Router
│ ├── (routes)/ # Route groups
│ ├── layout.tsx # Root layout
│ └── page.tsx # Home page
├── components/ # React components
│ ├── sticker-designer/ # Sticker designer components
│ ├── chat-widget/ # Chat widget components
│ └── invoice/ # Invoice generator components
├── lib/ # Utilities and helpers
├── stores/ # Zustand stores
├── types/ # TypeScript types
└── public/ # Static assets
Run tests:
npm testRun tests in watch mode:
npm run test:watch- Image Upload: Drag-and-drop or file browser upload (PNG, JPG, SVG)
- Canvas Editor: Circular workspace with Fabric.js
- Image Manipulation: Resize, rotate, position objects
- Layer Management: Bring forward, send backward
- Text Tools: Add text with custom fonts, colors, and sizes
- Undo/Redo: Full history management
- Zoom Controls: Zoom in/out for detailed editing
- Design Controls: Color picker, templates, save/export
- Export: PNG and PDF export capabilities
- Submission Flow: Quantity selector, size options, cart integration
- Real-time Interface: Floating chat button (bottom-right)
- Pre-chat Form: Collect name, email, and query type
- Message Features: Text input, file attachments, emoji support
- UX Enhancements: Typing indicators, read receipts, timestamps
- Notifications: Unread message badge
- Chat History: Persistent conversation history
- Responsive: Works on mobile, tablet, and desktop
- Dynamic Layout: Company header with logo support
- Auto-generated: Invoice numbers and dates
- Itemized List: Items with images, descriptions, quantities, prices
- Calculations: Automatic subtotal, tax, and total calculations
- Templates: Multiple invoice templates (Default, Modern)
- Export Options: PDF download, print functionality
- Email Simulation: Email invoice button (ready for integration)
- Zustand: Lightweight state management with persistence
- Local Storage: Draft saves and session persistence
- Context API: Available for component-level state
- Code Splitting: Dynamic imports for heavy components
- Lazy Loading: Components loaded on demand
- Memoization: React.memo and useMemo where appropriate
- Image Optimization: Next.js Image component ready
- Error Boundaries: Graceful error recovery
- Form Validation: Client-side validation with error messages
- Toast Notifications: User feedback system (component ready)
- Jest: Unit testing framework
- React Testing Library: Component testing utilities
- Test Coverage: Utility functions tested
- Code splitting with dynamic imports
- Lazy loading for heavy components
- Image optimization
- Memoization for expensive operations
MIT