17 Oct 2020 - tom
setup the culture blog’s data based solely on an event collection in Firebase
create events collection in firestore
consider what kind of events will be needed:
question: every event will need an event type… I guess i would do this by creating a base event type and then all events extend that type.. hmm another case for typesciprt
– note: I should really introduce typescript so i can type these events so they always have the same shape
needs to contain all piece information:
send respective events on create and view
publish event is trivial, just upate the create function
less trivial because showing a random piece does not work yet. So first step, make random page work with publish events.
plan of attack:
another trouble: how to get a “piece_id” if i am creating an event, not a piece..? for now i can use the event_id as the id of hte piece because publish event = piece right now… but in the future this should be resolved.
… almost there, current problem is the queries returnd from firebase are objects, not arrays.
… so it works now, but there is what I would consider some not so good hacking to turn the firebase query response into an array
I think that is all we have time for now! Taaa taaa! This has been a great exercise!