endpoints:
/
redirect to /dash
/dash - GET
convenient links
/init - GET, POST
paste in existing jrnl contents, get back an import log
/jrnl/ - GET
redirect to /jrnl/currentYear
/jrnl/(year} - GET, POST
the full text of the jrnl for that year. POSTing text
will lead to the entries in it being created.
/ntry - GET
full log
/ntry/{year}/{month}/{day}/ - GET, POST
entry info.
/edit - GET
log of edits. each edit has an ID, so polling this will
allow js code to edit the <textarea> in realtime
/save - GET
complete jrnl text for backup
HTTP basic auth
serve a js API and an HTML page from the same set of endpoints,
use Accept:
DB is just JSON files on disk.
frontend:
static mode and js mode. js mode does clever things to allow
multiple client
db:
/users.json
user list, assumed to be immutable
/{username}/{year}/{month}/{day}
/latest
latest entry version, just a base 10 number
/{n}
entry text for version n