Skip to content

Development guide

Atul Varma edited this page Dec 21, 2020 · 15 revisions

This development guide is intended to provide a high-level overview of developing on the JustFix.nyc Tenant Platform.

Before reading this, please make sure you've read Core principles and Architecture.

The Tenant Platform's codebase consists primarily of its Django-based Python back-end, its React-based TypeScript front-end, and various layers of "glue" that tie the two together.

The back-end

The back-end attempts to be largely idiomatic Django code. You'll want to make sure you have gone through, at the very least, the official Django tutorial (part of the Django documentation) before embarking on any adventures there.

Additionally, the back-end uses Python's optional type annotations and checks them via Mypy.

The JSX rendering service

By and large, our codebase use Django's template engine very little. Instead, as mentioned in Architecture, most user-facing view logic is actually done via a JSX rendering service: a separate NodeJS-based process that receives requests for pages to render, and returns the results.

On the Django side, this rendering service is invoked a view called react_rendered_view in frontend/views.py. This is used in project/urls.py to handle almost any kind of path that the Django server doesn't handle natively.

The JSX rendering service itself is implemented in frontend/lambda/lambda.tsx.

When invoked, the JSX rendering service is passed a blob of contextual information about the kind of view it's being asked to render, such as what URL needs to be rendered, who is currently logged-in, how the server is configured, and so on. For more details on this information, see the type definitions for AppProps defined in frontend/lib/app.tsx.

GraphQL

The main place our codebase diverges from idiomatic Django is with respect to the way the front-end communicates with the back-end.

TODO: finish this!

Celery

TODO: finish this!

Clone this wiki locally