Public
Like
canteen
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
index.ts
https://Pratham211--5274bfb83eef11f0b41a76b3cceeab13.web.val.run
A modern web-based canteen management system with QR code ordering for college canteens.
- 📱 QR code scanning for table identification
- 🍽️ Browse menu with categories and prices
- 🛒 Add items to cart with quantity selection
- 📝 Place orders with customer details
- ⏱️ Real-time order status updates
- 📊 Real-time order dashboard
- 🍕 Menu management (add/edit/delete items)
- 🪑 Table management with QR code generation
- 📈 Order status management
- 💰 Basic sales tracking
- Frontend: React 18 with TypeScript
- Backend: Hono.js API framework
- Database: SQLite for data persistence
- Styling: TailwindCSS
- QR Codes: QR code generation and scanning
- Real-time: Polling-based updates
├── backend/
│ ├── database/
│ │ ├── migrations.ts # Database schema setup
│ │ └── queries.ts # Database query functions
│ ├── routes/
│ │ ├── admin.ts # Admin panel routes
│ │ ├── menu.ts # Menu management routes
│ │ ├── orders.ts # Order management routes
│ │ └── tables.ts # Table management routes
│ └── index.ts # Main API entry point
├── frontend/
│ ├── components/
│ │ ├── Admin/ # Admin panel components
│ │ ├── Customer/ # Customer interface components
│ │ └── Shared/ # Shared UI components
│ ├── index.html # Main HTML template
│ └── index.tsx # Frontend entry point
└── shared/
└── types.ts # Shared TypeScript types
- The system will automatically set up the database on first run
- Access the admin panel at
/admin
to set up menu items and tables - Generate QR codes for tables from the admin panel
- Print and place QR codes on tables
- Customers scan QR codes to access the ordering interface
GET /api/menu
- Get all menu itemsPOST /api/menu
- Add new menu itemPUT /api/menu/:id
- Update menu itemDELETE /api/menu/:id
- Delete menu item
GET /api/orders
- Get all orders (admin)POST /api/orders
- Place new orderPUT /api/orders/:id/status
- Update order status
GET /api/tables
- Get all tablesPOST /api/tables
- Add new tableGET /api/tables/:id/qr
- Get QR code for table
- menu_items: id, name, description, price, category, available
- tables: id, number, name, qr_code, active
- orders: id, table_id, customer_name, customer_phone, items, total, status, created_at
- order_items: id, order_id, menu_item_id, quantity, price
- pending - Order placed, waiting for confirmation
- confirmed - Order confirmed by admin
- preparing - Order being prepared
- ready - Order ready for pickup
- completed - Order delivered/completed
- cancelled - Order cancelled