deciduously / mifkad

Attendance tracking webapp - ReasonML frontend/Rust backend - work task automation
MIT License
12 stars 2 forks source link

Some sort of persistance #1

Closed deciduously closed 6 years ago

deciduously commented 6 years ago

Either hook up a proper SQLite db, or save the json as text, or something. This will invole keeping the frontend and backend in sync - some sort of AJAX call on Toggle

deciduously commented 6 years ago

Do this in the backend. On startup, determine the day, remove that beeswax from the frontend. If no db entry exists, create one by reading current.xls, otherwise just read the json. I think just writing out json is fine for now. Use mifkad-assets/db/.json

Youll need a db schema on the backend that matches exactly what you have on the frontend. The frontend has extra fields now.

You'll need the date logic - getting the current date, looking for data appropriately. You only need to care about the weekday if this is the first access, to run scrape_enrollment - then just store it with the data, and the frontend will just read it - it doesn't need to care at all.

You'll need POST endpoints for toggling attendance, toggling room collected, and for toggling the pink sheets. Good opportunity to learn how Reason does response handling.

deciduously commented 6 years ago

Make sure to "lock" it when in use - write out a "locked" fiedl to the db and clear it on close - how do I ensure this gets cleared even on a SIGINT/SIGKILL?

deciduously commented 6 years ago

here is the initial setup of the json storage scheme

deciduously commented 6 years ago

Async AppState set up now

deciduously commented 6 years ago

done