retold-harness 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/README.md +124 -85
  2. package/docker-compose.yml +107 -0
  3. package/docs/README.md +10 -21
  4. package/docs/_cover.md +11 -0
  5. package/docs/_sidebar.md +15 -1
  6. package/docs/_topbar.md +2 -0
  7. package/docs/api/meadow-provider-configurator.md +293 -0
  8. package/docs/api/process-manager.md +280 -0
  9. package/docs/api/reference.md +35 -0
  10. package/docs/api/retold-harness.md +118 -0
  11. package/docs/api/schema-provider.md +321 -0
  12. package/docs/architecture.md +172 -0
  13. package/docs/css/docuserve.css +73 -0
  14. package/docs/docker.md +2 -3
  15. package/docs/index.html +1 -1
  16. package/docs/management-tool.md +201 -0
  17. package/docs/provider-configurators.md +292 -0
  18. package/docs/retold-catalog.json +182 -0
  19. package/docs/retold-keyword-index.json +15205 -0
  20. package/docs/schema-providers.md +236 -0
  21. package/package.json +33 -21
  22. package/source/Retold-Harness.js +68 -97
  23. package/source/management-tool/Provider-Definitions.js +101 -0
  24. package/source/management-tool/Retold-Harness-Management-Tool.js +853 -0
  25. package/source/management-tool/Service-ProcessManager.js +493 -0
  26. package/source/management-tool/bin/retold-harness-management-tool.js +2 -0
  27. package/source/management-tool/docs/dgraph/linux.md +99 -0
  28. package/source/management-tool/docs/dgraph/mac.md +87 -0
  29. package/source/management-tool/docs/dgraph/windows.md +111 -0
  30. package/source/management-tool/docs/mongodb/linux.md +107 -0
  31. package/source/management-tool/docs/mongodb/mac.md +90 -0
  32. package/source/management-tool/docs/mongodb/windows.md +112 -0
  33. package/source/management-tool/docs/mssql/linux.md +109 -0
  34. package/source/management-tool/docs/mssql/mac.md +90 -0
  35. package/source/management-tool/docs/mssql/windows.md +106 -0
  36. package/source/management-tool/docs/mysql/linux.md +128 -0
  37. package/source/management-tool/docs/mysql/mac.md +96 -0
  38. package/source/management-tool/docs/mysql/windows.md +114 -0
  39. package/source/management-tool/docs/postgresql/linux.md +120 -0
  40. package/source/management-tool/docs/postgresql/mac.md +92 -0
  41. package/source/management-tool/docs/postgresql/windows.md +111 -0
  42. package/source/management-tool/docs/solr/linux.md +112 -0
  43. package/source/management-tool/docs/solr/mac.md +92 -0
  44. package/source/management-tool/docs/solr/windows.md +98 -0
  45. package/source/management-tool/docs/sqlite/linux.md +98 -0
  46. package/source/management-tool/docs/sqlite/mac.md +70 -0
  47. package/source/management-tool/docs/sqlite/windows.md +86 -0
  48. package/source/management-tool/views/View-Dashboard.js +69 -0
  49. package/source/management-tool/views/View-Detail.js +141 -0
  50. package/source/management-tool/views/View-Docs.js +95 -0
  51. package/source/management-tool/views/View-Header.js +49 -0
  52. package/source/management-tool/views/View-Layout.js +66 -0
  53. package/source/management-tool/views/View-Log.js +95 -0
  54. package/source/management-tool/views/View-StatusBar.js +66 -0
  55. package/source/providers/Retold-Harness-Service-MeadowProviderConfigurator.js +172 -0
  56. package/source/providers/Retold-Harness-Service-Provider-DGraph.js +116 -0
  57. package/source/providers/Retold-Harness-Service-Provider-MSSQL.js +182 -0
  58. package/source/providers/Retold-Harness-Service-Provider-MongoDB.js +116 -0
  59. package/source/providers/Retold-Harness-Service-Provider-MySQL.js +180 -0
  60. package/source/providers/Retold-Harness-Service-Provider-PostgreSQL.js +179 -0
  61. package/source/providers/Retold-Harness-Service-Provider-SQLite.js +104 -0
  62. package/source/providers/Retold-Harness-Service-Provider-Solr.js +116 -0
  63. package/source/schemas/Retold-Harness-Service-Schema-Bookstore.js +124 -0
  64. package/source/schemas/Retold-Harness-Service-Schema-Entertainment.js +198 -0
  65. package/source/schemas/Retold-Harness-Service-Schema-USFederalData.js +170 -0
  66. package/source/schemas/Retold-Harness-Service-SchemaProvider.js +110 -0
  67. package/source/schemas/bookstore/Schema.json +4310 -0
  68. package/source/schemas/bookstore/mssql_create/BookStore-SeedData.sql +29503 -0
  69. package/source/schemas/bookstore/pgsql_create/BookStore-SeedData.sql +29497 -0
  70. package/source/schemas/configuration-bookstore-serve-api.js +89 -0
  71. package/source/schemas/configuration-entertainment-serve-api.js +89 -0
  72. package/source/schemas/configuration-us-federal-data-serve-api.js +89 -0
  73. package/source/schemas/entertainment/Entertainment.ddl +266 -0
  74. package/source/schemas/entertainment/MeadowModel-Extended.json +9768 -0
  75. package/source/schemas/entertainment/MeadowModel-PICT.json +1 -0
  76. package/source/schemas/entertainment/MeadowModel.json +1238 -0
  77. package/source/schemas/entertainment/Schema.json +9768 -0
  78. package/source/schemas/entertainment/curated/concerts.json +181 -0
  79. package/source/schemas/entertainment/curated/soundtracks.json +202 -0
  80. package/source/schemas/entertainment/ingestion/ingest-entertainment-data.js +2434 -0
  81. package/source/schemas/entertainment/ingestion/mapping-album.json +12 -0
  82. package/source/schemas/entertainment/ingestion/mapping-artist.json +13 -0
  83. package/source/schemas/entertainment/ingestion/mapping-movie-credit.json +13 -0
  84. package/source/schemas/entertainment/ingestion/mapping-movie-rating.json +10 -0
  85. package/source/schemas/entertainment/ingestion/mapping-movie.json +15 -0
  86. package/source/schemas/entertainment/ingestion/mapping-person.json +13 -0
  87. package/source/schemas/entertainment/ingestion/mapping-song.json +12 -0
  88. package/source/schemas/entertainment/ingestion/mapping-venue.json +14 -0
  89. package/source/schemas/entertainment/meadow/MeadowSchemaAlbum.json +543 -0
  90. package/source/schemas/entertainment/meadow/MeadowSchemaAlbumTrack.json +479 -0
  91. package/source/schemas/entertainment/meadow/MeadowSchemaArtist.json +575 -0
  92. package/source/schemas/entertainment/meadow/MeadowSchemaConcert.json +511 -0
  93. package/source/schemas/entertainment/meadow/MeadowSchemaDataSource.json +511 -0
  94. package/source/schemas/entertainment/meadow/MeadowSchemaGenre.json +463 -0
  95. package/source/schemas/entertainment/meadow/MeadowSchemaMovie.json +559 -0
  96. package/source/schemas/entertainment/meadow/MeadowSchemaMovieCredit.json +527 -0
  97. package/source/schemas/entertainment/meadow/MeadowSchemaMovieGenre.json +447 -0
  98. package/source/schemas/entertainment/meadow/MeadowSchemaMovieRating.json +479 -0
  99. package/source/schemas/entertainment/meadow/MeadowSchemaPerson.json +527 -0
  100. package/source/schemas/entertainment/meadow/MeadowSchemaSetlistEntry.json +511 -0
  101. package/source/schemas/entertainment/meadow/MeadowSchemaSong.json +511 -0
  102. package/source/schemas/entertainment/meadow/MeadowSchemaSoundtrack.json +495 -0
  103. package/source/schemas/entertainment/meadow/MeadowSchemaUser.json +399 -0
  104. package/source/schemas/entertainment/meadow/MeadowSchemaVenue.json +559 -0
  105. package/source/schemas/entertainment/sqlite_create/Entertainment-CreateSQLiteTables.sql +303 -0
  106. package/source/schemas/entertainment/sqlite_create/Entertainment-SeedData.sql +34 -0
  107. package/source/schemas/us-federal-data/MeadowModel-Extended.json +6496 -0
  108. package/source/schemas/us-federal-data/MeadowModel-PICT.json +1 -0
  109. package/source/schemas/us-federal-data/MeadowModel.json +835 -0
  110. package/source/schemas/us-federal-data/Schema.json +6496 -0
  111. package/source/schemas/us-federal-data/USFederalData.ddl +179 -0
  112. package/source/schemas/us-federal-data/ingestion/ingest-federal-data.js +1032 -0
  113. package/source/schemas/us-federal-data/ingestion/mapping-city.json +20 -0
  114. package/source/schemas/us-federal-data/ingestion/mapping-congressional-district.json +20 -0
  115. package/source/schemas/us-federal-data/ingestion/mapping-county-subdivision.json +21 -0
  116. package/source/schemas/us-federal-data/ingestion/mapping-county.json +12 -0
  117. package/source/schemas/us-federal-data/ingestion/mapping-state.json +11 -0
  118. package/source/schemas/us-federal-data/ingestion/mapping-zipcode.json +16 -0
  119. package/source/schemas/us-federal-data/meadow/MeadowSchemaCensusDivision.json +463 -0
  120. package/source/schemas/us-federal-data/meadow/MeadowSchemaCensusRegion.json +447 -0
  121. package/source/schemas/us-federal-data/meadow/MeadowSchemaCity.json +623 -0
  122. package/source/schemas/us-federal-data/meadow/MeadowSchemaCongressionalDistrict.json +623 -0
  123. package/source/schemas/us-federal-data/meadow/MeadowSchemaCounty.json +495 -0
  124. package/source/schemas/us-federal-data/meadow/MeadowSchemaCountySubdivision.json +639 -0
  125. package/source/schemas/us-federal-data/meadow/MeadowSchemaDataSource.json +511 -0
  126. package/source/schemas/us-federal-data/meadow/MeadowSchemaState.json +511 -0
  127. package/source/schemas/us-federal-data/meadow/MeadowSchemaUser.json +399 -0
  128. package/source/schemas/us-federal-data/meadow/MeadowSchemaZIPCode.json +559 -0
  129. package/source/schemas/us-federal-data/sqlite_create/USFederalData-CreateSQLiteTables.sql +203 -0
  130. package/source/schemas/us-federal-data/sqlite_create/USFederalData-SeedData.sql +54 -0
  131. package/test/RetoldHarness_tests.js +4 -4
  132. package/Dockerfile_LUXURYCode +0 -32
  133. package/docs/_coverpage.md +0 -11
  134. package/docs/luxury-code.md +0 -52
  135. package/source/configuration-bookstore-serve-api.js +0 -35
  136. /package/source/{model/ddl → schemas/bookstore}/BookStore.ddl +0 -0
  137. /package/source/{model → schemas/bookstore}/MeadowModel-Extended.json +0 -0
  138. /package/source/{model → schemas/bookstore}/MeadowModel-PICT.json +0 -0
  139. /package/source/{model → schemas/bookstore}/MeadowModel.json +0 -0
  140. /package/source/{model → schemas/bookstore}/doc/Dictionary.md +0 -0
  141. /package/source/{model → schemas/bookstore}/doc/Model-Author.md +0 -0
  142. /package/source/{model → schemas/bookstore}/doc/Model-Book.md +0 -0
  143. /package/source/{model → schemas/bookstore}/doc/Model-BookAuthorJoin.md +0 -0
  144. /package/source/{model → schemas/bookstore}/doc/Model-BookPrice.md +0 -0
  145. /package/source/{model → schemas/bookstore}/doc/Model-BookStore.md +0 -0
  146. /package/source/{model → schemas/bookstore}/doc/Model-BookStoreInventory.md +0 -0
  147. /package/source/{model → schemas/bookstore}/doc/Model-Review.md +0 -0
  148. /package/source/{model → schemas/bookstore}/doc/Model-User.md +0 -0
  149. /package/source/{model → schemas/bookstore}/doc/ModelChangeTracking.md +0 -0
  150. /package/source/{model → schemas/bookstore}/doc/diagrams/Relationships.dot +0 -0
  151. /package/source/{model → schemas/bookstore}/doc/diagrams/Relationships.png +0 -0
  152. /package/source/{model → schemas/bookstore}/doc/diagrams/RelationshipsFull.dot +0 -0
  153. /package/source/{model → schemas/bookstore}/doc/diagrams/RelationshipsFull.png +0 -0
  154. /package/source/{model → schemas/bookstore}/meadow/MeadowSchemaAuthor.json +0 -0
  155. /package/source/{model → schemas/bookstore}/meadow/MeadowSchemaBook.json +0 -0
  156. /package/source/{model → schemas/bookstore}/meadow/MeadowSchemaBookAuthorJoin.json +0 -0
  157. /package/source/{model → schemas/bookstore}/meadow/MeadowSchemaBookPrice.json +0 -0
  158. /package/source/{model → schemas/bookstore}/meadow/MeadowSchemaBookStore.json +0 -0
  159. /package/source/{model → schemas/bookstore}/meadow/MeadowSchemaBookStoreInventory.json +0 -0
  160. /package/source/{model → schemas/bookstore}/meadow/MeadowSchemaReview.json +0 -0
  161. /package/source/{model → schemas/bookstore}/meadow/MeadowSchemaUser.json +0 -0
  162. /package/source/{model → schemas/bookstore}/mysql_create/MeadowModel-CreateMySQLDatabase.mysql.sql +0 -0
  163. /package/source/{model → schemas/bookstore}/mysql_create/MeadowModel-DropMySQLTables.sql +0 -0
  164. /package/source/{model → schemas/bookstore}/mysql_create/MeadowModel-PopulateDatabase.sql +0 -0
  165. /package/source/{model → schemas/bookstore}/mysql_create/MySQL-Configure-Security.sql +0 -0
  166. /package/source/{model → schemas/bookstore}/sqlite_create/BookStore-CreateSQLiteTables.sql +0 -0
  167. /package/source/{model → schemas/bookstore}/sqlite_create/BookStore-SeedData.sql +0 -0
package/README.md CHANGED
@@ -1,88 +1,107 @@
1
1
  # Retold Harness
2
2
 
3
- > A self-contained REST API harness for the Retold framework
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
4
 
5
- Retold Harness brings together the full Retold stack into a running bookstore application. Point a browser at `http://localhost:8086/1.0/Books/0/100` and you have a working REST API backed by 10,000+ book records, author joins, pricing, store inventory, and reviews -- all auto-generated from a Stricture DDL.
5
+ > A composable REST API harness for the Retold framework
6
+
7
+ Retold Harness brings together pluggable schemas and database providers into a running application with auto-generated CRUD endpoints, pre-loaded sample data, and a terminal-based management tool. Pick a schema, pick a provider, and get a fully operational REST API backed by real data in seconds.
6
8
 
7
9
  ## Features
8
10
 
9
- - **8-Entity Bookstore Model** - Users, Books, Authors, Joins, Prices, Stores, Inventory, and Reviews
10
- - **Auto-Generated CRUD** - Every entity gets Create, Read, Reads, Update, Delete, Count, Schema, and New endpoints
11
- - **Author Enrichment** - Single Book reads include an Authors array via behavior injection
12
- - **Pre-Loaded Data** - 10,000+ book records with associated authors for realistic testing
13
- - **Docker Containerized** - MariaDB database and API server in a single container
14
- - **Luxury Code IDE** - Browser-based VS Code for in-container development
15
- - **SQLite Testing** - In-memory test suite requires no external database
11
+ - **Composable Architecture** -- pluggable schema providers and database providers via Fable services
12
+ - **3 Data Schemas** -- Bookstore (8 entities, 10k+ records), US Federal Data, Entertainment
13
+ - **7 Database Providers** -- SQLite, MySQL, MSSQL, PostgreSQL, MongoDB, DGraph, Solr
14
+ - **Auto-Generated CRUD** -- every entity gets Create, Read, Reads, Update, Delete, Count, Schema, and New endpoints
15
+ - **Behavior Injection** -- post-operation hooks on endpoints (e.g., Author enrichment on Book reads)
16
+ - **Terminal Management Tool** -- TUI app built on blessed/pict-terminalui for managing Docker containers and harness processes
17
+ - **Consistency Proxy** -- launch a proxy to compare responses across multiple providers
18
+ - **Pre-Loaded Sample Data** -- 10,000+ book records with associated authors for realistic testing
19
+ - **Docker Support** -- containerized environments for each database provider
20
+ - **Environment-Driven** -- select schema and provider via `HARNESS_SCHEMA` and `HARNESS_PROVIDER` environment variables
21
+ - **SQLite Testing** -- in-memory test suite requires no external database
22
+ - **Fable Service Architecture** -- built on fable-serviceproviderbase for service injection
23
+
24
+ ## Installation
25
+
26
+ ```bash
27
+ npm install retold-harness
28
+ ```
29
+
30
+ ## Quick Start
16
31
 
17
- ## Quick Start (Docker)
32
+ ### Start with Defaults (Bookstore + SQLite)
18
33
 
19
34
  ```bash
20
- git clone https://github.com/stevenvelozo/retold-harness
21
- cd retold-harness
22
- npm run docker-dev-build
23
- npm run docker-dev-run
35
+ npm start
24
36
  ```
25
37
 
26
38
  The REST API is now at `http://localhost:8086`.
27
39
 
28
- ![Building the docker image](./images/Docker-Build-Image.png)
40
+ ### Start with a Specific Schema and Provider
41
+
42
+ ```bash
43
+ HARNESS_SCHEMA=bookstore HARNESS_PROVIDER=mysql npm start
44
+ ```
29
45
 
30
- ## Quick Start (Manual)
46
+ ### Launch the Management Tool
31
47
 
32
48
  ```bash
33
- # Start a MariaDB container
34
- docker run -d --name mariadb -p 3306:3306 \
35
- -e MARIADB_ROOT_PASSWORD=123456789 \
36
- -e MARIADB_DATABASE=bookstore \
37
- mariadb:latest
38
-
39
- # Create the tables
40
- cat ./source/model/mysql_create/MeadowModel-CreateMySQLDatabase.mysql.sql \
41
- | docker exec -i mariadb mariadb -u root -p123456789 bookstore
42
-
43
- # Install and start
44
- npm install
45
- npm start
49
+ npm run manage
46
50
  ```
47
51
 
48
- Alternatively, if using a true MySQL image:
52
+ ### CLI Usage
49
53
 
50
54
  ```bash
51
- cat ./source/model/mysql_create/MeadowModel-CreateMySQLDatabase.mysql.sql \
52
- | docker exec -i mariadb mysql -u root -p123456789 bookstore
55
+ # Default bookstore + sqlite
56
+ retold-harness
57
+
58
+ # Launch TUI management tool
59
+ retold-harness-management-tool
53
60
  ```
54
61
 
55
62
  ## Architecture
56
63
 
57
64
  ```
58
65
  Retold Harness
66
+ ├── Schema Provider (Bookstore / USFederalData / Entertainment)
67
+ │ ├── Table Generation (DDL from Stricture)
68
+ │ ├── Seed Data Loading
69
+ │ └── Behavior Injection (e.g. Author enrichment)
70
+ ├── Provider Configurator (SQLite / MySQL / MSSQL / PostgreSQL / MongoDB / DGraph / Solr)
71
+ │ ├── Database Connection (via meadow-connection-*)
72
+ │ ├── Schema Initialization
73
+ │ └── Data Service Bootstrap
59
74
  ├── Retold Data Service
60
- │ ├── Orator + Restify (HTTP Server, port 8086)
75
+ │ ├── Orator + Restify (HTTP Server)
61
76
  │ ├── Meadow (DAL for each entity)
62
- │ │ └── Provider (MySQL / SQLite)
63
77
  │ └── Meadow Endpoints (REST Routes)
64
- └── Behavior Injection (Author enrichment)
65
- ├── Data Model (8 entities from Stricture DDL)
66
- └── Docker Environment
67
- ├── MariaDB (pre-loaded bookstore database)
68
- └── Luxury Code (browser VS Code, port 20001)
78
+ └── Management Tool (Terminal UI)
79
+ ├── Docker Container Management
80
+ ├── Harness Process Launcher
81
+ └── Consistency Proxy Control
69
82
  ```
70
83
 
71
84
  ## REST API Examples
72
85
 
73
- ### List the first 100 books: `http://localhost:8086/1.0/Books/0/100`
86
+ ### List the first 100 books
74
87
 
75
- ![The first 100 Books](./images/API-Book-List.png)
88
+ ```
89
+ GET http://localhost:8086/1.0/Books/0/100
90
+ ```
76
91
 
77
- ### Get a single book with authors: `http://localhost:8086/1.0/Book/1`
92
+ ### Get a single book with authors
78
93
 
79
- When fetching a single book, the response includes an `Authors` array populated via the behavior injection hook in `source/Retold-Harness.js`. In the multi-record list, the array is not included because the hook is only on the singular Read endpoint.
94
+ ```
95
+ GET http://localhost:8086/1.0/Book/1
96
+ ```
80
97
 
81
- ![Book 1](./images/API-Book-First.png)
98
+ When fetching a single book, the response includes an `Authors` array populated via the behavior injection hook. In the multi-record list, the array is not included because the hook is only on the singular Read endpoint.
82
99
 
83
- ### Filter authors by name: `http://localhost:8086/1.0/Authors/FilteredTo/FBV~Name~LK~Susan%25/0/10`
100
+ ### Filter authors by name
84
101
 
85
- ![The first 10 Susans](./images/API-Author-Susans.png)
102
+ ```
103
+ GET http://localhost:8086/1.0/Authors/FilteredTo/FBV~Name~LK~Susan%25/0/10
104
+ ```
86
105
 
87
106
  ### Count books by genre
88
107
 
@@ -90,7 +109,7 @@ When fetching a single book, the response includes an `Authors` array populated
90
109
  GET http://localhost:8086/1.0/Books/Count/FilteredTo/FBV~Genre~EQ~Science Fiction
91
110
  ```
92
111
 
93
- ## Data Model
112
+ ## Data Model (Bookstore)
94
113
 
95
114
  | Entity | Columns | Description |
96
115
  |--------|---------|-------------|
@@ -107,57 +126,76 @@ GET http://localhost:8086/1.0/Books/Count/FilteredTo/FBV~Genre~EQ~Science Fictio
107
126
 
108
127
  | Port | Service |
109
128
  |------|---------|
110
- | 8086 | REST API |
111
- | 31306 | MariaDB (mapped from 3306) |
112
- | 20001 | Luxury Code (VS Code in browser) |
113
-
114
- ### Database Credentials
129
+ | 8086 | REST API (SQLite) |
130
+ | 8087 | REST API (MySQL) |
131
+ | 8088 | REST API (MSSQL) |
132
+ | 8089 | REST API (PostgreSQL) |
133
+ | 8090 | REST API (MongoDB) |
134
+ | 8091 | REST API (DGraph) |
135
+ | 8092 | REST API (Solr) |
136
+ | 9090 | Consistency Proxy |
115
137
 
116
- | Setting | Value |
117
- |---------|-------|
118
- | User | `root` |
119
- | Password | `123456789` |
120
- | Database | `bookstore` |
138
+ ### Docker Quick Start
121
139
 
122
- ## Luxury Code
123
-
124
- Luxury Code provides a browser-based VS Code environment inside the Docker container. Open `http://localhost:20001` after launching the container. Password: `luxury`
140
+ ```bash
141
+ npm run docker-dev-build
142
+ npm run docker-dev-run
143
+ ```
125
144
 
126
- ![Launching Luxury Code requires a Password: luxury](./images/vscode-Login.png)
145
+ ### Docker Shell Access
127
146
 
128
- ![Visual Studio Code Editor with Config and Source](./images/vscode-Editor.png)
147
+ ```bash
148
+ npm run docker-dev-shell
149
+ ```
129
150
 
130
- ## MySQL
151
+ ## Schemas
131
152
 
132
- The Docker image exposes a MariaDB server. Connect with your tool of choice using the credentials above.
153
+ ### Bookstore
133
154
 
134
- ![MySQL Connection Info](./images/SQL-Connection.png)
155
+ The default schema with 8 entities and 10,000+ book records including authors, pricing, store inventory, and reviews.
135
156
 
136
- ![MySQL Query](./images/SQL-Query.png)
157
+ ```bash
158
+ npm run build-schema-bookstore
159
+ ```
137
160
 
138
- ## Source Code
161
+ ### US Federal Data
139
162
 
140
- The harness is intentionally minimal:
163
+ Federal government data sets compiled into a Stricture model.
141
164
 
142
- - `source/Retold-Harness.js` (47 lines) -- Initializes Fable, creates the data service, installs the Author enrichment hook
143
- - `source/configuration-bookstore-serve-api.js` (41 lines) -- Configuration with MySQL connection details and server port
144
- - `source/model/` -- Compiled Stricture model, DDL source, SQL scripts, and sample data
165
+ ```bash
166
+ npm run build-schema-us-federal-data
167
+ npm run ingest-federal-data
168
+ ```
145
169
 
146
- ## Building the Model
170
+ ### Entertainment
147
171
 
148
- To recompile the DDL after schema changes:
172
+ Entertainment industry data with its own ingestion pipeline.
149
173
 
150
174
  ```bash
151
- npm run build-model
175
+ npm run build-schema-entertainment
176
+ npm run ingest-entertainment
152
177
  ```
153
178
 
179
+ ## Environment Variables
180
+
181
+ | Variable | Default | Description |
182
+ |----------|---------|-------------|
183
+ | `HARNESS_SCHEMA` | `bookstore` | Schema provider to load (`bookstore`, `us-federal-data`, `entertainment`) |
184
+ | `HARNESS_PROVIDER` | `sqlite` | Database provider to use (`sqlite`, `mysql`, `mssql`, `postgresql`, `mongodb`, `dgraph`, `solr`) |
185
+
154
186
  ## Testing
155
187
 
156
188
  ```bash
157
189
  npm test
158
190
  ```
159
191
 
160
- The test suite contains 90 tests covering all 8 entities, behavior injection, DAL access, filtering, pagination, and soft deletes. Tests use in-memory SQLite and require no external database.
192
+ Tests use an in-memory SQLite provider and require no external database server.
193
+
194
+ For coverage:
195
+
196
+ ```bash
197
+ npm run coverage
198
+ ```
161
199
 
162
200
  ## Documentation
163
201
 
@@ -167,16 +205,17 @@ Detailed documentation is available in the `docs/` folder and can be served loca
167
205
  npx docsify-cli serve docs
168
206
  ```
169
207
 
170
- ## Customizing
208
+ ## Related Packages
171
209
 
172
- All ports, passwords, and configuration are in `source/configuration-bookstore-serve-api.js` and `package.json`. Docker port mappings are in the npm scripts.
210
+ - [retold-harness-consistency-proxy](https://github.com/stevenvelozo/retold-harness-consistency-proxy) -- compare responses across providers
211
+ - [retold-data-service](https://github.com/stevenvelozo/retold-data-service) -- all-in-one data service
212
+ - [meadow](https://github.com/stevenvelozo/meadow) -- data access layer and ORM
213
+ - [meadow-endpoints](https://github.com/stevenvelozo/meadow-endpoints) -- automatic REST endpoint generation
214
+ - [foxhound](https://github.com/stevenvelozo/foxhound) -- query DSL for SQL generation
215
+ - [stricture](https://github.com/stevenvelozo/stricture) -- schema definition language
216
+ - [orator](https://github.com/stevenvelozo/orator) -- API server abstraction
217
+ - [fable](https://github.com/stevenvelozo/fable) -- service provider framework
173
218
 
174
- ## Related Packages
219
+ ## License
175
220
 
176
- - [retold-data-service](https://github.com/stevenvelozo/retold-data-service) - All-in-one data service
177
- - [meadow](https://github.com/stevenvelozo/meadow) - Data access layer and ORM
178
- - [meadow-endpoints](https://github.com/stevenvelozo/meadow-endpoints) - Automatic REST endpoint generation
179
- - [foxhound](https://github.com/stevenvelozo/foxhound) - Query DSL for SQL generation
180
- - [stricture](https://github.com/stevenvelozo/stricture) - Schema definition language
181
- - [orator](https://github.com/stevenvelozo/orator) - API server abstraction
182
- - [fable](https://github.com/stevenvelozo/fable) - Service provider framework
221
+ MIT
@@ -0,0 +1,107 @@
1
+ # Retold Harness - Database Services
2
+ #
3
+ # Start databases for development:
4
+ # docker compose up -d # Start all databases
5
+ # docker compose up mysql -d # Start MySQL only
6
+ # docker compose up mssql -d # Start MSSQL only
7
+ # docker compose up postgresql -d # Start PostgreSQL only
8
+ # docker compose up mongodb -d # Start MongoDB only
9
+ # docker compose up dgraph -d # Start DGraph only
10
+ # docker compose up solr -d # Start Solr only
11
+ #
12
+ # Then run the harness with the desired provider:
13
+ # HARNESS_PROVIDER=sqlite npm start # SQLite (default, no Docker needed)
14
+ # HARNESS_PROVIDER=mysql npm start # MySQL
15
+ # HARNESS_PROVIDER=mssql npm start # MSSQL
16
+ # HARNESS_PROVIDER=postgresql npm start # PostgreSQL
17
+ # HARNESS_PROVIDER=mongodb npm start # MongoDB
18
+ # HARNESS_PROVIDER=dgraph npm start # DGraph
19
+ # HARNESS_PROVIDER=solr npm start # Solr
20
+ #
21
+ # Stop databases:
22
+ # docker compose down
23
+
24
+ services:
25
+ mysql:
26
+ image: mysql:8
27
+ container_name: retold-harness-mysql
28
+ environment:
29
+ MYSQL_ROOT_PASSWORD: "1234567890"
30
+ MYSQL_DATABASE: bookstore
31
+ ports:
32
+ - "3306:3306"
33
+ healthcheck:
34
+ test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p1234567890"]
35
+ interval: 5s
36
+ timeout: 5s
37
+ retries: 20
38
+ start_period: 10s
39
+
40
+ mssql:
41
+ image: mcr.microsoft.com/mssql/server:2022-latest
42
+ platform: linux/amd64
43
+ container_name: retold-harness-mssql
44
+ environment:
45
+ ACCEPT_EULA: "Y"
46
+ MSSQL_SA_PASSWORD: "Retold1234567890!"
47
+ ports:
48
+ - "1433:1433"
49
+ healthcheck:
50
+ test: ["CMD-SHELL", "/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P 'Retold1234567890!' -C -Q 'SELECT 1' || exit 1"]
51
+ interval: 10s
52
+ timeout: 5s
53
+ retries: 20
54
+ start_period: 15s
55
+
56
+ postgresql:
57
+ image: postgres:16
58
+ container_name: retold-harness-postgresql
59
+ environment:
60
+ POSTGRES_PASSWORD: "retold1234567890"
61
+ POSTGRES_DB: bookstore
62
+ ports:
63
+ - "5432:5432"
64
+ healthcheck:
65
+ test: ["CMD-SHELL", "pg_isready -U postgres"]
66
+ interval: 5s
67
+ timeout: 5s
68
+ retries: 20
69
+ start_period: 10s
70
+
71
+ mongodb:
72
+ image: mongo:7
73
+ container_name: retold-harness-mongodb
74
+ ports:
75
+ - "27017:27017"
76
+ healthcheck:
77
+ test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
78
+ interval: 5s
79
+ timeout: 5s
80
+ retries: 20
81
+ start_period: 10s
82
+
83
+ dgraph:
84
+ image: dgraph/standalone:latest
85
+ container_name: retold-harness-dgraph
86
+ ports:
87
+ - "8080:8080"
88
+ - "9080:9080"
89
+ healthcheck:
90
+ test: ["CMD-SHELL", "curl -sf http://localhost:8080/health || exit 1"]
91
+ interval: 10s
92
+ timeout: 5s
93
+ retries: 20
94
+ start_period: 15s
95
+
96
+ solr:
97
+ image: solr:9
98
+ container_name: retold-harness-solr
99
+ ports:
100
+ - "8983:8983"
101
+ command: solr-precreate bookstore
102
+ healthcheck:
103
+ test: ["CMD-SHELL", "curl -sf http://localhost:8983/solr/bookstore/admin/ping || exit 1"]
104
+ interval: 5s
105
+ timeout: 5s
106
+ retries: 20
107
+ start_period: 10s
package/docs/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Retold Harness
2
2
 
3
- A self-contained REST API harness for the [Retold](https://github.com/stevenvelozo/retold) framework. It serves a complete bookstore data model with auto-generated CRUD endpoints, pre-loaded sample data, and a containerized development environment.
3
+ A composable REST API harness for the [Retold](https://github.com/stevenvelozo/retold) framework. It combines pluggable schemas and database providers into a running application with auto-generated CRUD endpoints, pre-loaded sample data, and a terminal-based management tool.
4
4
 
5
5
  ## What It Does
6
6
 
@@ -14,31 +14,20 @@ Retold Harness brings together several Retold modules into a running application
14
14
 
15
15
  ## Features
16
16
 
17
- - **8-Entity Bookstore Model** -- Users, Books, Authors, Joins, Prices, Stores, Inventory, and Reviews
17
+ - **Composable Architecture** -- Pluggable schema providers and database providers via Fable services
18
+ - **3 Data Schemas** -- Bookstore (8 entities, 10k+ records), US Federal Data, Entertainment
19
+ - **7 Database Providers** -- SQLite, MySQL, MSSQL, PostgreSQL, MongoDB, DGraph, Solr
18
20
  - **Auto-Generated CRUD** -- Every entity gets Create, Read, Reads, Update, Delete, Count, Schema, and New endpoints
19
- - **Author Enrichment** -- Single Book reads are enriched with related Author data via behavior injection
21
+ - **Behavior Injection** -- Post-operation hooks on endpoints for cross-cutting concerns
22
+ - **Terminal Management Tool** -- TUI app for managing Docker containers and harness processes
23
+ - **Consistency Proxy** -- Compare responses across multiple database providers
20
24
  - **Pre-Loaded Data** -- 10,000+ book records with associated authors for realistic testing
21
- - **Docker Containerized** -- MariaDB database and API server in a single container
22
- - **Luxury Code IDE** -- Browser-based VS Code for in-container development
23
-
24
- ## Architecture
25
-
26
- ```
27
- Retold Harness
28
- ├── Retold Data Service
29
- │ ├── Orator + Restify (HTTP Server, port 8086)
30
- │ ├── Meadow (DAL for each entity)
31
- │ │ └── Provider (MySQL / SQLite)
32
- │ └── Meadow Endpoints (REST Routes)
33
- │ └── Behavior Injection (Author enrichment)
34
- ├── Data Model (8 entities from Stricture DDL)
35
- └── Docker Environment
36
- ├── MariaDB (pre-loaded bookstore database)
37
- └── Luxury Code (browser VS Code, port 20001)
38
- ```
25
+ - **Docker Containerized** -- Each database provider runs in its own Docker container
26
+ - **Environment-Driven** -- Select schema and provider via environment variables
39
27
 
40
28
  ## Related Packages
41
29
 
30
+ - [retold-harness-consistency-proxy](https://github.com/stevenvelozo/retold-harness-consistency-proxy) -- Cross-provider response comparison
42
31
  - [retold-data-service](https://github.com/stevenvelozo/retold-data-service) -- All-in-one data service
43
32
  - [meadow](https://github.com/stevenvelozo/meadow) -- Data access layer
44
33
  - [meadow-endpoints](https://github.com/stevenvelozo/meadow-endpoints) -- REST endpoint generation
package/docs/_cover.md ADDED
@@ -0,0 +1,11 @@
1
+ # Retold Harness <small>1.1.1</small>
2
+
3
+ > Composable REST API harness with pluggable schemas and database providers
4
+
5
+ - 3 data schemas with 7 database providers
6
+ - Auto-generated CRUD endpoints with behavior injection
7
+ - Terminal management tool for Docker and harness processes
8
+ - 10,000+ pre-loaded sample records
9
+
10
+ [Getting Started](#retold-harness)
11
+ [GitHub](https://github.com/stevenvelozo/retold-harness)
package/docs/_sidebar.md CHANGED
@@ -3,6 +3,11 @@
3
3
  - [Quick Start](quickstart.md)
4
4
  - [Docker Setup](docker.md)
5
5
 
6
+ - Architecture
7
+ - [System Design](architecture.md)
8
+ - [Schema Providers](schema-providers.md)
9
+ - [Provider Configurators](provider-configurators.md)
10
+
6
11
  - Data Model
7
12
  - [Schema Overview](schema.md)
8
13
  - [Entity Reference](entities.md)
@@ -15,6 +20,15 @@
15
20
  - [Behavior Injection](behavior-injection.md)
16
21
  - [Configuration](configuration.md)
17
22
 
23
+ - Management Tool
24
+ - [Terminal UI](management-tool.md)
25
+
18
26
  - Development
19
27
  - [Testing](testing.md)
20
- - [Luxury Code IDE](luxury-code.md)
28
+
29
+ - API Reference
30
+ - [Overview](api/reference.md)
31
+ - [RetoldHarness](api/retold-harness.md)
32
+ - [MeadowProviderConfigurator](api/meadow-provider-configurator.md)
33
+ - [SchemaProvider](api/schema-provider.md)
34
+ - [ProcessManager](api/process-manager.md)
@@ -0,0 +1,2 @@
1
+ - [GitHub](https://github.com/stevenvelozo/retold-harness)
2
+ - [npm](https://www.npmjs.com/package/retold-harness)