Restaurant management & booking API
Dinesphere
Backend2025
The backend for a restaurant platform — reservations, menus, orders, payments, reviews and loyalty.
- 11
- API modules
- 8
- Migrations
- 3
- Roles
Problem
Restaurants and diners need one system for discovery, table booking, ordering and repeat-visit rewards — with a clear line between what admins, managers and customers are allowed to do.
Solution
A modular Express API over PostgreSQL with eleven resource modules, each following routes → controllers → models. The schema is managed with Knex and evolved through versioned migrations and seed data, and the whole API is documented with OpenAPI.
Key engineering decisions
- Versioned Knex migrations let the schema grow — loyalty, notifications, favorites and user preferences were added without rewriting the base schema.
- UUID primary keys generated in PostgreSQL with pgcrypto.
- Loyalty and redemption tables are indexed on user, reward, status and time — the columns the app actually queries.
- API documentation generated from JSDoc annotations that live next to the routes.
Features
- JWT authentication with bcrypt hashing and role-based authorization (admin, manager, customer)
- Reservations with party size, time windows and special requests
- Menus with categories, pricing, veg and spice-level flags
- Orders, order items and payments
- Loyalty program: points, tiers, rewards, redemptions and points history
- Swagger / OpenAPI docs served at /api-docs