# Global Architecture

{% hint style="warning" %}
This documentation is not up to date.
{% endhint %}

Cohort360 is divided in two parts:

1. The [front-end](https://github.com/aphp/Cohort360) web interface, developed with [React](https://fr.reactjs.org/)
2. The [back-end](https://github.com/aphp/Cohort360-Back-end) API, developed with [Django](https://www.djangoproject.com/) and [DRF](https://www.django-rest-framework.org/)

Cohort360 needs at least the following to operate:

* A SQL database (compatible with Django, see [here](https://docs.djangoproject.com/en/dev/ref/databases/))
* \[Optional] A celery backend, we recommand Redis (see [here](https://docs.celeryproject.org/en/stable/userguide/configuration.html))
* Configuring the front-end and back-end to match your needs, see the following pages:
  * [Django Back-end](/technical-documentation/django-back-end.md)&#x20;
  * [Front-ends](/technical-documentation/front-ends.md)

Cohort360 needs 2 other endpoints to fully operate:

* OpenID Connect (OIDC)
* An **HL7 FHIR API** exposing health records
* A **Query Executor API** that handles Cohort360's possibly complex queries to generate cohorts of patients. Without this API, Cohort360 will only be a data visualization interface and won't be able to execute complex queries.

![Architecture of the dependencies of Cohort360](/files/-MeiWH2sfCUyJLfdkx3E)

#### How it works?

The **front-end** should be able to:

* Get an authentication token (JWT) from an API using login form username and password, and use this token to talk to other APIs such as the Django back-end, the FHIR API, the QueryServer... This authentication method can be replaced easily if needed. OpenID connect is another option under development.
* Connect to a FHIR API to read medical data, Cohort360 does not write data to FHIR for now.
* Connect to a QueryServer API, or alternative, to execute complex queries and create Cohorts of patients that are then made available in the FHIR API.

The **back-end** should be able to:

* Connect and store application data (not medical data) in a Postgres database, Django is also compatible with other [RDBMS](https://docs.djangoproject.com/en/dev/ref/databases/) but we do not test it.
* Connect to the QueryServer to run complex queries, the back-end expose them to the front-end asynchronously.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cohort360.org/technical-documentation/global-architecture.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
