LUIS BOTELHO.

Case study / MVP completed

Goomer Menu API

A complete RESTful API to manage a restaurant menu: products, promotions with schedules, and a consolidated menu endpoint with real-time active promotions.

Problem and user

Represent products, promotions and availability in a restaurant menu.

My role

Backend development and documentation of its evolution.

Delivered scope

  • Full product CRUD (name, price, category, visible)
  • Full promotion CRUD with schedules per weekday
  • GET /menu endpoint that returns only visible products plus the best currently active promotion (LEFT JOIN LATERAL)
  • Schema validation with TypeBox
  • PostgreSQL transactions when creating/updating promotions
  • Layered architecture (Routes → Controllers → Services → Repositories)
  • Prisma used only for schema and migrations; queries in raw SQL
  • Service unit tests
  • Docker Compose for the database
  • Health check

Constraints

  • Technical-challenge MVP scope.
  • No authentication or authorization in this version.
  • Local demonstration, not deployed to production.

Architecture and data flow

Fastify organizes HTTP in layers (Routes → Controllers → Services → Repositories). Prisma handles only the schema and migrations; product, promotion and menu queries are written in raw SQL on the PostgreSQL pool.

Decisions and trade-offs

I keep Prisma (schema and migrations) separate from raw SQL queries for full control and performance. The LEFT JOIN LATERAL picks the best active promotion in a single query. Manual pg transactions keep promotion and schedule creation atomic. Validation happens in two layers: TypeBox on the schema and business rules in the service (15-minute minimum window, end after start).

Tests and validation

Service unit tests for products, promotions and menu with Vitest, plus a review of public code and documentation on September 22, 2026. Running this project is outside the portfolio validation scope.

Current state

Completed MVP with full product and promotion CRUD, a /menu endpoint with real-time active promotions and service unit tests.

Known limitations

  • No authentication or authorization in this version.
  • No pagination on list endpoints.
  • Local demonstration environment (not deployed to production).

Next steps

  • Authentication
  • Pagination and filters
  • Deployment + CI

Related training

Stack

  • TypeScript
  • Fastify
  • Node.js
  • PostgreSQL 16
  • Prisma (migrations)
  • SQL puro (queries)
  • TypeBox
  • Vitest
  • Docker + Docker Compose

Repository documentation

Read the original README ↗