Engineering philosophy

Overall, we aim to treat this as a serious project, and in the perfect world we'd have great tests coverage, extensive documentation, and well-established release practices. As one of my favorite quotes reads, however, "in theory, there is no difference between theory and practice; in practice, there is". Follow the old adage:

Try to leave the codebase not worse than you found it. If you can, make it better.

If you have a favorite "code maintenance" tool you swear by and like, do pitch it to me. Every contributor is empowered to propose changes, ask for missing documentation to be added (or contribute to it), and to question historical choices made.

<aside> 👉 Remember: every missing test you add, and every code improvement you make, brings us closer to a stable place to thirst in share our love of fandom in extremely professional ways. Let "more [your favorite trope]" be your reward!

</aside>

Overview

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/09e8c1bd-0f20-46c0-b7fa-e275699fb926/Untitled.png

Frontend

BobaBoard's frontend code is split within 3 codebases:

  1. BobaEditor, which contains the text editor and related components (e.g. embeds, gif selector).
  2. BobaBoard UI, which contains all the "base building blocks" of BobaBoard's look & feel.
  3. BobaFrontend, which contains all the BobaBoard frontend business logic.

BobaFrontend uses the components defined by BobaBoard UI and BobaEditor to display data from (and pass data to) BobaServer, though a REST API (documentation link TODO).

Backend

BobaServer is the BobaBoard backend service, implemented in a single codebase. It communicates with BobaFrontend through the aforementioned REST API (documentation link TODO), and reads and stores data in a PostgreSQL DataBase (documentation).

Authentication

Authentication is managed by FireBase Auth. Users are authenticated through the firebase API on the client side, which returns them a JWT token. This is managed by the useAuth context hook defined in Auth.tsx.

The JWT token is then sent with each request to the server (serialized within the Authorization header), and is then decoded to retrieve the authenticated user's firebaseId (see [auth-handler.ts](<https://github.com/essential-randomness/bobaserver/blob/master/server/auth-handler.ts#L21>)). The firebaseId can then be used in queries to retrieve the internal user id.

<aside> 🙇 An Apology about Types: while all codebases use TypeScript, we don't currently have any shared types, and these are repeated across codebases. Of course, this is less than ideal. Sorry!

</aside>