MyDay architecture
MyDay is a browser app that talks straight to the user's own MySQL or PostgreSQL database, with no backend of its own. Every action follows the same path: one straight pipe from a browser event to a stored procedure and back . The database is the source of truth, and the screen only shows its state.
The path every MyDay action follows
Components send events to main.js, which calls the model, then the database access layer. Encryption, the connector, the driver and the relay lead to stored procedures. The procedure's result comes back up to the model, which announces the new list back to the components. A connection box supplies connections, and on PostgreSQL a push box feeds changes from the database back into the model.
The page in the browser
DOM events
HTML and CSS
Components components/*.js: render, and send events
Wiring main.js: hears each event, calls the model
Model lib/model.js, lib/items.js: the list and its rules
Database access lib/writes.js, lib/remote.js: procedure calls
Encryption db-auth: titles and descriptions, in the browser
Connector db-connector: one call, for either server
Driver pg-ws or mysql-ws: the server's protocol
Relay db-ws-relay: WebSocket bytes to TCP
Database Stored procedures: every rule and every write
Connection connect.js, account.js lib/connection.js, webway
Push, PostgreSQL only lib/push.js: applies each change and keeps active tabs connected
Re-render
Result