跳轉至

5. Building block view

Level 1: system decomposition

flowchart TB
  Pages[Page controllers and assets]
  Bootstrap[Bootstrap and configuration]
  Application[Application services and workflows]
  Domain[Booking, calendar, user, period, recurrence]
  Infrastructure[DB, auth, session, mail, integrations]
  Data[(MRBS tables)]

  Pages --> Bootstrap
  Pages --> Application
  Application --> Domain
  Application --> Infrastructure
  Domain --> Infrastructure
  Infrastructure --> Data
Building block Responsibility
Page controllers Receive requests, authorize actions, coordinate behavior, render responses
Bootstrap Load defaults and local config, initialize session, errors, language, DB, and upgrades
Application services Implement booking, reporting, import/export, administration, and notification workflows
Domain model Represent calendars, recurrence, users, periods, messages, and booking intervals
Infrastructure Adapt databases, identity systems, sessions, mail transports, and external libraries
Persistence Store operational state and schema version

Level 2: PHP application

flowchart LR
  Controller[web/*.php]
  Shared[functions*.inc and mrbs_sql.inc]
  Calendar[MRBS\\Calendar]
  Forms[MRBS\\Form]
  Auth[MRBS\\Auth and MRBS\\Session]
  DB[MRBS\\DB]
  Intl[Language and MRBS\\Intl]
  CalendarIO[MRBS\\ICalendar]
  Mail[Mailer and MailQueue]

  Controller --> Shared
  Controller --> Calendar
  Controller --> Forms
  Shared --> Auth
  Shared --> DB
  Shared --> Intl
  Shared --> CalendarIO
  Shared --> Mail

Controllers and shared functions

Files such as index.php, edit_entry.php, edit_entry_handler.php, report.php, and admin.php form the delivery layer. Large procedural include files provide cross-page workflows and database-oriented functions.

Calendar and form components

MRBS\Calendar contains renderer variants for day, week, month, year, one-room, and multiroom views. MRBS\Form provides composable HTML form elements and fields.

Identity

MRBS\Auth verifies credentials. MRBS\Session obtains and retains the current identity. The two concepts are connected but independently selectable.

Persistence

MRBS\DB wraps PDO behavior and database differences. mrbs_sql.inc contains application-specific queries and booking persistence workflows.

Integration

MRBS\ICalendar, Mailer, MailQueue, localization classes, and bundled third-party libraries connect core workflows to external formats and services.