Introduction

The fragalysis-backend codebase (https://github.com/xchem/fragalysis-backend) contains the python code used on the back-end of fragalysis (https://fragalysis.diamond.ac.uk) and controls:

If you understand all of the concepts briefly mentioned here, you may want to go ahead and setup your developer stack

For Newbies

If you are unfamiliar with django or RESTful APIs, and are hoping to develop fragalysis backend, we recommend that you start by familiarising yourself with the following:

Once you feel like you understand these concepts, a good thing to do is setup your developer stack

Context

This section aims to briefly describe the context of the back-end code in terms of the data serverd to the front-end application.

The image below shows a target page from fragalysis (https://fragalysis.diamond.ac.uk/viewer/react/preview/target/Mpro) and highlights it’s 3 main functions:

  1. Serving crystallographic data

  2. Allowing a user to navigate the data in 3D

  3. Serving 2D and 3D information relating to new molecule designs

The image also highlights some of the data-types associated with these functionalities

_images/context.jpg

This data is all contained within a number of database tables in the backend codebase, defined by django Models; and served to the frontend via. RESTful endpoints, defined through Django and Django Rest Framework Views.

Although it could, the backend does not directly handle the loading (upload of data to fragalysis server and processing to put into database) of most data - this is done by the loader (https://github.com/xchem/fragalysis-loader).

The rest of the documentation attempts to present code-level documentation and tutorials to the developer within the context described here.

  1. Crystallographic data:
    • links

  2. Computed data:
    • links

  3. API (Restful) - data
    • links

  4. Serving media - files
    • links

The Stack

The fragalysis stack is very intentionally split up into many components, each with its own codebase. This documentation only covers the backend, as described in the introduction.