Newt, a small system experiment

R. S. Doiel,

Caltech Library, Digital Library Development

July 14, 2023

The experiment

How do we make building web applications for Libraries, Archives and Museums simpler?

Focus on three abstractions

Three implementations a bird sighting website

  1. static site derived from CSV data file
    • (CSV file holds our sighting list)
  2. dynamic, SQL and browser JavaScript
    • (bird sighting list held in SQL database)
  3. dynamic, SQL and no browser JavaScript
    • (bird sighting list held in SQL database)

What are trade-offs?

birds version 1, static site, Pandoc

CSV file, Pandoc, 2 directories, 5 files, 75 total line count, static site

Lines Files
26 README.md
4 birds.csv <– this is used in each of the demos
6 build.sh
7 page.tmpl
32 htdocs/index.html

birds version 2, dynamic site, browser JavaScript

SQL (Postgres + PostgREST), Browser JavaScript, 2 directories, 8 files, 232 total line count, dynamic site

Lines Files
29 README.md
4 birds.csv <– from birds1
34 setup.sql
60 models.sql <– implements our data models
15 models_test.sql
3 postgrest.conf
24 htdocs/index.html <– hand coded
63 htdocs/sightings.js <– hand coded

birds version 3, dynamic site, no browser JavaScript

SQL (Postgres + PostgREST), Pandoc, Newt, 1 directory, 9 files, 225 total line count, dynamic site

Lines Files
43 README.md
4 birds.csv <– from birds1
34 setup.sql <– from birds2
60 models.sql <– from birds2
15 models_test.sql <– from birds2
3 postgrest.conf <– from birds2
23 birds.yaml
36 page.tmpl
7 post_result.tmpl

Insights from experiment

An unexpected result

The Newt stack can scale really big

Newt has weaknesses

Newt stack has strengths

A very mature foundation

Next steps for Newt?

  1. Test with Solr/Elasticsearch as alternate JSON sources
  2. Build staff facing applications this Summer (2023)
  3. Explore generating PostgREST configuration/SQL Models from Newt’s YAML
  4. (hopefully) move beyond my proof of concept in Fall/Winter (2023)

Newt’s someday, maybe …

Thank you!