Skip to content

Latest commit

 

History

History

design-decisions

This directory is similar to an Architectural Decision Record, but with more emphasis on being current and up to date, rather than recording past decisions. If you wanna view the evolution of a decision, use git.

The primary author of Pentive, Alex, is not a good architect, designer, or web dev. Please open an issue if you see areas for improvement!

The multitude of services is partly due to separating endpoints that serve insecure user generated content from trusted Pentive content.

There are a few events in recent history that may have contributed to the current state of things. First, a whole army of developers writing JavaScript for the browser started self-identifying as “full-stack”, diving into server development and asynchronous code.

😭 Trust me, I never thought I'd willingly write TypeScript/JavaScript (same thing).

Service/Directory Overview

app

  • The client-side occasionally-online SRS that stores a user's templates/notes/cards
  • Where card reviews occur

app-ugc

  • A small occasionally-online static site that displays untrusted user generated content (e.g. users' cards)
  • Typically viewed through an iframe on app so JavaScript can't access app
  • Has a service worker that queries app for media (e.g. images)

hub

  • The server-side always-online collaboration platform
  • Where users may optionally upload notes for sharing

hub-ugc

  • Its raison d'être is the same as app-ugc's - but for hub
  • Always-online, so it doesn't need app-ugc's fancy service worker

lrpc

  • short for (AWS) Lambda-RPC
  • Mostly empty for now, except for the Prisma/PlanetScale schema
  • Server-side syncing may eventually be implemented here

cwa

  • short for Cloudflare Worker API
  • How app submits changes to hub/PlanetScale

api-ugc

  • The API serving untrusted user generated content from a secondary domain (e.g. user-generated-content-pentive.com)
  • This is the API - the other ugcs are sites (typically viewed through iframes)

peer

  • PeerServer that establishes p2p connections between Pentive apps for syncing client-side databases

shared

  • A library of shared code for the above services