Repository navigation
Architecture Overview
The objective of this project is to demonstrate how MySQL JSON Duality Views can be used to build a complete business application while maintaining a single source of truth in a relational database.
Instead of maintaining separate database and document models, the application exposes relational data as JSON documents that can be consumed directly by APIs and user interfaces.
+--------------------+
| Web Client |
+----------+---------+
|
v
+--------------------+
| REST API |
| Node.js / TS |
+----------+---------+
|
v
+--------------------+
| JSON Duality Views |
+----------+---------+
|
v
+--------------------+
| Relational Tables |
+--------------------+
The browser-based user interface allows users to:
- View inspection cards
- Edit inspection data
- Record measurements
- Complete checklists
- Review findings
- Access AI-generated insights
The client communicates exclusively through REST APIs.
The API layer exposes application functionality to users and external systems.
Responsibilities include:
- Authentication
- Validation
- Optimistic locking
- Business rules
- AI integration
- Error handling
The API does not perform complex object mapping because the database already exposes JSON documents using Duality Views.
JSON Duality Views act as the application document model.
Each inspection card can be represented as a complete JSON document containing:
- Card information
- Measurements
- Checklist items
- Findings
- Attachments
This minimizes transformation between relational and JSON formats.
The underlying database remains fully relational.
Benefits include:
- Data integrity
- Foreign keys
- Constraints
- Transaction support
- Relational reporting
The project demonstrates that document-oriented development and relational database design can coexist.
The project includes AI capabilities designed specifically for quality inspection scenarios.
Inspection Data
|
v
Read-Only AI Boundary
|
v
AI Service
|
v
Generated Insights
Examples include:
- Inspection explanations
- Quality summaries
- Work-order analysis
- Manufacturing statistics
The AI layer operates using approved read-only business documents.
The architecture follows the principle of least privilege.
Key principles:
- API users only receive required access
- AI components use read-only access
- Database integrity remains enforced by relational constraints
- Business rules are validated before updates are committed
User → API → Duality View → Relational Tables
User → API → Duality View Document
Inspection Document → AI Boundary → AI Service → Response
Applications consume JSON documents directly.
Tables remain normalized and protected by constraints.
Business documents can be consumed by AI services without complex transformations.
Developers work with document structures while preserving relational storage.