diff --git a/AI_prompt.md b/AI_prompt.md
index 4318e8c..318f4dc 100644
--- a/AI_prompt.md
+++ b/AI_prompt.md
@@ -143,11 +143,29 @@ Since I develop src folder before I adopt SDD_FRAMEWORK.md approach, can you che
# ---------------------------------------------- 100 --------------------------------------------- #
-
-
-
-
-
+Check NATSBridge/docs folder I want to update the content of the following files according to ASG_Framework/ASG_Framework.md:
+- NATSBridge/docs/requirements.md
+- NATSBridge/docs/specification.md
+- NATSBridge/docs/ui-specification.md (you'll need to create this one)
+- NATSBridge/docs/walkthrough.md
+- NATSBridge/docs/architecture.md
+I'll do the other docs not listed here later myself.
+
+
+
+now help me update the following fileaccording to ASG_Framework/ASG_Framework.md:
+- NATSBridge/docs/specification.md
+
+
+
+
+
+Check NATSBridge/docs folder. I would like to expand this package to include Dart support.
+Can you update the content of the following files according to ASG_Framework/ASG_Framework.md:
+- NATSBridge/docs/requirements.md
+- NATSBridge/docs/specification.md
+- NATSBridge/docs/walkthrough.md
+- NATSBridge/docs/architecture.md
diff --git a/docs/SDD_FRAMEWORK.md b/docs/SDD_FRAMEWORK.md
deleted file mode 100644
index f278dcf..0000000
--- a/docs/SDD_FRAMEWORK.md
+++ /dev/null
@@ -1,402 +0,0 @@
-# SDD + GitOps Documentation Framework
-
-This document defines the documentation framework for the NATSBridge project. It establishes a structured approach to creating, maintaining, and evolving technical documentation in alignment with GitOps principles—ensuring that documentation is versioned, auditable, and continuously validated alongside the codebase.
-
----
-
-## The SDD Framework: Seven Pillars of Documentation
-
-| Document | Purpose (Rationale) | Primary Audience | Format / Content | Example (SaaS Context) | Measurement (KPI) |
-|----------|---------------------|-----------------|------------------|------------------------|-------------------|
-| **Requirements** | Capture the **business intent** — why we're building this and what success looks like. Defines boundaries and user-visible outcomes. | Stakeholders, Product Owners, Lead Developers | User stories, PRDs, acceptance criteria, non-functional constraints. | "System must process tabular data from Julia to SvelteKit UI with <200ms latency for 5-member teams." | 95% of requests complete <200ms (synthetic monitoring). |
-| **Specification** | The **technical contract** — precise rules for inputs, outputs, and data shape. Ensures consistency across dev and test. | Developers, QA Engineers, CI/CD pipelines | OpenAPI, Protobuf, AsyncAPI. Endpoint definitions, schemas, error codes. | `contract.yaml` defining a NATS subject that accepts Arrow streams with snake_case headers. | 100% of messages validated against spec (CI block rate). |
-| **Architecture** | The **blueprint** — how components fit together, interact, and scale. Guides system structure and trade-offs. | Architects, Senior Developers, DevOps | C4 diagrams, Mermaid.js, component/network/storage models. | Diagram showing 6-node cluster routing traffic via Caddy → Node.js API → Julia pods. | 100% of major decisions logged with trade-off analysis. |
-| **Walkthrough** | The **story of flow** — shows how pieces connect end-to-end and why steps are sequenced. Builds intuition for new devs. | New Developers, Team Members | TOUR.md, Loom videos, sequence diagrams. Step-by-step traces with rationale. | "UI sends JSON → Node.js wraps Claim-Check → Julia pulls Arrow data (prevents NATS overflow)." | New developers ship feature in <2 days (PR timeline). |
-| **Implementation** | The **real code** — business logic, helpers, tests, configs. Where design becomes executable. | Developers, Code Reviewers | Source code, README.md, unit tests, setup scripts. | Julia function for matrix calculation + SvelteKit component rendering table. | >80% unit test coverage, <5% drift from spec. |
-| **Validation** | The **enforcer** — ensures implementation matches the spec. Blocks drift and human error. | Automation servers, QA, Lead Developers | CI jobs, contract tests, linting, integration checks. | CI job rejects PR with camelCase field not allowed by YAML spec. | <1% of PRs bypass validation gates. |
-| **Runbook** | The **operational manual** — how the system lives in production, scales, and recovers. Guides on-call engineers. | DevOps, SREs, On-call Developers | K8s manifests, Helm charts, Markdown guides. Deployment, scaling, backup/restore, troubleshooting. | GitOps manifest ensuring 6 Julia replicas restart if memory >80%. | MTTR <15 minutes for P1 incidents. |
-
----
-
-## Detailed Document Descriptions
-
-### 1. Requirements
-
-**Purpose**: Capture the *business intent* — why we're building this and what success looks like. Defines boundaries and user-visible outcomes.
-
-**Why It Matters**:
-- Aligns engineering efforts with business goals
-- Provides a north star for feature development
-- Establishes acceptance criteria before implementation begins
-- Creates a contract between product and engineering
-
-**Content Guidelines**:
-- User stories with clear acceptance criteria (As a X, I want Y so that Z)
-- Product Requirements Documents (PRDs) with success metrics
-- Non-functional requirements (performance, security, scalability)
-- Boundary definitions (what's in scope vs. out of scope)
-
-**Best Practices**:
-- Link each requirement to a measurable KPI
-- Keep requirements testable and verifiable
-- Maintain backward compatibility with existing requirements
-- Review and update requirements as business context changes
-
----
-
-### 2. Specification
-
-**Purpose**: The *technical contract* — precise rules for inputs, outputs, and data shape. Ensures consistency across dev and test.
-
-**Why It Matters**:
-- Prevents implementation drift between components
-- Enables contract testing in CI/CD pipelines
-- Provides a single source of truth for data structures
-- Facilitates integration between teams
-
-**Content Guidelines**:
-- API endpoint definitions (methods, paths, parameters)
-- Request/response schemas (JSON, XML, Protobuf, AsyncAPI)
-- Error codes and their meanings
-- Data validation rules and constraints
-- Rate limiting and quota definitions
-
-**Best Practices**:
-- Use formal specification languages (OpenAPI 3.0+, AsyncAPI)
-- Version specifications alongside code
-- Generate client SDKs from specifications
-- Block CI on specification violations
-- Document edge cases and error scenarios
-
----
-
-### 3. Architecture
-
-**Purpose**: The *blueprint* — how components fit together, interact, and scale. Guides system structure and trade-offs.
-
-**Why It Matters**:
-- Provides a mental model for system design
-- Guides technical decision-making and trade-off analysis
-- Facilitates onboarding of new architects and senior developers
-- Documents scaling and performance considerations
-
-**Content Guidelines**:
-- C4 diagrams (Context, Container, Component levels)
-- Mermaid.js flowcharts for sequence diagrams
-- Component interaction diagrams
-- Network topology and data flow
-- Storage and caching strategies
-- Scaling and resilience patterns
-
-**Best Practices**:
-- Use diagrams that are easy to update (Mermaid.js over static images)
-- Document trade-off decisions with Rationale Documents
-- Include scaling considerations for each component
-- Document failure modes and recovery strategies
-- Keep architecture diagrams versioned with code
-
----
-
-### 4. Walkthrough
-
-**Purpose**: The *story of flow* — shows how pieces connect end-to-end and why steps are sequenced. Builds intuition for new devs.
-
-**Why It Matters**:
-- Reduces onboarding time for new developers
-- Provides context that code comments alone cannot convey
-- Explains the "why" behind architectural decisions
-- Helps identify gaps in the system design
-
-**Content Guidelines**:
-- Step-by-step flow descriptions with rationale
-- Sequence diagrams showing request/response patterns
-- "Tour of the codebase" guides
-- Video walkthroughs (Loom, internal recordings)
-- Debugging and tracing examples
-
-**Best Practices**:
-- Walk through real user journeys, not just technical flows
-- Include "what could go wrong" scenarios
-- Link walkthroughs to relevant code locations
-- Keep walkthroughs updated with architecture changes
-- Make walkthroughs interactive where possible
-
----
-
-### 5. Implementation
-
-**Purpose**: The *real code* — business logic, helpers, tests, configs. Where design becomes executable.
-
-**Why It Matters**:
-- This is the actual artifact that runs in production
-- Code is the ultimate source of truth (when it matches spec)
-- Tests validate correctness and prevent regressions
-- Configuration files define runtime behavior
-
-**Content Guidelines**:
-- Business logic implementation
-- Helper functions and utilities
-- Unit and integration tests
-- Configuration files (YAML, JSON, environment)
-- Setup and development scripts
-- Code organization and module structure
-
-**Best Practices**:
-- Follow consistent code style and conventions
-- Write tests before or alongside implementation (TDD/BDD)
-- Document complex logic with inline comments
-- Keep configuration externalized and versioned
-- Use type annotations where applicable
-
----
-
-### 6. Validation
-
-**Purpose**: The *enforcer* — ensures implementation matches the spec. Blocks drift and human error.
-
-**Why It Matters**:
-- Prevents breaking changes from reaching production
-- Catches specification violations early in the CI pipeline
-- Maintains data integrity and API consistency
-- Reduces manual QA effort through automation
-
-**Content Guidelines**:
-- CI/CD pipeline configurations
-- Contract testing scripts
-- Linting rules and configurations
-- Integration test suites
-- Schema validation jobs
-- Security scanning and audit jobs
-
-**Best Practices**:
-- Fail CI on specification violations
-- Run validation jobs on every commit and PR
-- Use automated code review tools
-- Maintain validation job health dashboard
-- Document validation failure remediation steps
-
----
-
-### 7. Runbook
-
-**Purpose**: The *operational manual* — how the system lives in production, scales, and recovers. Guides on-call engineers.
-
-**Why It Matters**:
-- Reduces Mean Time To Recovery (MTTR) for incidents
-- Provides step-by-step guidance for common issues
-- Documents scaling and deployment procedures
-- Ensures operational knowledge is not siloed
-
-**Content Guidelines**:
-- Deployment procedures (manual and automated)
-- Scaling instructions (horizontal/vertical)
-- Backup and restore procedures
-- Troubleshooting guides for common issues
-- Runbook entries for specific error codes
-- Contact information and escalation paths
-
-**Best Practices**:
-- Write runbooks for every P1/P2 incident
-- Include exact commands and configuration snippets
-- Test runbooks periodically (chaos engineering)
-- Link runbook entries to relevant documentation
-- Keep runbooks updated when system changes
-
----
-
-## How to Use This Approach Effectively
-
-### 1. Start with Requirements
-
-Before writing any code or documentation, establish clear requirements. Ask:
-- What business problem are we solving?
-- How will we measure success?
-- What are the non-negotiable constraints?
-
-**Action**: Create a `docs/requirements/` directory and start with `PRD.md` and `KPIs.md`.
-
-### 2. Define the Specification First
-
-Once requirements are stable, define the technical specification. This becomes the contract for implementation.
-
-**Action**: Create `docs/specification/` with `contract.yaml` (or appropriate format) and `error-codes.md`.
-
-### 3. Design the Architecture
-
-With requirements and specification in place, design the architecture. Document trade-off decisions explicitly.
-
-**Action**: Create `docs/architecture/` with Mermaid diagrams and `trade-offs.md`.
-
-### 4. Create Walkthroughs Early
-
-As soon as the architecture is defined, create walkthroughs. This helps identify gaps and provides onboarding material.
-
-**Action**: Create `docs/walkthrough/` with `TOUR.md` and sequence diagrams.
-
-### 5. Implement with Validation in Mind
-
-Write implementation code that adheres to the specification. Build validation into the CI pipeline from day one.
-
-**Action**: Ensure test files are co-located with implementation and run on every commit.
-
-### 6. Automate Validation
-
-Build automated validation that runs in CI/CD. This ensures spec compliance and prevents drift.
-
-**Action**: Configure CI jobs to validate against specification and block PRs on violations.
-
-### 7. Document Operations from Day One
-
-Create runbook entries as soon as deployment procedures are established. Update them when incidents occur.
-
-**Action**: Create `docs/runbook/` with entries for deployment, scaling, and common issues.
-
----
-
-## GitOps Integration
-
-This documentation framework aligns with GitOps principles:
-
-| GitOps Principle | Documentation Alignment |
-|-----------------|------------------------|
-| **Versioned** | All documentation lives in git, with history and audit trail |
-| ** declarative** | Specifications and architecture are declarative contracts |
-| **Automated** | Validation jobs automate spec compliance checks |
-| **Self-Service** | Walkthroughs and runbooks enable self-service onboarding and operations |
-| **Observability** | KPIs and metrics are defined for each documentation artifact |
-
-**Git Structure**:
-```
-docs/
-├── requirements/ # PRDs, user stories, KPIs
-├── specification/ # OpenAPI, Protobuf, AsyncAPI specs
-├── architecture/ # C4 diagrams, Mermaid, trade-off docs
-├── walkthrough/ # TOUR.md, sequence diagrams
-├── implementation/ # Source code (in src/)
-├── validation/ # CI configs, test suites
-└── runbook/ # Deployment, scaling, troubleshooting
-```
-
----
-
-## Metrics and Continuous Improvement
-
-Each documentation artifact has associated KPIs. Track these to ensure quality:
-
-| Document | KPI | Target |
-|----------|-----|--------|
-| Requirements | Requirement coverage | 100% of features have associated requirements |
-| Specification | Spec compliance rate | 100% of messages validate against spec |
-| Architecture | Decision documentation | 100% of major decisions logged with trade-offs |
-| Walkthrough | New dev time-to-first-PR | <2 days from onboarding to first contribution |
-| Implementation | Test coverage | >80% unit test coverage |
-| Validation | Bypass rate | <1% of PRs bypass validation gates |
-| Runbook | MTTR | <15 minutes for P1 incidents |
-
-**Review Cadence**:
-- Weekly: Review KPI dashboards and documentation gaps
-- Monthly: Update documentation based on incident learnings
-- Quarterly: Full framework review and improvement
-
----
-
-## Template Examples
-
-### Requirements Template
-```markdown
-# PRD: Feature Name
-
-## Business Goal
-[What problem are we solving?]
-
-## Success Metrics
-- [Metric 1]: Target [value]
-- [Metric 2]: Target [value]
-
-## User Stories
-- As a [role], I want [feature] so that [benefit]
- - Acceptance Criteria: [details]
-
-## Non-Functional Requirements
-- Performance: [details]
-- Security: [details]
-- Scalability: [details]
-
-## Out of Scope
-- [What's explicitly excluded]
-```
-
-### Specification Template
-```yaml
-# contract.yaml
-openapi: 3.0.0
-info:
- title: NATSBridge API
- version: 1.0.0
-paths:
- /api/v1/endpoint:
- post:
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Request'
- responses:
- '200':
- description: Success
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Response'
-```
-
-### Architecture Template
-```mermaid
-%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#3b82f6'}}}%%
-flowchart TD
- A[Client] --> B[Caddy]
- B --> C[Node.js API]
- C --> D[Julia Worker]
- D --> E[NATS Cluster]
- E --> F[Storage]
-
- style A fill:#f9f9f9,stroke:#333
- style E fill:#e0e7ff,stroke:#3b82f6
-```
-
-### Runbook Template
-```markdown
-# Runbook: Service Restart
-
-**Severity**: P2
-**Estimated Time**: 5 minutes
-
-## Symptoms
-- Service is unresponsive
-- Health checks are failing
-
-## Steps
-1. SSH to the host
-2. Run: `kubectl rollout restart deployment/natsbridge`
-3. Monitor: `kubectl get pods -l app=natsbridge -w`
-
-## Rollback
-- Run: `kubectl rollout undo deployment/natsbridge`
-
-## Post-Incident
-- [ ] Review logs for root cause
-- [ ] Update runbook if needed
-```
-
----
-
-## Conclusion
-
-This SDD + GitOps Documentation Framework ensures that documentation is:
-- **Structured**: Seven distinct artifacts with clear purposes
-- **Automated**: Validation and CI/CD integration
-- **Versioned**: All documentation in git with history
-- **Measurable**: KPIs for quality and effectiveness
-- **Actionable**: Practical templates and examples
-
-Use this framework as a living document—update it as your team's needs evolve.
\ No newline at end of file
diff --git a/docs/architecture.md b/docs/architecture.md
index 2697ccf..592fd7d 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -1,16 +1,16 @@
# Architecture Documentation: NATSBridge
**Version**: 1.1.0
-**Date**: 2026-03-15
+**Date**: 2026-03-23
**Status**: Active
**Ground Truth**: [`src/NATSBridge.jl`](../src/NATSBridge.jl)
**Architecture Level**: C4 Container Level
---
-## Executive Summary
+## 1. Executive Summary
-This document defines the **blueprint** for NATSBridge - the cross-platform bi-directional data bridge that enables seamless communication between **Julia**, **JavaScript**, **Python**, and **MicroPython** applications using NATS as the message bus.
+This document defines the **blueprint** for NATSBridge - the cross-platform bi-directional data bridge that enables seamless communication between **Julia**, **JavaScript**, **Python**, **Dart**, and **MicroPython** applications using NATS as the message bus.
This architecture document serves as the single source of truth for:
- **System Structure**: How components fit together and interact
@@ -18,8 +18,29 @@ This architecture document serves as the single source of truth for:
- **Failure Modes**: How the system handles failures and recovers
- **Trade-off Decisions**: The rationale behind architectural decisions
+### 1.1 Specification Traceability
+
+| Architecture Section | Specification Reference | UI Specification Reference | Requirement ID(s) |
+|---------------------|-------------------------|---------------------------|-------------------|
+| Section 2 (Context Diagram) | specification.md:2 | - | FR-001, FR-002, FR-003, FR-004, FR-005, FR-006, FR-007, FR-012, FR-013, FR-014 |
+| Section 3 (Container Diagram) | specification.md:2, specification.md:3, specification.md:11 | - | FR-001, FR-002, FR-003, FR-004, FR-005, FR-006, FR-007, FR-012, FR-013, FR-014 |
+| Section 4 (Component Diagram) | specification.md:2, specification.md:3, specification.md:5, specification.md:11 | - | FR-001, FR-002, FR-003, FR-004, FR-005, FR-006, FR-007, FR-012, FR-013, FR-014 |
+| Section 5 (High-Level) | specification.md:2, specification.md:3, specification.md:5, specification.md:11 | - | FR-001, FR-002, FR-003, FR-004, FR-005, FR-006, FR-007, FR-012, FR-013, FR-014 |
+| Section 6 (Message Envelope) | specification.md:2, specification.md:3, specification.md:8 | - | FR-011, FR-012, FR-013, FR-014, NFR-401, NFR-403 |
+| Section 7 (Payload Type) | specification.md:3, specification.md:5, specification.md:6 | - | FR-001, FR-002, FR-003, FR-006, FR-012, NFR-101, NFR-102 |
+| Section 8 (Transport Strategy) | specification.md:6, specification.md:7 | - | FR-003, FR-004, FR-005, FR-010, NFR-104, NFR-105, NFR-106 |
+| Section 9 (Platform-Specific) | specification.md:13, specification.md:14 | - | FR-001, FR-002, FR-003, FR-004, FR-005, FR-006, FR-007, FR-012, FR-013, FR-014 |
+| Section 10 (Scaling) | specification.md:7, specification.md:13 | - | NFR-101, NFR-102, NFR-103, NFR-104, NFR-105, NFR-106, NFR-107 |
+| Section 11 (Failure Modes) | specification.md:9, specification.md:11 | - | FR-008, FR-009, FR-010, FR-011, NFR-201, NFR-202, NFR-203 |
+| Section 12 (Trade-offs) | specification.md:2, specification.md:3, specification.md:6, specification.md:7 | - | FR-001, FR-002, FR-003, FR-004, FR-005, FR-006, FR-007, FR-008, FR-009, FR-010, FR-011, FR-012, FR-013, FR-014 |
+| Section 13 (Deployment) | specification.md:12, specification.md:18 | - | FR-013, FR-014, NFR-201, NFR-203 |
+| Section 14 (Security) | specification.md:4, specification.md:9, specification.md:12 | - | NFR-301, NFR-302, NFR-303, NFR-401, NFR-402, NFR-403, NFR-404, NFR-405 |
+| Section 15 (Testing) | specification.md:17 | - | FR-001, FR-002, FR-003, FR-004, FR-005, FR-006, FR-007, FR-012, FR-013, FR-014 |
+
---
+## 2. Architecture Overview
+
## Architecture Overview
### C4 Context Diagram
@@ -35,17 +56,20 @@ flowchart TD
Julia_App[Julia Application]
JS_App[JavaScript Application
Node.js/Browser]
Python_App[Python Application
Desktop]
+ Dart_App[Dart Application
Desktop/Flutter/Web]
MicroPython_App[MicroPython Device]
end
Julia_App -->|NATS| NATS_Server
JS_App -->|NATS| NATS_Server
Python_App -->|NATS| NATS_Server
+ Dart_App -->|NATS| NATS_Server
MicroPython_App -->|NATS| NATS_Server
Julia_App -->|HTTP| File_Server
JS_App -->|HTTP| File_Server
Python_App -->|HTTP| File_Server
+ Dart_App -->|HTTP| File_Server
MicroPython_App -->|HTTP| File_Server
style NATS_Server fill:#fff3e0,stroke:#f57c00
@@ -53,6 +77,7 @@ flowchart TD
style Julia_App fill:#e8f5e9,stroke:#4caf50
style JS_App fill:#e3f2fd,stroke:#2196f3
style Python_App fill:#e3f2fd,stroke:#2196f3
+ style Dart_App fill:#fff0f6,stroke:#e91e63
style MicroPython_App fill:#fce4ec,stroke:#e91e63
```
@@ -64,6 +89,7 @@ flowchart TD
Julia_Module[Julia NATSBridge Module]
JS_Module[JavaScript NATSBridge Module]
Python_Module[Python NATSBridge Module]
+ Dart_Module[Dart NATSBridge Module]
MicroPython_Module[MicroPython NATSBridge Module]
end
@@ -80,6 +106,7 @@ flowchart TD
Julia_Module --> NATS_Client
JS_Module --> NATS_Client
Python_Module --> NATS_Client
+ Dart_Module --> NATS_Client
MicroPython_Module --> NATS_Client
NATS_Client --> NATS_Broker
@@ -87,6 +114,7 @@ flowchart TD
Julia_Module --> File_Client
JS_Module --> File_Client
Python_Module --> File_Client
+ Dart_Module --> File_Client
MicroPython_Module --> File_Client
File_Client --> File_Server
@@ -94,6 +122,7 @@ flowchart TD
style Julia_Module fill:#e8f5e9,stroke:#4caf50
style JS_Module fill:#e3f2fd,stroke:#2196f3
style Python_Module fill:#e3f2fd,stroke:#2196f3
+ style Dart_Module fill:#fff0f6,stroke:#e91e63
style MicroPython_Module fill:#fce4ec,stroke:#e91e63
style NATS_Broker fill:#fff3e0,stroke:#f57c00
style File_Server fill:#f3e5f5,stroke:#9c27b4
@@ -159,8 +188,8 @@ flowchart TD
| **_build_envelope** | Build message envelope from payloads | All |
| **_build_payload** | Build payload object from serialized data | All |
| **publish_message** | Publish message to NATS subject | All |
-| **fileserver_upload_handler** | Upload large payloads to HTTP server | Desktop |
-| **fileserver_download_handler** | Download payloads from HTTP server | Desktop |
+| **fileserver_upload_handler** | Upload large payloads to HTTP server | Desktop (Julia/JS/Python/Dart) |
+| **fileserver_download_handler** | Download payloads from HTTP server | Desktop (Julia/JS/Python/Dart) |
### Data Flow
@@ -275,8 +304,8 @@ end
|------|-------------|---------------|----------|-----------|
| `text` | Plain text string | UTF-8 bytes | Base64 | All |
| `dictionary` | JSON object | JSON string | Base64/JSON | All |
-| `arrowtable` | Apache Arrow IPC | Arrow IPC stream | Base64/arrow-ipc | Desktop (Julia/Python/Node.js) |
-| `jsontable` | JSON array of objects | JSON string | Base64/json | All (including Browser) |
+| `arrowtable` | Apache Arrow IPC | Arrow IPC stream | Base64/arrow-ipc | Desktop (Julia/Python/Node.js/Dart) |
+| `jsontable` | JSON array of objects | JSON string | Base64/json | All (including Browser/Dart Web) |
| `image` | Binary image data | Raw bytes | Base64 | All |
| `audio` | Binary audio data | Raw bytes | Base64 | All |
| `video` | Binary video data | Raw bytes | Base64 | All |
@@ -318,7 +347,10 @@ flowchart TD
| Platform | Size Threshold | Notes |
|----------|----------------|-------|
-| Desktop (Julia/JS/Python) | 500,000 bytes (0.5MB) | Default threshold |
+| Desktop (Julia/JS/Python/Dart) | 500,000 bytes (0.5MB) | Default threshold |
+| Dart Desktop | 500,000 bytes (0.5MB) | Default threshold |
+| Dart Flutter | 500,000 bytes (0.5MB) | Default threshold |
+| Dart Web | 500,000 bytes (0.5MB) | Default threshold |
| MicroPython | 100,000 bytes (100KB) | Lower threshold for memory constraints |
### Transport Selection Flow
@@ -489,6 +521,50 @@ class NATSBridge:
self.fileserver_url = fileserver_url or self.DEFAULT_FILESERVER_URL
```
+### Dart Architecture
+
+Dart uses classes for stateful operations with async/await:
+
+- **Class-based NATSBridge**: Encapsulated API
+- **Data classes**: Structured data (MsgPayloadV1, MsgEnvelopeV1)
+- **Async/await**: I/O operations
+- **dart-arrow**: Arrow IPC support (Desktop/Flutter only)
+- **HTTP package**: HTTP file server communication
+- **nats package**: NATS client with WebSocket support (Dart Web)
+
+```dart
+class NATSBridge {
+ static const DEFAULT_SIZE_THRESHOLD = 500000;
+
+ final String brokerUrl;
+ final String fileserverUrl;
+
+ NATSBridge({
+ this.brokerUrl = 'nats://localhost:4222',
+ this.fileserverUrl = 'http://localhost:8080',
+ });
+}
+```
+
+#### Dart Desktop (Dart SDK)
+
+- **TCP NATS connections**: Uses `nats://` or `tls://` URLs
+- **Apache Arrow IPC**: Full support via `dart-arrow`
+- **Uint8List for binary data**: Native Dart binary handling
+
+#### Dart Flutter (Dart SDK)
+
+- **TCP NATS connections**: Uses `nats://` or `tls://` URLs
+- **Apache Arrow IPC**: Full support via `dart-arrow`
+- **Uint8List for binary data**: Native Dart binary handling
+
+#### Dart Web (Dart SDK)
+
+- **WebSocket NATS connections**: Uses `ws://` or `wss://` URLs via `nats` package
+- **No Apache Arrow**: Uses `jsontable` for tabular data only
+- **Uint8List for binary data**: Browser-compatible binary handling
+- **Fetch API**: HTTP file server communication via `http` package
+
### Browser Architecture
Browser JavaScript has specific constraints due to security and compatibility:
@@ -655,7 +731,7 @@ MAX_PAYLOAD_SIZE = 50_000 # 50KB hard limit
|-----------|---------|-------|
| NATS Server | 1 instance | Single node for development |
| File Server | 1 instance | HTTP server for large payloads |
-| Client Memory | 50MB | Desktop platforms |
+| Client Memory | 50MB | Desktop platforms (Julia/JS/Python/Dart) |
| Client Memory | 256KB | MicroPython devices |
### Environment Variables
@@ -750,7 +826,7 @@ flowchart TD
| Version | Supported Platforms |
|---------|---------------------|
-| v1.0.x | Julia 1.7+, Node.js 16+, Python 3.8+, MicroPython 1.19+ |
+| v1.0.x | Julia 1.7+, Node.js 16+, Python 3.8+, Dart 2.17+, MicroPython 1.19+ |
---
@@ -766,12 +842,77 @@ flowchart TD
---
-## References
+## 16. References
-- [`docs/requirements.md`](./requirements.md) - Business requirements and user stories
-- [`docs/spec.md`](./spec.md) - Technical specification and contracts
-- [`src/NATSBridge.jl`](../src/NATSBridge.jl) - Ground truth implementation
-- [`README.md`](../README.md) - Project overview
+### 16.1 Documentation Artifacts
+
+| Document | Purpose | Specification Traceability | UI Specification Traceability | Requirement ID(s) |
+|----------|---------|---------------------------|------------------------------|-------------------|
+| [`docs/requirements.md`](./requirements.md) | Business requirements and user stories | FR-001 through FR-014, NFR-101 through NFR-405 | - | FR-001 through FR-014, NFR-101 through NFR-405 |
+| [`docs/specification.md`](./specification.md) | Technical contract for NATSBridge | specification.md:2-19 (all sections) | - | FR-001 through FR-014, NFR-101 through NFR-405 |
+| [`docs/ui-specification.md`](./ui-specification.md) | UI specification for client applications | - | All UI components and interactions | FR-001 through FR-014, NFR-101 through NFR-405 |
+| [`docs/walkthrough.md`](./walkthrough.md) | End-to-end system flow | specification.md:2-19 (all sections) | - | FR-001 through FR-014, NFR-101 through NFR-405 |
+| [`docs/architecture.md`](./architecture.md) | System architecture diagrams | specification.md:2-19 (all sections) | - | FR-001 through FR-014, NFR-101 through NFR-405 |
+| [`docs/validation.md`](./validation.md) | CI/CD validation rules | specification.md:2-19 (all sections) | - | FR-001 through FR-014, NFR-101 through NFR-405 |
+| [`docs/runbook.md`](./runbook.md) | Operational runbook | specification.md:2-19 (all sections) | - | FR-001 through FR-014, NFR-101 through NFR-405 |
+
+### 16.2 Implementation Files
+
+| File | Platform | Features | Specification Traceability | Requirement ID(s) |
+|------|----------|----------|---------------------------|-------------------|
+| [`src/NATSBridge.jl`](../src/NATSBridge.jl) | Julia | Full feature set, Arrow IPC, multiple dispatch | specification.md:2-19 (all sections) | FR-001 through FR-014, NFR-101 through NFR-405 |
+| [`src/natsbridge_ssr.js`](../src/natsbridge_ssr.js) | Node.js | Arrow IPC, async/await | specification.md:2-19 (all sections) | FR-001 through FR-014, NFR-101 through NFR-405 |
+| [`src/natsbridge_csr.js`](../src/natsbridge_csr.js) | Browser | JSON table only, WebSocket NATS | specification.md:2-19 (all sections) | FR-001 through FR-014, NFR-101 through NFR-405 |
+| [`src/natsbridge.py`](../src/natsbridge.py) | Python | Arrow IPC, async/await | specification.md:2-19 (all sections) | FR-001 through FR-014, NFR-101 through NFR-405 |
+| [`src/natsbridge.dart`](../src/natsbridge.dart) | Dart | Full feature set, Arrow IPC, async/await | specification.md:2-19 (all sections) | FR-001 through FR-014, NFR-101 through NFR-405 |
+| [`src/natsbridge_mpy.py`](../src/natsbridge_mpy.py) | MicroPython | Limited to direct transport | specification.md:2-19 (all sections) | FR-005, FR-006, FR-012 |
+
+### 16.3 External Dependencies
+
+| Platform | Package | Version | Purpose | Specification Traceability | Requirement ID(s) |
+|----------|---------|---------|---------|---------------------------|-------------------|
+| Julia | NATS.jl | Latest | NATS client | specification.md:11 | FR-013, FR-014, NFR-201 |
+| Julia | JSON.jl | Latest | JSON serialization | specification.md:11 | FR-012, NFR-101, NFR-102 |
+| Julia | Arrow.jl | Latest | Arrow IPC support | specification.md:11 | FR-002, FR-012 |
+| Julia | HTTP.jl | Latest | HTTP file server | specification.md:11 | FR-008, FR-009 |
+| Julia | UUIDs.jl | Latest | UUID generation | specification.md:11 | FR-011, NFR-401 |
+| Node.js | nats | Latest | NATS client (TCP) | specification.md:11 | FR-013, FR-014 |
+| Node.js | node-fetch | Latest | HTTP file server | specification.md:11 | FR-008, FR-009 |
+| Browser | nats.ws | Latest | NATS client (WebSocket) | specification.md:11 | FR-013, FR-014 |
+| Browser | nats | Latest | NATS client (for bundling) | specification.md:11 | FR-013, FR-014 |
+| Python | nats-py | Latest | NATS client | specification.md:11 | FR-013, FR-014 |
+| Python | aiohttp | Latest | HTTP file server | specification.md:11 | FR-008, FR-009 |
+| Python | pyarrow | Latest | Arrow IPC support | specification.md:11 | FR-002, FR-012 |
+| Dart | nats | Latest | NATS client | specification.md:11 | FR-013, FR-014 |
+| Dart | http | Latest | HTTP file server | specification.md:11 | FR-008, FR-009 |
+| Dart | uuid | Latest | UUID generation | specification.md:11 | FR-011, NFR-401 |
+| Dart | dart-arrow | Latest | Arrow IPC support | specification.md:11 | FR-002, FR-012 |
+| MicroPython | builtin | N/A | Limited implementation | specification.md:11 | FR-005, FR-006, FR-012 |
+
+---
+
+## 17. Change Log
+
+| Date | Version | Changes | Specification Reference |
+|------|---------|---------|------------------------|
+| 2026-03-23 | 1.1.0 | Updated to ASG Framework architecture guidelines | specification.md:2-19 (all sections) |
+| 2026-03-15 | 1.1.0 | JavaScript connection management | specification.md:2-19 (all sections) |
+| 2026-03-13 | 1.0.0 | Initial architecture documentation | specification.md:2-19 (all sections) |
+
+---
+
+## 18. Gap-Check Validation
+
+| Stage Transition | Gap-Check Question | Status |
+|------------------|-------------------|--------|
+| Requirements → Specification | Does the Specification define all edge cases and conflict scenarios from the Requirements? | ✅ Verified - All FR-XXX requirements have corresponding spec rules |
+| Specification → UI Specification | Does the UI Specification expose all the data and states defined in the Specification? | ⏳ Pending - UI spec not yet created |
+| UI Specification → Walkthrough | Does the Walkthrough reflect the complete flow including error states and timing? | ⏳ Pending - UI spec not yet created |
+| Walkthrough → Architecture | Does the Architecture support the performance and integration requirements defined in the Walkthrough? | ✅ Verified - Architecture supports all walkthrough flows |
+
+---
+
+*This architecture document is versioned and maintained in git alongside the codebase. All implementations must adhere to this architecture.*
---
diff --git a/docs/requirements.md b/docs/requirements.md
index a0cfaea..ed178da 100644
--- a/docs/requirements.md
+++ b/docs/requirements.md
@@ -1,33 +1,38 @@
# Requirements Document: NATSBridge
**Version**: 1.0.0
-**Date**: 2026-03-13
+**Date**: 2026-03-23
**Status**: Active
**Ground Truth**: [`src/NATSBridge.jl`](../src/NATSBridge.jl)
---
-## Executive Summary
+## 1. Business Context & Success Metrics
-NATSBridge is a cross-platform, bi-directional data bridge that enables seamless communication between **Julia**, **JavaScript**, **Python**, and **MicroPython** applications using NATS as the message bus. The system implements the **Claim-Check pattern** for efficient handling of large payloads (>0.5MB) by uploading them to an HTTP file server instead of sending raw binary data over NATS.
+### 1.1 Business Goal
----
+NATSBridge is a cross-platform, bi-directional data bridge that enables seamless communication between **Julia**, **JavaScript**, **Python**, **Dart**, and **MicroPython** applications using NATS as the message bus. The system implements the **Claim-Check pattern** for efficient handling of large payloads (>0.5MB) by uploading them to an HTTP file server instead of sending raw binary data over NATS.
-## Business Goals
+### 1.2 User Stories (with acceptance criteria)
-### Primary Objectives
+| Story | Priority | Acceptance Criteria |
+|-------|----------|---------------------|
+| **As a Julia developer**, I want to send text messages to JavaScript/Dart applications that lives on a server and also on a browser | P1 | Text messages are serialized, encoded, and received correctly across platforms |
+| **As a Python developer**, I want to send tabular data to Julia/Dart applications | P1 | DataFrame exchange works with both Arrow IPC and JSON formats |
+| **As a JavaScript developer**, I want to send large files (>0.5MB) from JavaScript applications that lives on a server and also on a browser to other applications | P1 | Large files are automatically uploaded to file server and URLs are sent via NATS |
+| **As a Dart developer**, I want to send text messages to other platforms | P1 | Text messages are serialized, encoded, and received correctly across platforms |
+| **As a Dart developer**, I want to send dictionary data to other platforms | P1 | JSON-serializable data is exchanged correctly |
+| **As a Dart developer**, I want to send tabular data (List