Document ID : DARX-TECH-ARCH-B-001 Title : Daralbeida Multi-Entity Web Platform — Architecture Reference Version : 1.0 Status : ACTIVE Date Created : 2026-06-03 Prepared by : PYB / Daralbeida Style : BPGP Department : TECH Classification: Internal KB Category : WEB-FRONTEND Filename : DARX_TECH_ARCHITECTURE_B_20260603.txt Related Docs : DARX-OPS-ADMIN-MANUAL-001, DARX-TECH-CAROUSEL-001 OUTLINE -------------------------------------------------------------------------------- 1. Purpose and Scope 2. Architecture at a Glance 3. Master Site 3.1 Master Folder Layout 3.2 Master Responsibilities 3.3 Master Document Trunk 3.4 Master Skin Trunk 3.5 Master Image Trunk 3.6 Master Site Manager 4. Entity Sites 4.1 Entity Folder Layout 4.2 Entity Responsibilities 4.3 Entity Section Portals 4.4 Entity Image Trunk 5. Shared CSV Registries 5.1 Document Status Registry 5.2 Skin Values Registry 6. Skin Cascade 7. Helpers and Constants 8. Filtering Mechanics 9. Mirror Environments 10. Acronyms 11. Glossary DOCUMENT CONTROL -------------------------------------------------------------------------------- ================================================================================ 1. PURPOSE AND SCOPE ================================================================================ This document is the architecture reference for the Daralbeida multi-entity web platform. It describes the master site, the entity sites, the document and skin registries, the loading cascade, and the helpers that bind them together. The reader is assumed to be the platform administrator or a developer joining the project. Operating procedures (adding documents, adding entities, editing skins) live in the companion administrator user manual; see DARX-OPS-ADMIN- MANUAL-001. In scope: the production folder model, the master/entity relationship, the CSV-driven filter, the skin cascade, and the helper API. Out of scope: any single page's design (covered in its own design record) and the consumer homepage carousel (covered in DARX-TECH-CAROUSEL-001). ================================================================================ 2. ARCHITECTURE AT A GLANCE ================================================================================ The platform is one master site plus N entity sites that share infrastructure and document content but present a standalone face to visitors. The master is the operator's cockpit; each entity site is a thin, themed view. Server root ├── 404.php, 403.php shared error pages, only files in common at / ├── __darmaster/ the cockpit and the single source of truth └── __darh/, __darx/, … one folder per entity (Daralbeida-Holdings, Daralbeida-X, Daralbeida-Mill, and any future __dar* sibling) A visitor never sees /__darmaster/ directly. The entity sites publish documents, serve homepages, run carousels — everything visitor-facing — by reading from the master. ================================================================================ 3. MASTER SITE ================================================================================ 3.1 MASTER FOLDER LAYOUT The master site lives entirely under /__darmaster/ and has the following shape: /__darmaster/ 12/ the site manager (admin UI) index.php landing — tabs for Documents and Skins skins.php skin values dashboard 11/ the document trunks 0101/txt/ .txt flat trunk (BPGP knowledge base) 0102/html/ .html flat trunk (legacy HTML docs) api/ shared PHP libraries _base.php DARMASTER_BASE + ENTITY constants, path helpers darx_helpers.php darx_load_skin(), darx_img(), darx_img_entity(), darx_render_skin_vars() doc_status.csv per-document registry (see Section 5.1) skin_values.csv per-entity/section skin variable registry (see Section 5.2) module_section_scanner.php the file scanner + CSV-driven filter module_nav_sections.php the shared top nav module (PHP) doc_status_lib.php CSV registry I/O css/ base/ unskinnable foundation; never per-entity tokens.css global tokens (colours, spacing, type scale) nav.css top nav module styling portal.css section portal layout skins/ entity-level and section-level skin overrides entity-darh.css DARH skin (palette, wordmark, etc.) entity-darx.css DARX skin entity-darm.css DARM skin section-01.css OPTIONAL — section-01 accents section-02.css OPTIONAL — section-02 accents … img/ ecosystem-wide images (see Section 3.5) certifications/ third-party cert logos (USDA, EU Bio, …) partners/ partner / retailer marks icons/ generic UI icons flags/ language flags shared/ anything cross-entity that fits nowhere above 3.2 MASTER RESPONSIBILITIES The master site holds and controls everything that is shared across entities. Specifically: - The two flat document trunks (txt and html). Every document the platform publishes lives in one of these two folders. No copies, no per-entity duplicates. - The shared PHP libraries (scanner, helpers, nav module, CSV I/O). - The shared base CSS (tokens, nav module, portal layout). - The entity and section skin layers (see Section 6). - The ecosystem-wide image trunk (see Section 3.5). - The site manager UI at /__darmaster/12/, which is the only place per-document metadata and per-entity skin values are edited. The master site does not have public-facing portals of its own. /__darmaster/01/, /__darmaster/02/, and friends do not exist. Visitors do not browse the master. 3.3 MASTER DOCUMENT TRUNK All documents live in two flat directories: /__darmaster/11/0101/txt/ every published .txt /__darmaster/11/0102/html/ every published .html There are no per-section subfolders and no per-entity subfolders inside these trunks. A document's section, entity, status, and department are values in the registry (see Section 5.1), not directory positions. Renaming a file does not move it between sections; editing its CSV row does. The filename convention is preserved for human navigation and for filename parsing during the initial scan: ENTITY_CATEGORY_DESCRIPTOR_YYYYMMDD.ext Underscores are the only separator. The date is the file's creation or revision date (never copied from an older file). Examples: DARX_TECH_CAROUSEL_CHANGELOG_20260527.txt DARH_STDS_BPGP_202605301215.txt DARX_KB_RETAIL_CERTIFICATIONS_20260523.html 3.4 MASTER SKIN TRUNK Each entity has one skin file in /__darmaster/css/skins/entity-.css. Each section may optionally have one in /__darmaster/css/skins/section-.css. The entity skin defines the entity's identity (palette, wordmark, frame tones); the section skin, if present, layers section-specific accents on top. A skin file holds the STRUCTURAL CSS for the entity or section. Operator- tweakable VALUES (colours, fonts, compactness, etc.) are stored separately in /__darmaster/api/skin_values.csv and applied through a generated inline tag for step 6 of the cascade. Used internally by darx_load_skin(); also callable directly for testing. ================================================================================ 8. FILTERING MECHANICS ================================================================================ The section portal renderer follows three steps per request: Step 1 — SCAN darx_scan_all() reads the two flat trunks and returns one row per document, with metadata parsed from the filename (entity, dept, descriptor, date) and the filesystem (size, lines, chars, version). Step 2 — JOIN Each scanned row is joined with its registry row from doc_status.csv (keyed by filename). Registry values override filename-parsed values where both exist. The entity, section, and status columns from the registry become authoritative for filtering. Step 3 — FILTER The renderer keeps only rows where: status == 1 AND ( entity matches ENTITY OR entity == 'shared' ) AND section == basename(__DIR__) Then it sorts by (entity, category, filename) and emits the page in two views (HTML and TXT) per the shared portal layout. Documents in the trunk that have no registry row are auto-registered with default values (status = 0, entity inferred from filename token, section inferred from the legacy filename-to-section map if present, otherwise '07'). They are private by default and do not appear on any portal until the operator publishes them in the dashboard. ================================================================================ 9. MIRROR ENVIRONMENTS ================================================================================ The domain redirects / to either /_devt/ (dev) or /_prod/ (prod). Each mirror contains its own copy of the entire tree: /_devt/__darmaster/, /_devt/__darh/, /_devt/__darx/, /_devt/__darm/, … /_prod/__darmaster/, /_prod/__darh/, /_prod/__darx/, /_prod/__darm/, … All paths inside the platform are written with SITE_BASE or DARMASTER_BASE so the same source serves both mirrors with no hardcoded mirror folder. See DARX-TECH-CAROUSEL-001 Section 7 for the mirror-portability conventions. Deploying to production is a sync from /_devt/ to /_prod/ once changes have been verified in dev. ================================================================================ 10. ACRONYMS ================================================================================ The following acronyms appear in this document: Acronym Expansion ──────── ──────────────────────────────────────────── BPGP Bullet-Proof Ground-Plane CSS Cascading Style Sheets CSV Comma-Separated Values DARH Daralbeida Holdings DARM Daralbeida Mill DARX Daralbeida-X KB Knowledge Base PHP PHP: Hypertext Preprocessor SVG Scalable Vector Graphics UI User Interface URL Uniform Resource Locator ================================================================================ 11. GLOSSARY ================================================================================ Key terms used in this document: Term Definition ───────────────── ────────────────────────────────────────────────────── Cascade The fixed order in which stylesheets and values load. Entity A first-class brand or org unit with its own site. Entity site A standalone-feeling website under /__darh/, /__darx/, … Master The cockpit at /__darmaster/; single source of truth. Mirror A deployment copy: /_devt/ for dev, /_prod/ for prod. Portal A section page that lists documents from the trunk. Registry A CSV that is read by code and edited only via the UI. Section A numbered domain (01..07) — Company, Market, etc. Shim A thin entity-side file that defers to master. Skin A CSS layer that gives an entity or section its identity. Trunk A flat directory: the document or image store. DOCUMENT CONTROL Document ID : DARX-TECH-ARCH-B-001 Title : Daralbeida Multi-Entity Web Platform — Architecture Reference Version : 1.0 Status : ACTIVE Style : BPGP Department : TECH Date Created : 2026-06-03 Date Revised : 2026-06-03 Last Modified : 2026-06-03 KB Category : WEB-FRONTEND Filename : DARX_TECH_ARCHITECTURE_B_20260603.txt Review Cycle : On next platform structural change. Retention : Life of the platform plus two years. Owner : PYB / Daralbeida Distribution : Daralbeida web engineering and platform operators. COMPLIANCE : Single source of truth at /__darmaster/; entities read, not own. Revision History: Ver Date Summary of Changes 1.0 2026-06-03 Initial issue defining Structure B. END OF DOCUMENT