App
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v11View latest version
A full-featured online shopping platform with integrated customer support chat.
- Product catalog with categories
- Shopping cart functionality
- Checkout process
- Order management
- Product search and filtering
- Real-time customer support chat
- Chat history
- Multiple chat rooms/conversations
- Admin chat interface
├── backend/
│ ├── database/
│ │ ├── migrations.ts # Database schema setup
│ │ └── queries.ts # Database query functions
│ ├── routes/
│ │ ├── products.ts # Product API endpoints
│ │ ├── cart.ts # Shopping cart endpoints
│ │ ├── orders.ts # Order management
│ │ ├── chat.ts # Chat API endpoints
│ │ └── static.ts # Static file serving
│ └── index.ts # Main Hono server
├── frontend/
│ ├── components/
│ │ ├── App.tsx # Main app component
│ │ ├── ProductList.tsx # Product catalog
│ │ ├── Cart.tsx # Shopping cart
│ │ ├── Checkout.tsx # Checkout form
│ │ └── Chat.tsx # Chat interface
│ ├── index.html # Main HTML template
│ ├── index.tsx # Frontend entry point
│ └── style.css # Custom styles
└── shared/
└── types.ts # Shared TypeScript types
- Backend: Hono (TypeScript API framework)
- Frontend: React with TypeScript
- Database: SQLite
- Styling: TailwindCSS
- Real-time: Server-Sent Events for chat
The app will be available at the HTTP endpoint once deployed. The backend serves both the API and the frontend files.
GET /api/products- Get all productsGET /api/products/:id- Get product by IDGET /api/products/category/:category- Get products by category
GET /api/cart/:sessionId- Get cart contentsPOST /api/cart/:sessionId/add- Add item to cartPUT /api/cart/:sessionId/update- Update cart itemDELETE /api/cart/:sessionId/remove/:productId- Remove item from cart
POST /api/orders- Create new orderGET /api/orders/:id- Get order details
GET /api/chat/messages/:roomId- Get chat messagesPOST /api/chat/messages- Send chat messageGET /api/chat/stream/:roomId- SSE stream for real-time messages