• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
Sydneytonye

Sydneytonye

QUEEN

Public
Like
QUEEN
Home
Code
4
backend
4
frontend
3
shared
2
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
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.
Sign up now
Code
/
backend
/
README.md
Code
/
backend
/
README.md
Search
6/2/2025
README.md

Backend - Pastry Shop API

This directory contains the server-side logic for the pastry ordering system.

Structure

  • index.ts - Main Hono application with routes and static file serving
  • routes/orders.ts - Order management API endpoints
  • database/ - Database setup and query functions

API Endpoints

Orders

  • POST /api/orders - Create a new order
  • GET /api/orders - Get all orders (for admin)
  • PATCH /api/orders/:id/status - Update order status

Pages

  • GET / - Main customer ordering page
  • GET /admin - Order management interface

Database Schema

Uses SQLite with the following table:

pastry_orders_v1 ( id INTEGER PRIMARY KEY AUTOINCREMENT, customer_name TEXT NOT NULL, customer_email TEXT NOT NULL, customer_phone TEXT NOT NULL, customer_address TEXT, pickup_time TEXT NOT NULL, special_instructions TEXT, items TEXT NOT NULL, -- JSON array of cart items total REAL NOT NULL, status TEXT DEFAULT 'pending', created_at TEXT NOT NULL )

Order Status Flow

  1. pending - Order just placed
  2. confirmed - Order confirmed by bakery
  3. ready - Order ready for pickup
  4. completed - Order picked up by customer

Error Handling

  • Input validation for all API endpoints
  • Proper HTTP status codes
  • Detailed error messages for debugging
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
Β© 2026 Val Town, Inc.