Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e5dadb2
Begin Nimbus rebuild: Menu vertical proven on the platform
DanMat Aug 3, 2026
e477eef
Design: rebuild architecture + ADR-0001 (co-located restaurant plugin)
DanMat Sep 5, 2026
6675339
Design review: apply both Nimbus review-skill findings
DanMat Sep 5, 2026
c969d3b
Slice 1: restaurant plugin scaffold + Tables (the floor) (#6)
DanMat Sep 5, 2026
35fc99a
Slice 2: Orders — line items, workflow, totals, menu picker (#7)
DanMat Sep 5, 2026
c9b472d
docs: Orders + Tables done; F1/A2 closed by core ADR 0029
DanMat Sep 5, 2026
78d86db
Slice 3: Kitchen display (#8)
DanMat Sep 5, 2026
59c8430
docs: Kitchen display vertical done
DanMat Sep 5, 2026
c078452
Slice 4: Payment & turn (#9)
DanMat Sep 5, 2026
d1fe256
docs: Payment & turn vertical done
DanMat Sep 5, 2026
954987b
docs: F4 resolved in core (ADR 0030) — fine-grained plugin capabilities
DanMat Sep 6, 2026
f49c05c
Slice 5: Staff & roles (consumes F4 / ADR 0030) (#10)
DanMat Sep 6, 2026
d928db1
docs: Staff & roles vertical done (F4 consumed)
DanMat Sep 6, 2026
080a1b8
Slice 6: Reservations (CRM guest link, PII boundary honored) (#11)
DanMat Sep 6, 2026
796213d
docs: Reservations vertical done (CRM link, PII boundary honored)
DanMat Sep 6, 2026
8a68a88
Slice 7: Reports (manager dashboard) (#12)
DanMat Sep 6, 2026
2e8039a
docs: Reports vertical done — all operational verticals rebuilt
DanMat Sep 6, 2026
a9a788a
Slice 8a: RAS design uplift for the staff terminals (#13)
DanMat Sep 6, 2026
801d32d
docs: RAS design uplift shipped
DanMat Sep 6, 2026
30ac758
Slice 8b: RAS public theme (guest menu) (#14)
DanMat Sep 6, 2026
6bcfd84
docs: public RAS theme shipped
DanMat Sep 6, 2026
47aa651
Slice 8c (kit): demo deploy runbook + seed + hourly reset (#15)
DanMat Sep 6, 2026
1d3a12c
deploy: robust autoload path in seed (app at /app on the platform image)
DanMat Sep 6, 2026
117f23a
deploy: use a policy-compliant demo password (restaurant-demo, >=12 c…
DanMat Sep 6, 2026
348458e
deploy: seed paid demo orders on named tables (drop throwaway H0/H1)
DanMat Sep 6, 2026
b09533a
deploy: seed site.home=menu_items + brand so root shows the menu, not…
DanMat Sep 6, 2026
a97a241
deploy: grant the Manager role menu content caps (edit items/categories)
DanMat Sep 6, 2026
5008952
Slice B: public homepage + denser guest site (#16)
DanMat Sep 6, 2026
d26526a
deploy: add demo.php (6 public logins) for the login role-picker
DanMat Sep 6, 2026
a22b79a
Slice C2: online ordering + simulated checkout (#17)
DanMat Sep 6, 2026
b7fb4de
fix(admin): stop the form select overflowing its column on mobile
DanMat Sep 6, 2026
1c5fd9f
chore: archive the 2014 app; make the Nimbus README primary
DanMat Sep 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/plugin-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Plugin CI

# The restaurant plugin is co-located in this repo under plugin/. This runs its
# checks (composer validate, cs-fixer, PHPStan, phpunit) against a MySQL service,
# exactly as the official Nimbus plugins do in their own repos.

on:
push:
branches: [nimbus-rebuild, 'slice/**']
paths: ['plugin/**', '.github/workflows/plugin-ci.yml']
pull_request:
paths: ['plugin/**', '.github/workflows/plugin-ci.yml']

defaults:
run:
working-directory: plugin

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.2', '8.3']

services:
mysql:
image: mysql:8
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: nimbus_test
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -h 127.0.0.1 -uroot -proot"
--health-interval=5s --health-timeout=5s --health-retries=20

steps:
- uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: pdo_mysql, mbstring
coverage: none

- name: Validate composer.json
run: composer validate --strict

- name: Install dependencies
run: composer install --no-interaction --prefer-dist --no-progress

- name: Formatting
run: vendor/bin/php-cs-fixer fix --dry-run --diff

- name: Static analysis
run: vendor/bin/phpstan analyse --no-progress --memory-limit=512M

- name: Run tests
run: vendor/bin/phpunit
env:
TEST_DB_HOST: 127.0.0.1
TEST_DB_PORT: '3306'
27 changes: 27 additions & 0 deletions .github/workflows/theme-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Theme CI

# The RAS public theme is plain PHP templates (no build step, no test DB), so CI
# just lints them for syntax on the supported PHP versions.

on:
push:
branches: [nimbus-rebuild, 'slice/**']
paths: ['theme/**', '.github/workflows/theme-ci.yml']
pull_request:
paths: ['theme/**', '.github/workflows/theme-ci.yml']

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.2', '8.3']
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
- name: Lint templates
run: |
for f in theme/templates/*.php; do php -l "$f"; done
154 changes: 120 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,120 @@
# Restaurant-Management-System
A restaurant management system based on PHP

Restaurant Management System was developed using PHP as backend and Bootstrap as frontend. The system allows the waiter to take orders/payments from customers and maintain table status. The cook can see the list of orders made by different waiters and notify the same once the food is prepared. The system allows the manager to see the monthly revenue of the restaurant and the inventory. The admin user can maintain the different roles of the system.

Credentials

Username: waiter

Password: 123



Username: cook

Password: 123



Username: host

Password: 123



Username: busboy

Password: 123



Note: includes/settings.inc.php has the DB connection settings.

oose.sql has the sample DB
# Restaurant Management System — on NimbusCMS

The Restaurant Management System, **rebuilt as an application on
[NimbusCMS](https://github.com/NimbusCMS/nimbus)** instead of the original 2014
hand-rolled PHP. It runs a full restaurant — floor, orders, kitchen, payments,
staff roles, reservations, reports — plus a public site with online ordering, as a
Nimbus **plugin co-located in this repo** (`plugin/`) composed with the official
CRM (guests) and a theme (`theme/`). **Zero Nimbus core change** for app logic.

> The original 2014 version is preserved in **[`archive/`](archive/)** (and still
> runnable — see its README). This is the current system.

## Try the live demo

**<https://ras.nimbuscms.dev>** — a public sandbox that resets hourly.

- **Guests:** the homepage, the menu, and **online ordering** (`/order`) with a
*simulated* checkout (no real payment).
- **Staff:** sign in at **`/admin`** — the login page has an *“Explore as …”*
picker for each role. Every login uses the password **`restaurant-demo`**:
`waiter@ras.demo` (floor), `cook@ras.demo` (kitchen), `manager@ras.demo`
(everything + menu + guests), `admin@ras.demo` (the whole CMS), and more.

Signing in as a waiter vs. a cook vs. a manager shows the capability model live: a
cook has no payment button, a floor login can’t open a guest’s CRM record, and only
the manager sees Reports.

## Why this exists (platform validation)

Beyond the app, this rebuild is the **first real validation of Nimbus as a
platform**: if a whole restaurant can be built on Nimbus without pushing
restaurant-specific logic into the CMS core, the platform is proven. It drove two
reusable **core** capabilities — a read-only content capability for plugins
(ADR 0029) and fine-grained plugin capabilities (ADR 0030) — with nothing
restaurant-shaped added to core. The running ledger is in
[`docs/PLATFORM-VALIDATION.md`](docs/PLATFORM-VALIDATION.md); the architecture is in
[`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) and
[`docs/adr/0001`](docs/adr/0001-restaurant-as-a-colocated-nimbus-plugin.md).

## Status — complete

- ✅ **Menu** — categories and priced items, as Nimbus collections.
- ✅ **Tables / floor** — `rest_table`, live status, mobile floor board (the RAS
circular table tokens), capability-gated admin + MCP.
- ✅ **Orders** — open on a table, pick from the menu (snapshotting name + price),
server-computed totals, workflow (ADR 0029).
- ✅ **Kitchen display** — a cook’s New → Preparing → Ready screen.
- ✅ **Payment & turn** — settle (server-computed amount), close, turn the table.
- ✅ **Staff & roles** — floor / kitchen / manage capabilities gate the terminals
(ADR 0030).
- ✅ **Reservations** — a booking book linked to **CRM** guests by id, without the
restaurant ever reading CRM data (the PII boundary holds).
- ✅ **Reports** — a manager dashboard (revenue, active orders, top items).
- ✅ **Public site** — a homepage (hero, about, live featured dishes, hours), the
guest menu, and **online ordering** with a simulated checkout, in the dark RAS
identity (`theme/`).
- ✅ **Deployed** — live at <https://ras.nimbuscms.dev>, resets hourly.

## Layout

```
plugin/ the restaurant plugin (type: nimbuscms-plugin)
src/ RestaurantPlugin, Schema, Tables, Orders, Kitchen, Reservations,
Reports, admin pages, MCP toolset, online-order view-data + routes
templates/ default templates for the public order page (theme-overridable)
tests/ DB-backed test suites (run in CI)
theme/ the public "RAS" theme (homepage, menu, order pages)
app/collections.php the menu content model, declared as data
bin/provision-menu.sh installs the menu onto a running Nimbus via its public API
deploy/ deploy kit — DEPLOY.md runbook, seed-demo.php, reset scripts, demo logins
docs/ ARCHITECTURE, PLATFORM-VALIDATION, ADRs, per-slice design docs
archive/ the original 2014 app (unmodified; runnable via Docker)
```

## Run it locally

The app is a Nimbus **plugin**; a site consumes it via a Composer **path
repository** (Nimbus discovers plugins by `type: nimbuscms-plugin`), alongside the
CRM and the theme. The full, reproducible recipe — a Docker image built from a
Nimbus base + this repo’s `plugin/` + the CRM + the `theme/`, then migrate + seed —
is documented in **[`deploy/DEPLOY.md`](deploy/DEPLOY.md)**, and the demo data
(roles, one login per role, the menu, sample floor/orders/reservations) is created
by **[`deploy/seed-demo.php`](deploy/seed-demo.php)**.

In short:

1. Build a site image: the Nimbus base image, plus `composer require danmat/restaurant`
(via a path repo pointing at this repo’s `plugin/`) and `nimbuscms/crm`, and copy
`theme/` into the site’s `themes/restaurant/`. (See `deploy/DEPLOY.md`.)
2. Bring up the app + a MySQL, then:
```bash
php bin/nimbus migrate
php bin/nimbus install --email=admin@ras.demo --password=<a strong password> --name="RAS Admin"
php deploy/seed-demo.php # roles, logins, menu, sample data
```
3. Visit `/` (homepage), `/menu_items` (menu), `/order` (online ordering), and
`/admin` (staff).

Just the **Menu** vertical against an already-running Nimbus:

```bash
NIMBUS_URL=http://localhost:8080 \
ADMIN_EMAIL=admin@nimbus.test ADMIN_PASSWORD=password \
bin/provision-menu.sh
```

## The original 2014 app

Preserved in [`archive/`](archive/) — procedural PHP + Bootstrap 3. It wouldn’t
start on a modern PHP (it uses the removed `mysql_*` extension), so it ships with a
Docker setup that runs it authentically on PHP 5.6:

```bash
cd archive && docker compose up --build # then http://localhost:8090
```

The waiter's floor from the 2014 app — the original circular table tokens that the
rebuild's RAS uplift brought back:

![The original 2014 app running](archive/screenshots/02-floor.png)
35 changes: 35 additions & 0 deletions app/collections.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

declare(strict_types=1);

/**
* The Restaurant application's content model, declared as data.
*
* This is the single source of truth for the collections the app needs from
* Nimbus. bin/provision-menu.sh reads it and creates them through Nimbus's
* public admin API — the app "installs itself" onto a stock Nimbus instance,
* with no changes to Nimbus core.
*
* Menu is the first vertical. Orders, tables, kitchen and reports follow, each
* added here as it is built — and each one that Nimbus cannot yet express
* becomes a finding in docs/PLATFORM-VALIDATION.md.
*/

return [
'categories' => [
'name' => 'Categories',
'icon' => 'C',
'fields' => [
['handle' => 'name', 'label' => 'Name', 'type' => 'text'],
],
],

'menu_items' => [
'name' => 'Menu Items',
'icon' => 'M',
'fields' => [
['handle' => 'price', 'label' => 'Price', 'type' => 'number'],
['handle' => 'category', 'label' => 'Category', 'type' => 'relation', 'target' => 'categories'],
],
],
];
18 changes: 18 additions & 0 deletions archive/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# The original 2014 "Restaurant Automation System", run as it was written — on
# PHP 5.6 with the long-removed `mysql_*` extension. This is why the app wouldn't
# start on a modern PHP: it predates mysqli/PDO-only runtimes. Nothing here is
# modernised; it exists so you can see where the project began. The rebuilt app
# lives at the repository root (see the top-level README).
FROM php:5.6-apache

# The ancient `mysql` extension the 2014 code calls (mysql_connect/mysql_query).
RUN docker-php-ext-install mysql

# Restore the 2014 shared-hosting PHP defaults the code assumes: output_buffering
# ON (so its `session_start()`/`header()` calls after output still work — the real
# reason it "wouldn't start" on a modern default config), and errors hidden as in a
# production host. No application code is modified.
RUN { echo "output_buffering = 4096"; echo "display_errors = Off"; } > /usr/local/etc/php/conf.d/ras-legacy.ini

# Serve the app from the Apache document root.
COPY . /var/www/html/
78 changes: 78 additions & 0 deletions archive/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
> # 🗄️ Archive — the original 2014 version
>
> This folder is the **origin of the project**: the Restaurant Management System as
> it was first written in **2014** (procedural PHP + the long-removed `mysql_*`
> extension + Bootstrap 3). It is kept **unmodified** for posterity — it is *not*
> the current app.
>
> The project has since been **rebuilt as an application on
> [NimbusCMS](https://github.com/NimbusCMS/nimbus)**. For the current system, see
> the [repository root README](../README.md).
>
> **Concessions to age (no app logic changed):** `includes/settings.inc.php` reads
> its DB host from environment variables (original values kept as the fallback) so it
> can reach the database container; and the Docker image restores the 2014
> shared-hosting PHP defaults the code assumes — `output_buffering` on (so its
> `session_start()`/`header()` calls after page output still work, which is the real
> reason it "wouldn't start" on a modern default config) and errors hidden as on a
> production host. The application source itself is untouched.

## Run the original app (Docker)

It wouldn't start on a modern PHP because it calls the `mysql_*` functions removed
in PHP 7. The included Docker setup runs it authentically on **PHP 5.6 + MySQL 5.7**:

```bash
cd archive
docker compose up --build
```

Then open <http://localhost:8090> and sign in. Stop it with `docker compose down`
(add `-v` to also drop the database).

### It runs — proof

The login screen, and the waiter's floor after signing in — the original signature
**circular table tokens** (green = open, yellow = occupied, red = needs bussing)
that the rebuilt app's RAS uplift brought back:

![The 2014 login screen](screenshots/01-login.png)

![The waiter's floor — the original circular table tokens](screenshots/02-floor.png)

---

# Restaurant-Management-System
A restaurant management system based on PHP

Restaurant Management System was developed using PHP as backend and Bootstrap as frontend. The system allows the waiter to take orders/payments from customers and maintain table status. The cook can see the list of orders made by different waiters and notify the same once the food is prepared. The system allows the manager to see the monthly revenue of the restaurant and the inventory. The admin user can maintain the different roles of the system.

Credentials

Username: waiter

Password: 123



Username: cook

Password: 123



Username: host

Password: 123



Username: busboy

Password: 123



Note: includes/settings.inc.php has the DB connection settings.

oose.sql has the sample DB
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading