Project Deep Dive - hokumcangus/taste-of-aloha GitHub Wiki

This document serves as the technical source of truth for the Taste of Aloha architecture, database design, and API surface.

๐Ÿ›  System Architecture

The project is built as a Full-Stack Monorepo using npm workspaces.

Data Flow

Information moves through the system in a unidirectional flow to ensure state consistency: Prisma Schema โ†’ Database Seed โ†’ Express API Routes โ†’ Frontend Hooks/Services

๐Ÿ—„ Database & Persistence

We use PostgreSQL managed by the Prisma ORM.

The Menu Model

To simplify queries and reduce redundant code, we consolidated the original "Snacks" and "Menu" models into a single MenuItem table.

  • Key Field: category (Used to filter items like 'Snacks', 'Main', or 'Drinks').
  • Location: apps/backend/prisma/schema.prisma

๐Ÿ”Œ API Reference

The backend exposes the following RESTful endpoints:

Method Endpoint Description
GET /health Server status check
GET /api/menu Fetch all menu items (supports category filter)
POST /api/menu Create a new menu item
GET /api/menu/:id Fetch specific item details
PUT /api/menu/:id Update item pricing or availability
DELETE /api/menu/:id Remove item from database

๐Ÿงช Testing & Quality

We maintain a strict testing philosophy to ensure the shopping cart logic remains bug-free.

  • Tools: Jest (Backend) & Vitest (Frontend).
  • Target: 80%+ coverage on core business logic.
  • Command: npm run test:coverage (from root).