Skip to content

Latest commit

 

History

History
40 lines (36 loc) · 3.73 KB

README.md

File metadata and controls

40 lines (36 loc) · 3.73 KB

Backend

The backend folder contains all our backend code 🤯. Theres a few important folders:

  • database/

    • Package contains all database specific code (basically just contexts + repositories)
    • Repositories are repositories, just provide methods for interacting with the database
    • Contexts are actual database connections, theres a testing_context and a normal live_context, the testing_context wraps all SQL queries in a transaction and rolls them back once testing has finished and live_context does nothing special 🙁
  • endpoints/

    • Contains all our HTTP handlers + methods for decorating those handlers, additionally provides methods for attaching handlers to a http.ServeMux
  • editor/

    • There are currently 3 different editor backends, once the OT backend is fully complete this will collapse down to just OT
      • The OT folder contains our implementation of the operational transform algorithm, specifically Google WAVE OT
      • The pessimistic editor is a lock based editor, instead of implementing an optimistic concurrency protocol it simply locks the editor while a conflicting client is using it
      • The diffsync folder contains all the backend code for synchronisation (bit of a mess right now 😭). It is essentially just a big implementation for the differential sync algorithm and supports extension via the construction of extensions
    • The package allows multiple clients to be connected to the same document and ensures that each client sees the exact same document state (via a best effort diff + patch)
    • Currently only works on strings with no inheret structure but in the future will work on JSON documents too 😀
  • environment/ & internal/

    • Methods/packages that can be used to retrieve information about the current environment and other internal utilities
  • client

    • WIP TypeScript implementation of client server for operational transform

Papers worth Reading

Most of the complexity of the CMS backend is within the editor, to aid with your tickets we have accumilated a few great resources that are worth a read.

Language Documentation & Resources

If this is your first time using Go then the following resources might be of some use: