|
| 1 | +# The Boring Paper Company - TypeScript Edition |
| 2 | + |
| 3 | +A modern TypeScript React application for a paper manufacturing company with custom watermark functionality and shopping cart features. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- 🛍️ **Product Catalog** - Browse and add paper products to cart |
| 8 | +- 💧 **Custom Watermarks** - Upload images or text to create custom watermarks |
| 9 | +- 🛒 **Shopping Cart** - Manage items with quantity controls |
| 10 | +- 🤖 **AI Chat Assistant** - Interactive chatbot with security controls |
| 11 | +- 📤 **File Upload** - Secure file scanning with backend API integration |
| 12 | +- 🎨 **Vintage Theme** - Dark, elegant design with creamy accents |
| 13 | +- ⚡ **TypeScript** - Fully typed for better development experience |
| 14 | +- 🚀 **Vite** - Fast development and optimized builds |
| 15 | + |
| 16 | +## Tech Stack |
| 17 | + |
| 18 | +- **React 18** with TypeScript |
| 19 | +- **Material-UI** (MUI) v7 for components |
| 20 | +- **React Router** for navigation |
| 21 | +- **Vite** for build tooling |
| 22 | +- **Context API** for state management |
| 23 | +- **Backend APIs** - SDK, Chat, XDR services |
| 24 | + |
| 25 | +## Getting Started |
| 26 | + |
| 27 | +### Installation |
| 28 | + |
| 29 | +\`\`\`bash |
| 30 | +npm install |
| 31 | +\`\`\` |
| 32 | + |
| 33 | +### Development |
| 34 | + |
| 35 | +\`\`\`bash |
| 36 | +npm run dev |
| 37 | +\`\`\` |
| 38 | + |
| 39 | +Runs on http://localhost:3000 |
| 40 | + |
| 41 | +### Build |
| 42 | + |
| 43 | +\`\`\`bash |
| 44 | +npm run build |
| 45 | +\`\`\` |
| 46 | + |
| 47 | +### Preview |
| 48 | + |
| 49 | +\`\`\`bash |
| 50 | +npm run preview |
| 51 | +\`\`\` |
| 52 | + |
| 53 | +## Project Structure |
| 54 | + |
| 55 | +\`\`\` |
| 56 | +bpc/ |
| 57 | +├── src/ |
| 58 | +│ ├── assets/ # Static assets (images, logos) |
| 59 | +│ ├── components/ # Reusable components |
| 60 | +│ ├── context/ # React Context providers |
| 61 | +│ ├── pages/ # Page components |
| 62 | +│ ├── theme/ # MUI theme configuration |
| 63 | +│ ├── types/ # TypeScript interfaces |
| 64 | +│ ├── App.tsx # Main app component |
| 65 | +│ └── main.tsx # Entry point |
| 66 | +├── public/ # Public assets |
| 67 | +└── package.json # Dependencies |
| 68 | +\`\`\` |
| 69 | + |
| 70 | +## Features Overview |
| 71 | + |
| 72 | +### Product Catalog |
| 73 | +- View available paper products |
| 74 | +- Add items to shopping cart |
| 75 | +- Category filtering |
| 76 | +- Stock status indicators |
| 77 | + |
| 78 | +### Custom Watermarks |
| 79 | +- Upload image files (PNG, JPEG, GIF, WebP) |
| 80 | +- Create text-based watermarks |
| 81 | +- Adjust opacity and scale |
| 82 | +- Position control (X/Y coordinates) |
| 83 | +- Live preview |
| 84 | +- Edit and delete watermarks |
| 85 | +- Optional backend file scanning via API |
| 86 | + |
| 87 | +### Shopping Cart |
| 88 | +- Add/remove items |
| 89 | +- Quantity controls |
| 90 | +- Price calculation |
| 91 | +- Order summary |
| 92 | +- Cart persistence during session |
| 93 | + |
| 94 | +### AI Chat Assistant |
| 95 | +- Interactive chatbot with AI responses |
| 96 | +- Security protection toggle |
| 97 | +- Real-time message handling |
| 98 | +- Error handling and recovery |
| 99 | + |
| 100 | +### Backend API Integration |
| 101 | +The app connects to backend services: |
| 102 | +- `/api/chat/` - AI chat service (port 5001) |
| 103 | +- `/api/sdk/` - File upload and scanning (port 5000) |
| 104 | +- `/api/xdr/` - Container XDR service (port 8081, WebSocket) |
| 105 | +- `/api/ollama/` - LLM service (port 11434) |
| 106 | + |
| 107 | +## Development Notes |
| 108 | + |
| 109 | +This is a demo/educational project showcasing: |
| 110 | +- TypeScript best practices |
| 111 | +- React Context API |
| 112 | +- Material-UI theming |
| 113 | +- File upload handling |
| 114 | +- State management |
| 115 | + |
| 116 | +Not intended for production use without additional security hardening. |
0 commit comments