The POS Platform Blueprint

A Complete Guide to Building an Enterprise Multi-Tenant Point of Sale System

Version: 7.0.0 Created: December 29, 2025 Updated: March 2, 2026 Target Platform: /volume1/docker/pos-platform/


╔═══════════════════════════════════════════════════════════════════════════════╗
║                                                                               ║
║                    ████████╗██╗  ██╗███████╗                                  ║
║                    ╚══██╔══╝██║  ██║██╔════╝                                  ║
║                       ██║   ███████║█████╗                                    ║
║                       ██║   ██╔══██║██╔══╝                                    ║
║                       ██║   ██║  ██║███████╗                                  ║
║                       ╚═╝   ╚═╝  ╚═╝╚══════╝                                  ║
║                                                                               ║
║           ██████╗  ██████╗ ███████╗    ██████╗ ██╗     ██╗   ██╗███████╗     ║
║           ██╔══██╗██╔═══██╗██╔════╝    ██╔══██╗██║     ██║   ██║██╔════╝     ║
║           ██████╔╝██║   ██║███████╗    ██████╔╝██║     ██║   ██║█████╗       ║
║           ██╔═══╝ ██║   ██║╚════██║    ██╔══██╗██║     ██║   ██║██╔══╝       ║
║           ██║     ╚██████╔╝███████║    ██████╔╝███████╗╚██████╔╝███████╗     ║
║           ╚═╝      ╚═════╝ ╚══════╝    ╚═════╝ ╚══════╝ ╚═════╝ ╚══════╝     ║
║                                                                               ║
║                        ██████╗ ██████╗ ██╗███╗   ██╗████████╗                ║
║                        ██╔══██╗██╔══██╗██║████╗  ██║╚══██╔══╝                ║
║                        ██████╔╝██████╔╝██║██╔██╗ ██║   ██║                   ║
║                        ██╔═══╝ ██╔══██╗██║██║╚██╗██║   ██║                   ║
║                        ██║     ██║  ██║██║██║ ╚████║   ██║                   ║
║                        ╚═╝     ╚═╝  ╚═╝╚═╝╚═╝  ╚═══╝   ╚═╝                   ║
║                                                                               ║
║                    Enterprise Multi-Tenant Point of Sale                      ║
║                          Architecture & Implementation                        ║
║                                                                               ║
╚═══════════════════════════════════════════════════════════════════════════════╝

How to Use This Book

This Blueprint is a self-contained guide for building a production-grade, multi-tenant POS system using Claude Code’s multi-agent orchestration. Every diagram, code sample, database schema, and implementation detail is included directly in these pages.

Reading Order

If You Want To…Start With…
Understand the visionPart I: Foundation (Ch 01)
Review architecture decisionsPart II: Architecture (Ch 02-05) — 52 ADRs in Ch 02
Build the databasePart III: Database (Ch 06-09)
Trace BRD to codeAppendix F: BRD-to-Code Module Mapping

Table of Contents

Front Matter


Part I: Foundation (Chapter 01)

What this book is and how to use it


Part II: Architecture (Chapters 02-05)

System design, quality attributes, and key decisions

Note: In v3.0.0, standalone architecture chapters were consolidated into enriched Characteristics and Styles chapters. In v4.0.0, the full BRD v20.0 was integrated. In v5.0.0, Foundation chapters 02-04 were removed and all chapters renumbered.


Part III: Database (Chapters 06-09)

Complete data layer specification


Appendices

Note: In v6.0.0, Parts IV-VIII (Backend, Frontend, Implementation, Operations, Reference) and Appendices A-E were removed for architect-led rewrite. All architecture decisions are consolidated as 52 ADRs in Chapter 02. Safety tag v5.3.0-pre-restructure preserves the previous content.


Book Statistics

MetricValue
Total Chapters9
Parts3
Appendices2 (F, G)
ADRs51
Database Tables69
API Endpoints75+
Domain Events80
Code Services142
Target GradeA (Production-Ready)

How to Print This Book

Use Pandoc to compile all chapters into a single PDF:

# Install Pandoc (if not installed)
# macOS: brew install pandoc
# Ubuntu: apt install pandoc texlive-xetex

# Navigate to Blueprint folder
cd /volume1/docker/planning/000-POS-Learning/00-Blue-Print

# Compile to PDF
pandoc \
  00-BOOK-INDEX.md \
  01-PREFACE.md \
  Part-I-Foundation/*.md \
  Part-II-Architecture/*.md \
  Part-III-Database/*.md \
  Appendices/*.md \
  -o POS-Blueprint-Book.pdf \
  --toc \
  --toc-depth=3 \
  --pdf-engine=xelatex \
  -V geometry:margin=1in \
  -V fontsize=11pt \
  -V mainfont="DejaVu Sans" \
  -V monofont="DejaVu Sans Mono"

Option 2: VS Code Extension

  1. Install “Markdown PDF” extension in VS Code
  2. Open each chapter
  3. Right-click > “Markdown PDF: Export (pdf)”
  4. Combine PDFs using any PDF merger

Option 3: Web-Based

Use online tools like:

  • Dillinger.io - Paste markdown, export as PDF
  • GitHub - Each .md file renders nicely for printing
  • Grip - Local GitHub-style markdown preview

Option 4: Build Script (Automated)

#!/bin/bash
# save as: build-book.sh

BOOK_DIR="/volume1/docker/planning/000-POS-Learning/00-Blue-Print"
OUTPUT="$BOOK_DIR/POS-Blueprint-Book.pdf"

# Collect all markdown files in order
FILES=(
  "$BOOK_DIR/00-BOOK-INDEX.md"
  "$BOOK_DIR/01-PREFACE.md"
)

# Add Part I-III + Appendices
for part in Part-I-Foundation Part-II-Architecture Part-III-Database Appendices; do
  for file in "$BOOK_DIR/$part"/*.md; do
    [ -f "$file" ] && FILES+=("$file")
  done
done

# Build PDF
pandoc "${FILES[@]}" -o "$OUTPUT" --toc --toc-depth=3

echo "Book compiled: $OUTPUT"

Estimated Print Size

FormatPagesNotes
Full Book~150-200All chapters and appendix
Core (Parts II-III)~120Architecture + Database

Version History

VersionDateChanges
7.0.02026-03-02Unified Web Application: Nexus POS + Nexus Admin consolidated into single “Nexus POS” React web app with role-based navigation (OWNER, MANAGER, CASHIER, BUYER, AUDITOR). Tauri desktop wrapper removed — hardware via web protocols (Star WebPRNT, USB HID, Stripe Terminal SDK). New ADR-052 (Unified Web App), ADR-046 superseded. ADR-048 stays active — better-sqlite3→SQLite WASM (sql.js/wa-sqlite + OPFS). 52 ADRs (43 active, 7 superseded, 2 removed). All “Nexus Admin”/“Admin Portal” references → “Nexus POS” with role context. Appendix G screen inventory: POS/Admin/Both→role-based columns. Safety tag: v6.4.0-pre-unification.
6.4.02026-03-01New Appendix G: Application Screen Reference. 118 screens cataloged across 7 modules (Sales 22, Customers 10, Catalog 18, Inventory 23, Setup 22, Integrations 12, Raptag 8, Cross-cutting 3). 13 ASCII wireframes. Full BRD traceability (screen→BRD section→database table→Appendix F service). POS Terminal context (hardware, offline, shortcuts, flows). 8 navigation flow maps. Traceability matrix. ~6,000 lines. Appendices: 1→2.
6.3.02026-03-01Comprehensive review: 50 findings resolved. 3 new ADRs (049-051: Socket.io, Prisma+RLS, State Management). ADR-015/037 superseded. 6 missing tables added (pricing_rules, purchase/transfer orders, store_credits). 69 total tables. 8 FK type fixes. 9 RFID RLS variable fixes. Ch 03 K.2.1 Availability rewritten for online-first. Ch 05: 8 offline-first locations rewritten, 5 decisions fixed, state machine 7.12 updated. 25 BRD-v12→v20 NFR citations fixed. All footers to 6.3.0. 52 ADRs total (43 active, 6 superseded, 2 removed).
6.2.02026-03-01Online-first pivot: offline-first → online-first with thin offline fallback. New ADR-048, ADR-002 superseded. Ch 04 L.10A.1 rewritten: 6-table SQLite → 2-table, CRDTs removed, 3-state connection monitor, flag-on-sync price discrepancy, safety buffers. ADR-046 updated. 48 ADRs total.
6.1.02026-02-28Tech stack pivot: .NET/C# → TypeScript/Node.js + Nexus branding across ALL chapters. ADR surgery: 9 modified, 2 new (046-047), 3 superseded, 2 removed (47 total). Ch 04: 22 C# code blocks → TypeScript, 6 diagrams. Ch 05: 33 naming fixes. Ch 06-08: code blocks converted. Cross-ref audit: 7 fixes.
6.0.02026-02-27Major restructure: removed Parts IV-VIII + Appendices A-E for architect-led rewrite. 28 new ADRs (018-045) consolidated into Ch 02 (45 total). Cross-references audited (38 fixes). 32→9 chapters, 8→3 Parts, 6→1 Appendix
5.3.02026-02-27Stitch design handoff: Appendix D rewritten (33 fixes), 29 Admin screens added (Ch 15), 4 Raptag sub-screens (Ch 16), 16 new components + icon library + token gaps (Ch 17), Stitch-Design-Handoff.md + Stitch-Design-Spec.md created
5.2.02026-02-27Full architect review: 10 new ADRs (007-016), namespace unified to POS.*, RabbitMQ to LISTEN/NOTIFY, schema-per-tenant to RLS, security standardized (Argon2id/BCrypt/RS256), 163+ findings resolved
5.1.02026-02-27Full review + enhancement of Parts III-V: fixed schema-per-tenant artifacts, added tenant_id to 38 tables, compound tax redesign, event_outbox + state_transitions tables, CQRS/MediatR for Sales, transactional outbox, 6-Gate Security Pyramid, ACL per provider, error code catalogue, SQLite schema rewrite, performance budgets, WCAG 2.1 AA accessibility, component state patterns
5.0.02026-02-25Removed Ch 02-04 (Foundation), rewritten Ch 01 as Blueprint Purpose, renumbered 35 to 32 chapters
4.0.02026-02-25BRD v20.0 integrated as Chapter 08: Architecture Components; all subsequent chapters renumbered (+1); 26 contradictions reconciled across 12 chapters and 4 appendices
3.3.02026-02-25RFID Counting Subsystem: BRD v20 (Section 5.16 RFID Config, Section 4.6.8 multi-operator counting, 6 new decisions #108-113), schema fixes (tenant_id/RLS on all RFID tables, 3 new tables), chunked sync API, Raptag home dashboard + progress tracking + auto-save/recovery
3.2.02026-02-24Added Appendix F: BRD-to-Code Module Mapping (142 services across 7 modules, 80 domain events, 19 state machines, 107 decisions mapped with full traceability)
3.1.02026-02-22Structural cleanup: section numbering standardized across all 34 chapters + 5 appendices, Ch 08/09 rewritten for RLS, Document Information footers added, cross-references audited and fixed
3.0.02026-02-22Chapter consolidation (39 to 34): merged High-Level Architecture, Multi-Tenancy, Domain Model, Event Sourcing, and Offline-First into Architecture Characteristics (Ch 06) and Architecture Styles (Ch 07); full renumbering
2.0.02026-02-19Expert panel review, integration module additions
1.0.02025-12-29Initial Blueprint Book (39 chapters)

Contributors

RoleContributor
ArchitectClaude Code Architect Agent
AuthorClaude Code Editor Agent
ReviewerClaude Code Engineer Agent
ResearchClaude Code Researcher Agent
CoordinatorClaude Code Orchestrator

Blueprint Maintenance

How to Update This Blueprint

See BLUEPRINT-INSTRUCTIONS.md for complete maintenance procedures.

Quick Reference:

TaskAction
Edit contentUpdate master file, copy to mdbook-src/src/
Add chapterCreate file, update this index, update SUMMARY.md
Add appendixCreate file, update this index, update SUMMARY.md
Build PDFRun ./build-book.sh
Deploy webRun cd mdbook-src && mdbook build && wrangler pages deploy book

CRITICAL: When adding or removing chapters/appendices, you MUST update:

  1. This file (00-BOOK-INDEX.md)
  2. mdbook-src/src/SUMMARY.md
  3. Copy updated index to mdbook-src/src/00-BOOK-INDEX.md

Live Site

URL: https://pos-blueprint.pages.dev/


Thoughts & Recommendations

Current Status (as of 2026-03-01)

The blueprint is in architecture foundation state after v6.0.0 restructure. Parts I-III + Appendix F provide the complete architecture and database foundation. Parts IV-VIII and Appendices A-E have been removed for architect-led rewrite.

What’s Complete

  • 51 Architecture Decision Records (Ch 02) — all key decisions formalized
  • Complete database schema (69 tables across 16 domains)
  • Full BRD (19,900+ lines, 7 modules, 113 business decisions)
  • Architecture Styles (~5,000 lines of implementation patterns)
  • BRD-to-Code traceability (142 services, 80 events, 19 state machines)

What Needs Rewrite (Planned)

  • Part IV: Backend — API Design, Service Layer, Security, Integrations
  • Part V: Frontend — Nexus POS, Nexus Admin, Nexus Raptag, Component Library
  • Part VI: Implementation — Dev Environment, Roadmap, 4 Phases
  • Part VII: Operations — Deployment, Monitoring, Security, DR, Tenant Lifecycle
  • Part VIII: Reference — Claude Commands, Glossary, Checklists, Troubleshooting
  • Appendices A-E — API Reference, ERD, Events, Mockups, Templates

Implementation Notes

  1. Follow the ADRsChapter 02 has 51 formalized decisions with rationale
  2. Ch 04 is the mega-reference — ~5,000 lines covering all implementation patterns
  3. Ch 05 is the BRD — ~19,900 lines with complete business requirements
  4. Schema provisioning — Use the SQL functions in Chapter 06 or Chapter 07
  5. Safety tagv5.3.0-pre-restructure preserves all removed content for reference

Change Log

DateChangeAuthor
2026-03-02v7.0.0 - Unified Web Application: Nexus POS + Nexus Admin → single “Nexus POS” web app. Tauri removed. ADR-052 added, ADR-046 superseded. SQLite WASM. 52 ADRs.Claude Code
2026-03-01v6.4.0 - New Appendix G: Application Screen Reference (118 screens, 13 wireframes, 8 nav flows, full BRD traceability)Claude Code
2026-03-01v6.3.0 - Comprehensive review: 50 findings resolved, 3 new ADRs (049-051), 6 new tables, Ch 03 K.2.1 rewritten, Ch 05 offline rewrite (8 locations), 25 NFR citations fixed, all footers updatedClaude Code
2026-03-01v6.2.0 - Online-first pivot: ADR-048 (online-first data strategy), ADR-002 superseded, Ch 04 L.10A.1 rewritten (2-table SQLite, 3-state monitor, flag-on-sync, CRDTs removed)Claude Code
2026-02-28v6.1.0 - Tech stack pivot: .NET/C# to TypeScript/Node.js in Ch 04 (22 code blocks, 6 diagrams, naming pass)Claude Code
2026-02-27v6.0.0 - Major restructure: removed Parts IV-VIII + Appendices A-E, consolidated 45 ADRsClaude Code
2026-02-27v5.3.0 - Stitch design handoff: gap-fill (Appendix D, Ch 15-17) + 2 new handoff documentsClaude Code
2026-02-27v5.2.0 - Full architect review: 10 new ADRs (007-016), namespace unified to POS.*, 163+ findings resolvedClaude Code
2026-02-27v5.1.0 - Full review + enhancement of Parts III, IV, V (12 chapters)Claude Code
2025-12-29Initial Blueprint v1.0.0Claude Code
2026-01-24Added maintenance instructions, updated appendix listClaude Code
2026-02-22v3.0.0 - Chapter consolidation (39 to 34), full renumberingClaude Code
2026-02-23v3.1.0 - Structural cleanup: section numbering, RLS fix, footers, cross-refsClaude Code
2026-02-25v5.0.0 - Removed Ch 02-04 (Foundation), rewritten Ch 01 as Blueprint Purpose, renumbered 35 to 32 chaptersClaude Code
2026-02-25v4.0.0 - BRD v20.0 as Ch 08, full renumber (34 to 35 chapters), contradiction reconciliationClaude Code
2026-02-24v3.2.0 - Added Appendix F: BRD-to-Code Module MappingClaude Code

“Build it right the first time. This Blueprint is your guide.”