class: center, middle, front # rig   #### _redbean interactive grapher_ #### [github.com/cdrubin/rig](https://github.com/cdrubin/rig) ??? Notes for the _first_ slide! --- # agenda 1. introduction 2. technology choices 3. implementation details 4. demo 5. github access --- # introduction Systems for local use do not need to be Internet scale. The best are reliable, long-lived, easy to deploy and maintain, and fit the needs of the user first! #### _development philosopy_ - size does still matter - the Node ecosystem of modules can be brittle and bundles are outsized - "no need to ship me another browser when i have my own already, thank you!" - docker containers are many layers* of abstraction for repeatability - if i cannot reuse ♲ repeatability is needed #### _learning something new_ - modern Javascript and libraries without bundling or CDN-based modules - minimal proof-of-concept that is fun! - αcτµαlly pδrταblε εxεcµταblε --- # technology choices #### _backend_ - cosmopolitan libc's redbean web server ape - Lua - sqlite (not this version...)      #### _frontend_ - simple HTML, CSS and Javascript - sqlite as sql.js wasm - yet-another-code-editor (yace) - prism.js - chart.js --- # implementation details #### _backend_ - sqlite csv import - redbean 1.0 - .init.lua launches local browser window to http://localhost:8080 - load.lua and save.lua handlers - all files appended to rig.com zipfile for distribution #### _frontend_ - vanilla Javascript - global variables! - inline CSS and event handlers - locally sourced non-minified Javascript libraries - load sqlite database into browser memory on load - load demo script file on load - execute SQL to populate data variables - execute Javascript to draw the chart --- # demo  --- # github access The ```rig.com``` [release](https://github.com/cdrubin/rig/releases) file contains ```index.html```, the ```/lib``` directory, the ```sqlite.database```, the ```load.lua``` and ```save.lua``` handlers and .init.lua get open a local browser window when the user runs ```rig.com```. The ```rig``` [repo](https://github.com/cdrubin/rig) contains these constituent files before they were added to that ```rig.com``` zipfile. During development it is super helpful to serve files from the local directory with someting like: ```./rig.com -D .``` 