Toy Store Backend

This directory contains the backend code for the Toy Store website.

Structure

  • index.ts - Main entry point and API routes using Hono framework
  • database/ - Database setup, migrations, and queries

API Endpoints

  • GET /api/categories - Get all product categories
  • GET /api/products - Get products with optional filtering
    • Query params: featured, category, limit, search
  • GET /api/products/:slug - Get a single product by slug
  • GET /api/featured - Get featured products

Page Routes

  • GET / - Homepage
  • GET /product/:slug - Product detail page
  • GET /category/:slug - Category page with products
  • GET /cart - Shopping cart page
  • GET /contact - Contact page

Static File Serving

The backend serves static files from the /frontend and /shared directories.