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.
- package/README.md +124 -85
- package/docker-compose.yml +107 -0
- package/docs/README.md +10 -21
- package/docs/_cover.md +11 -0
- package/docs/_sidebar.md +15 -1
- package/docs/_topbar.md +2 -0
- package/docs/api/meadow-provider-configurator.md +293 -0
- package/docs/api/process-manager.md +280 -0
- package/docs/api/reference.md +35 -0
- package/docs/api/retold-harness.md +118 -0
- package/docs/api/schema-provider.md +321 -0
- package/docs/architecture.md +172 -0
- package/docs/css/docuserve.css +73 -0
- package/docs/docker.md +2 -3
- package/docs/index.html +1 -1
- package/docs/management-tool.md +201 -0
- package/docs/provider-configurators.md +292 -0
- package/docs/retold-catalog.json +182 -0
- package/docs/retold-keyword-index.json +15205 -0
- package/docs/schema-providers.md +236 -0
- package/package.json +33 -21
- package/source/Retold-Harness.js +68 -97
- package/source/management-tool/Provider-Definitions.js +101 -0
- package/source/management-tool/Retold-Harness-Management-Tool.js +853 -0
- package/source/management-tool/Service-ProcessManager.js +493 -0
- package/source/management-tool/bin/retold-harness-management-tool.js +2 -0
- package/source/management-tool/docs/dgraph/linux.md +99 -0
- package/source/management-tool/docs/dgraph/mac.md +87 -0
- package/source/management-tool/docs/dgraph/windows.md +111 -0
- package/source/management-tool/docs/mongodb/linux.md +107 -0
- package/source/management-tool/docs/mongodb/mac.md +90 -0
- package/source/management-tool/docs/mongodb/windows.md +112 -0
- package/source/management-tool/docs/mssql/linux.md +109 -0
- package/source/management-tool/docs/mssql/mac.md +90 -0
- package/source/management-tool/docs/mssql/windows.md +106 -0
- package/source/management-tool/docs/mysql/linux.md +128 -0
- package/source/management-tool/docs/mysql/mac.md +96 -0
- package/source/management-tool/docs/mysql/windows.md +114 -0
- package/source/management-tool/docs/postgresql/linux.md +120 -0
- package/source/management-tool/docs/postgresql/mac.md +92 -0
- package/source/management-tool/docs/postgresql/windows.md +111 -0
- package/source/management-tool/docs/solr/linux.md +112 -0
- package/source/management-tool/docs/solr/mac.md +92 -0
- package/source/management-tool/docs/solr/windows.md +98 -0
- package/source/management-tool/docs/sqlite/linux.md +98 -0
- package/source/management-tool/docs/sqlite/mac.md +70 -0
- package/source/management-tool/docs/sqlite/windows.md +86 -0
- package/source/management-tool/views/View-Dashboard.js +69 -0
- package/source/management-tool/views/View-Detail.js +141 -0
- package/source/management-tool/views/View-Docs.js +95 -0
- package/source/management-tool/views/View-Header.js +49 -0
- package/source/management-tool/views/View-Layout.js +66 -0
- package/source/management-tool/views/View-Log.js +95 -0
- package/source/management-tool/views/View-StatusBar.js +66 -0
- package/source/providers/Retold-Harness-Service-MeadowProviderConfigurator.js +172 -0
- package/source/providers/Retold-Harness-Service-Provider-DGraph.js +116 -0
- package/source/providers/Retold-Harness-Service-Provider-MSSQL.js +182 -0
- package/source/providers/Retold-Harness-Service-Provider-MongoDB.js +116 -0
- package/source/providers/Retold-Harness-Service-Provider-MySQL.js +180 -0
- package/source/providers/Retold-Harness-Service-Provider-PostgreSQL.js +179 -0
- package/source/providers/Retold-Harness-Service-Provider-SQLite.js +104 -0
- package/source/providers/Retold-Harness-Service-Provider-Solr.js +116 -0
- package/source/schemas/Retold-Harness-Service-Schema-Bookstore.js +124 -0
- package/source/schemas/Retold-Harness-Service-Schema-Entertainment.js +198 -0
- package/source/schemas/Retold-Harness-Service-Schema-USFederalData.js +170 -0
- package/source/schemas/Retold-Harness-Service-SchemaProvider.js +110 -0
- package/source/schemas/bookstore/Schema.json +4310 -0
- package/source/schemas/bookstore/mssql_create/BookStore-SeedData.sql +29503 -0
- package/source/schemas/bookstore/pgsql_create/BookStore-SeedData.sql +29497 -0
- package/source/schemas/configuration-bookstore-serve-api.js +89 -0
- package/source/schemas/configuration-entertainment-serve-api.js +89 -0
- package/source/schemas/configuration-us-federal-data-serve-api.js +89 -0
- package/source/schemas/entertainment/Entertainment.ddl +266 -0
- package/source/schemas/entertainment/MeadowModel-Extended.json +9768 -0
- package/source/schemas/entertainment/MeadowModel-PICT.json +1 -0
- package/source/schemas/entertainment/MeadowModel.json +1238 -0
- package/source/schemas/entertainment/Schema.json +9768 -0
- package/source/schemas/entertainment/curated/concerts.json +181 -0
- package/source/schemas/entertainment/curated/soundtracks.json +202 -0
- package/source/schemas/entertainment/ingestion/ingest-entertainment-data.js +2434 -0
- package/source/schemas/entertainment/ingestion/mapping-album.json +12 -0
- package/source/schemas/entertainment/ingestion/mapping-artist.json +13 -0
- package/source/schemas/entertainment/ingestion/mapping-movie-credit.json +13 -0
- package/source/schemas/entertainment/ingestion/mapping-movie-rating.json +10 -0
- package/source/schemas/entertainment/ingestion/mapping-movie.json +15 -0
- package/source/schemas/entertainment/ingestion/mapping-person.json +13 -0
- package/source/schemas/entertainment/ingestion/mapping-song.json +12 -0
- package/source/schemas/entertainment/ingestion/mapping-venue.json +14 -0
- package/source/schemas/entertainment/meadow/MeadowSchemaAlbum.json +543 -0
- package/source/schemas/entertainment/meadow/MeadowSchemaAlbumTrack.json +479 -0
- package/source/schemas/entertainment/meadow/MeadowSchemaArtist.json +575 -0
- package/source/schemas/entertainment/meadow/MeadowSchemaConcert.json +511 -0
- package/source/schemas/entertainment/meadow/MeadowSchemaDataSource.json +511 -0
- package/source/schemas/entertainment/meadow/MeadowSchemaGenre.json +463 -0
- package/source/schemas/entertainment/meadow/MeadowSchemaMovie.json +559 -0
- package/source/schemas/entertainment/meadow/MeadowSchemaMovieCredit.json +527 -0
- package/source/schemas/entertainment/meadow/MeadowSchemaMovieGenre.json +447 -0
- package/source/schemas/entertainment/meadow/MeadowSchemaMovieRating.json +479 -0
- package/source/schemas/entertainment/meadow/MeadowSchemaPerson.json +527 -0
- package/source/schemas/entertainment/meadow/MeadowSchemaSetlistEntry.json +511 -0
- package/source/schemas/entertainment/meadow/MeadowSchemaSong.json +511 -0
- package/source/schemas/entertainment/meadow/MeadowSchemaSoundtrack.json +495 -0
- package/source/schemas/entertainment/meadow/MeadowSchemaUser.json +399 -0
- package/source/schemas/entertainment/meadow/MeadowSchemaVenue.json +559 -0
- package/source/schemas/entertainment/sqlite_create/Entertainment-CreateSQLiteTables.sql +303 -0
- package/source/schemas/entertainment/sqlite_create/Entertainment-SeedData.sql +34 -0
- package/source/schemas/us-federal-data/MeadowModel-Extended.json +6496 -0
- package/source/schemas/us-federal-data/MeadowModel-PICT.json +1 -0
- package/source/schemas/us-federal-data/MeadowModel.json +835 -0
- package/source/schemas/us-federal-data/Schema.json +6496 -0
- package/source/schemas/us-federal-data/USFederalData.ddl +179 -0
- package/source/schemas/us-federal-data/ingestion/ingest-federal-data.js +1032 -0
- package/source/schemas/us-federal-data/ingestion/mapping-city.json +20 -0
- package/source/schemas/us-federal-data/ingestion/mapping-congressional-district.json +20 -0
- package/source/schemas/us-federal-data/ingestion/mapping-county-subdivision.json +21 -0
- package/source/schemas/us-federal-data/ingestion/mapping-county.json +12 -0
- package/source/schemas/us-federal-data/ingestion/mapping-state.json +11 -0
- package/source/schemas/us-federal-data/ingestion/mapping-zipcode.json +16 -0
- package/source/schemas/us-federal-data/meadow/MeadowSchemaCensusDivision.json +463 -0
- package/source/schemas/us-federal-data/meadow/MeadowSchemaCensusRegion.json +447 -0
- package/source/schemas/us-federal-data/meadow/MeadowSchemaCity.json +623 -0
- package/source/schemas/us-federal-data/meadow/MeadowSchemaCongressionalDistrict.json +623 -0
- package/source/schemas/us-federal-data/meadow/MeadowSchemaCounty.json +495 -0
- package/source/schemas/us-federal-data/meadow/MeadowSchemaCountySubdivision.json +639 -0
- package/source/schemas/us-federal-data/meadow/MeadowSchemaDataSource.json +511 -0
- package/source/schemas/us-federal-data/meadow/MeadowSchemaState.json +511 -0
- package/source/schemas/us-federal-data/meadow/MeadowSchemaUser.json +399 -0
- package/source/schemas/us-federal-data/meadow/MeadowSchemaZIPCode.json +559 -0
- package/source/schemas/us-federal-data/sqlite_create/USFederalData-CreateSQLiteTables.sql +203 -0
- package/source/schemas/us-federal-data/sqlite_create/USFederalData-SeedData.sql +54 -0
- package/test/RetoldHarness_tests.js +4 -4
- package/Dockerfile_LUXURYCode +0 -32
- package/docs/_coverpage.md +0 -11
- package/docs/luxury-code.md +0 -52
- package/source/configuration-bookstore-serve-api.js +0 -35
- /package/source/{model/ddl → schemas/bookstore}/BookStore.ddl +0 -0
- /package/source/{model → schemas/bookstore}/MeadowModel-Extended.json +0 -0
- /package/source/{model → schemas/bookstore}/MeadowModel-PICT.json +0 -0
- /package/source/{model → schemas/bookstore}/MeadowModel.json +0 -0
- /package/source/{model → schemas/bookstore}/doc/Dictionary.md +0 -0
- /package/source/{model → schemas/bookstore}/doc/Model-Author.md +0 -0
- /package/source/{model → schemas/bookstore}/doc/Model-Book.md +0 -0
- /package/source/{model → schemas/bookstore}/doc/Model-BookAuthorJoin.md +0 -0
- /package/source/{model → schemas/bookstore}/doc/Model-BookPrice.md +0 -0
- /package/source/{model → schemas/bookstore}/doc/Model-BookStore.md +0 -0
- /package/source/{model → schemas/bookstore}/doc/Model-BookStoreInventory.md +0 -0
- /package/source/{model → schemas/bookstore}/doc/Model-Review.md +0 -0
- /package/source/{model → schemas/bookstore}/doc/Model-User.md +0 -0
- /package/source/{model → schemas/bookstore}/doc/ModelChangeTracking.md +0 -0
- /package/source/{model → schemas/bookstore}/doc/diagrams/Relationships.dot +0 -0
- /package/source/{model → schemas/bookstore}/doc/diagrams/Relationships.png +0 -0
- /package/source/{model → schemas/bookstore}/doc/diagrams/RelationshipsFull.dot +0 -0
- /package/source/{model → schemas/bookstore}/doc/diagrams/RelationshipsFull.png +0 -0
- /package/source/{model → schemas/bookstore}/meadow/MeadowSchemaAuthor.json +0 -0
- /package/source/{model → schemas/bookstore}/meadow/MeadowSchemaBook.json +0 -0
- /package/source/{model → schemas/bookstore}/meadow/MeadowSchemaBookAuthorJoin.json +0 -0
- /package/source/{model → schemas/bookstore}/meadow/MeadowSchemaBookPrice.json +0 -0
- /package/source/{model → schemas/bookstore}/meadow/MeadowSchemaBookStore.json +0 -0
- /package/source/{model → schemas/bookstore}/meadow/MeadowSchemaBookStoreInventory.json +0 -0
- /package/source/{model → schemas/bookstore}/meadow/MeadowSchemaReview.json +0 -0
- /package/source/{model → schemas/bookstore}/meadow/MeadowSchemaUser.json +0 -0
- /package/source/{model → schemas/bookstore}/mysql_create/MeadowModel-CreateMySQLDatabase.mysql.sql +0 -0
- /package/source/{model → schemas/bookstore}/mysql_create/MeadowModel-DropMySQLTables.sql +0 -0
- /package/source/{model → schemas/bookstore}/mysql_create/MeadowModel-PopulateDatabase.sql +0 -0
- /package/source/{model → schemas/bookstore}/mysql_create/MySQL-Configure-Security.sql +0 -0
- /package/source/{model → schemas/bookstore}/sqlite_create/BookStore-CreateSQLiteTables.sql +0 -0
- /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
|
-
|
|
3
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
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
|
-
|
|
32
|
+
### Start with Defaults (Bookstore + SQLite)
|
|
18
33
|
|
|
19
34
|
```bash
|
|
20
|
-
|
|
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
|
-
|
|
40
|
+
### Start with a Specific Schema and Provider
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
HARNESS_SCHEMA=bookstore HARNESS_PROVIDER=mysql npm start
|
|
44
|
+
```
|
|
29
45
|
|
|
30
|
-
|
|
46
|
+
### Launch the Management Tool
|
|
31
47
|
|
|
32
48
|
```bash
|
|
33
|
-
|
|
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
|
-
|
|
52
|
+
### CLI Usage
|
|
49
53
|
|
|
50
54
|
```bash
|
|
51
|
-
|
|
52
|
-
|
|
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
|
|
75
|
+
│ ├── Orator + Restify (HTTP Server)
|
|
61
76
|
│ ├── Meadow (DAL for each entity)
|
|
62
|
-
│ │ └── Provider (MySQL / SQLite)
|
|
63
77
|
│ └── Meadow Endpoints (REST Routes)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
|
86
|
+
### List the first 100 books
|
|
74
87
|
|
|
75
|
-
|
|
88
|
+
```
|
|
89
|
+
GET http://localhost:8086/1.0/Books/0/100
|
|
90
|
+
```
|
|
76
91
|
|
|
77
|
-
### Get a single book with authors
|
|
92
|
+
### Get a single book with authors
|
|
78
93
|
|
|
79
|
-
|
|
94
|
+
```
|
|
95
|
+
GET http://localhost:8086/1.0/Book/1
|
|
96
|
+
```
|
|
80
97
|
|
|
81
|
-
|
|
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
|
|
100
|
+
### Filter authors by name
|
|
84
101
|
|
|
85
|
-
|
|
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
|
-
|
|
|
112
|
-
|
|
|
113
|
-
|
|
114
|
-
|
|
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
|
-
|
|
117
|
-
|---------|-------|
|
|
118
|
-
| User | `root` |
|
|
119
|
-
| Password | `123456789` |
|
|
120
|
-
| Database | `bookstore` |
|
|
138
|
+
### Docker Quick Start
|
|
121
139
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
140
|
+
```bash
|
|
141
|
+
npm run docker-dev-build
|
|
142
|
+
npm run docker-dev-run
|
|
143
|
+
```
|
|
125
144
|
|
|
126
|
-
|
|
145
|
+
### Docker Shell Access
|
|
127
146
|
|
|
128
|
-
|
|
147
|
+
```bash
|
|
148
|
+
npm run docker-dev-shell
|
|
149
|
+
```
|
|
129
150
|
|
|
130
|
-
##
|
|
151
|
+
## Schemas
|
|
131
152
|
|
|
132
|
-
|
|
153
|
+
### Bookstore
|
|
133
154
|
|
|
134
|
-
|
|
155
|
+
The default schema with 8 entities and 10,000+ book records including authors, pricing, store inventory, and reviews.
|
|
135
156
|
|
|
136
|
-
|
|
157
|
+
```bash
|
|
158
|
+
npm run build-schema-bookstore
|
|
159
|
+
```
|
|
137
160
|
|
|
138
|
-
|
|
161
|
+
### US Federal Data
|
|
139
162
|
|
|
140
|
-
|
|
163
|
+
Federal government data sets compiled into a Stricture model.
|
|
141
164
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
165
|
+
```bash
|
|
166
|
+
npm run build-schema-us-federal-data
|
|
167
|
+
npm run ingest-federal-data
|
|
168
|
+
```
|
|
145
169
|
|
|
146
|
-
|
|
170
|
+
### Entertainment
|
|
147
171
|
|
|
148
|
-
|
|
172
|
+
Entertainment industry data with its own ingestion pipeline.
|
|
149
173
|
|
|
150
174
|
```bash
|
|
151
|
-
npm run build-
|
|
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
|
-
|
|
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
|
-
##
|
|
208
|
+
## Related Packages
|
|
171
209
|
|
|
172
|
-
|
|
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
|
-
##
|
|
219
|
+
## License
|
|
175
220
|
|
|
176
|
-
|
|
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
|
|
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
|
-
- **
|
|
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
|
-
- **
|
|
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** --
|
|
22
|
-
- **
|
|
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
|
-
|
|
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)
|
package/docs/_topbar.md
ADDED