Skip to content

Instantly share code, notes, and snippets.

View sid597's full-sized avatar

Siddharth Yadav sid597

View GitHub Profile
@sid597
sid597 / Athens RTC
Last active May 25, 2021 11:40
Athens RTC
- Architecture :
- Current self-hosted Athens app architecture :
- Athens is built using re-frame + datascript ( as the frontend in memory db). The general architecture can be understood by
learning re-frame, in addition to that there is a parser and file system. Parser is used to parse the block text and
filesystem is there to make the Athens pages durable by saving them on disk.
- How to make the self-hosted Athens app RTC
- Approach 1 : Instead of using the local datascript db we map all the clients to a remote db which takes up the role of local
datascript db.
- Overview :
- First some terminology :
NOTE: Another way of looking at the _page_ structure which will come in handy is: it is a seq of seqs, where each seq
contains blocks, and adding or removing to the seq does not update the seq's indexes we have to do it.
From 10k feet we can say the following things are happening **whenever we select and move some blocks**:
- Some blocks are added, removed, added + removed etc. all these scenarios are:
- Blocks are being **removed** from some parent/list **and added to** another parent/list
- Block(s) are **removed and added** to the same parent/list, i.e some children of a block are rearranged
- Second example from the above section
- Block is **only added** to some parent, this happens if we create a block ref by selecting a block and moving it