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 vision | Part I: Foundation (Ch 01) |
| Review architecture decisions | Part II: Architecture (Ch 02-05) — 52 ADRs in Ch 02 |
| Build the database | Part III: Database (Ch 06-09) |
| Trace BRD to code | Appendix F: BRD-to-Code Module Mapping |
Table of Contents
Front Matter
- 00-BOOK-INDEX.md – You are here
- 01-PREFACE.md - Why this book exists
- BLUEPRINT-INSTRUCTIONS.md - How to maintain this blueprint
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
- Chapter 02: Architecture Decision Records
- Chapter 03: Architecture Characteristics
- Chapter 04: Architecture Styles Analysis
- Chapter 05: Architecture Components (BRD v20.0)
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
- Chapter 06: Database Strategy
- Chapter 07: Schema Design
- Chapter 08: Entity Specifications
- Chapter 09: Indexes & Performance
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-restructurepreserves the previous content.
Book Statistics
| Metric | Value |
|---|---|
| Total Chapters | 9 |
| Parts | 3 |
| Appendices | 2 (F, G) |
| ADRs | 51 |
| Database Tables | 69 |
| API Endpoints | 75+ |
| Domain Events | 80 |
| Code Services | 142 |
| Target Grade | A (Production-Ready) |
How to Print This Book
Option 1: Markdown to PDF (Recommended)
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
- Install “Markdown PDF” extension in VS Code
- Open each chapter
- Right-click > “Markdown PDF: Export (pdf)”
- 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
| Format | Pages | Notes |
|---|---|---|
| Full Book | ~150-200 | All chapters and appendix |
| Core (Parts II-III) | ~120 | Architecture + Database |
Version History
| Version | Date | Changes |
|---|---|---|
| 7.0.0 | 2026-03-02 | Unified 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.0 | 2026-03-01 | New 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.0 | 2026-03-01 | Comprehensive 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.0 | 2026-03-01 | Online-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.0 | 2026-02-28 | Tech 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.0 | 2026-02-27 | Major 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.0 | 2026-02-27 | Stitch 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.0 | 2026-02-27 | Full 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.0 | 2026-02-27 | Full 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.0 | 2026-02-25 | Removed Ch 02-04 (Foundation), rewritten Ch 01 as Blueprint Purpose, renumbered 35 to 32 chapters |
| 4.0.0 | 2026-02-25 | BRD v20.0 integrated as Chapter 08: Architecture Components; all subsequent chapters renumbered (+1); 26 contradictions reconciled across 12 chapters and 4 appendices |
| 3.3.0 | 2026-02-25 | RFID 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.0 | 2026-02-24 | Added 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.0 | 2026-02-22 | Structural 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.0 | 2026-02-22 | Chapter 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.0 | 2026-02-19 | Expert panel review, integration module additions |
| 1.0.0 | 2025-12-29 | Initial Blueprint Book (39 chapters) |
Contributors
| Role | Contributor |
|---|---|
| Architect | Claude Code Architect Agent |
| Author | Claude Code Editor Agent |
| Reviewer | Claude Code Engineer Agent |
| Research | Claude Code Researcher Agent |
| Coordinator | Claude Code Orchestrator |
Blueprint Maintenance
How to Update This Blueprint
See BLUEPRINT-INSTRUCTIONS.md for complete maintenance procedures.
Quick Reference:
| Task | Action |
|---|---|
| Edit content | Update master file, copy to mdbook-src/src/ |
| Add chapter | Create file, update this index, update SUMMARY.md |
| Add appendix | Create file, update this index, update SUMMARY.md |
| Build PDF | Run ./build-book.sh |
| Deploy web | Run cd mdbook-src && mdbook build && wrangler pages deploy book |
CRITICAL: When adding or removing chapters/appendices, you MUST update:
- This file (
00-BOOK-INDEX.md) mdbook-src/src/SUMMARY.md- 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
- Follow the ADRs — Chapter 02 has 51 formalized decisions with rationale
- Ch 04 is the mega-reference — ~5,000 lines covering all implementation patterns
- Ch 05 is the BRD — ~19,900 lines with complete business requirements
- Schema provisioning — Use the SQL functions in Chapter 06 or Chapter 07
- Safety tag —
v5.3.0-pre-restructurepreserves all removed content for reference
Change Log
| Date | Change | Author |
|---|---|---|
| 2026-03-02 | v7.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-01 | v6.4.0 - New Appendix G: Application Screen Reference (118 screens, 13 wireframes, 8 nav flows, full BRD traceability) | Claude Code |
| 2026-03-01 | v6.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 updated | Claude Code |
| 2026-03-01 | v6.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-28 | v6.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-27 | v6.0.0 - Major restructure: removed Parts IV-VIII + Appendices A-E, consolidated 45 ADRs | Claude Code |
| 2026-02-27 | v5.3.0 - Stitch design handoff: gap-fill (Appendix D, Ch 15-17) + 2 new handoff documents | Claude Code |
| 2026-02-27 | v5.2.0 - Full architect review: 10 new ADRs (007-016), namespace unified to POS.*, 163+ findings resolved | Claude Code |
| 2026-02-27 | v5.1.0 - Full review + enhancement of Parts III, IV, V (12 chapters) | Claude Code |
| 2025-12-29 | Initial Blueprint v1.0.0 | Claude Code |
| 2026-01-24 | Added maintenance instructions, updated appendix list | Claude Code |
| 2026-02-22 | v3.0.0 - Chapter consolidation (39 to 34), full renumbering | Claude Code |
| 2026-02-23 | v3.1.0 - Structural cleanup: section numbering, RLS fix, footers, cross-refs | Claude Code |
| 2026-02-25 | v5.0.0 - Removed Ch 02-04 (Foundation), rewritten Ch 01 as Blueprint Purpose, renumbered 35 to 32 chapters | Claude Code |
| 2026-02-25 | v4.0.0 - BRD v20.0 as Ch 08, full renumber (34 to 35 chapters), contradiction reconciliation | Claude Code |
| 2026-02-24 | v3.2.0 - Added Appendix F: BRD-to-Code Module Mapping | Claude Code |
“Build it right the first time. This Blueprint is your guide.”