Skip to content

Architecture

Samara Trilling edited this page Aug 6, 2021 · 19 revisions

The JustFix.nyc Tenant Platform's architecture is derived from its Core principles.

The browser communicates with a Django server via HTTP GET/POST in the baseline state and GraphQL when progressively-enhanced. The Django server communicates with a JSX rendering service and a Postgres database.

The architecture consists of the following parts:

  • The user's browser only needs to be capable of rendering HTML and submitting forms via standard HTTP GET and POST. This is the peanut from Aaron Gustafson's M&M metaphor for progressive enhancement.

    If CSS is available and has been delivered to the browser successfully, the page's content and core functionality is embellished with visual styling--the chocolate slathered on the peanut, as Gustafson would say.

    Finally, if JavaScript is available and has been delivered to the browser successfully, the experience is further enhanced with additional interactivity. Some fields are embellished with autocomplete functionality; forms are submitted asynchronously via GraphQL, and page transitions make it easier for users to have a mental model of their experience. In Gustafson's metaphor, this is the sugary candy shell our confection is encased in.

    In technical terms, the platform behaves as a standard "Web 1.0"-style application by default, but transforms into a single-page application (SPA) if the browser has the capabilities. A notable exception is if the user is having technical issues with the site, in which case they may opt-in to compatibility mode, which forces the app back into "Web 1.0" behavior.

  • The Django server responds to all requests from the user's browser. We use a wide variety of Django's features, relying heavily on its model and form validation frameworks, as well as its administrative user interface. For an explanation of Django features frequently used by our developers and general Django FAQ, go to our Django guide.

  • The JSX rendering service, sometimes called "lambda", is responsible for rendering the user's intial page content (this mechanism is sometimes referred to as "server-side rendering", or SSR). This helps ensure that the user's experience is seamless, and also makes it possible for the site to work without JavaScript on the client-side.

    At present, this service is spawned as a subprocess by the Django server, rather than being a separate server accessed over the network (though it may migrate to the latter someday).

  • The Postgres database stores all user data.

    Note that it is independent from an optional, secondary database containing open data about NYC (NYCDB), which the platform uses to gain insight about the user's housing situation (such as who the user's landlord is, given their address).

Clone this wiki locally