> For the complete documentation index, see [llms.txt](https://razortheory.gitbook.io/unicef-project-connect/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://razortheory.gitbook.io/unicef-project-connect/technical-documentation/architecture.md).

# Architecture

### Services

The platform is structured in a way that all the functionality is exposed via REST API's. The data from these API's drives the web interface which is a Single Page Application (SPA). There is a proxy that sits in front of the frontend SPA and backend API's. Additionally there is a message broker and asynchronous task / job queue that is used to run long-running and regular (i.e. hourly or daily) tasks.

Each of these services is either in the code and has an associated Docker file describing how it can be built and deployed on a docker friendly environment. Or this service uses a readily available Docker image that we configure for our own use.

The implementation details on each of these services are the following:

* **Django API** - This is the backend REST API service. Uses [Django](https://www.djangoproject.com/) and [Django REST Framework](http://www.django-rest-framework.org/).
* **Frontend** - This is the SPA (single-page application) written in [React](https://reactjs.org/).
* **Nginx proxy** - This sits in front of the Django and React services and routes requests. This helps us to not run these services on different ports, for example, that would cause CORS issues.
* **Redis** - in-memory data structure store, used as a database, cache, and message broker.
* **Celery Workers** - background distributed task queue, based on [celery python package](https://docs.celeryproject.org/en/stable/)
* **Celery Beat** - background periodic tasks producer
* **PostgreSQL** - relational database


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://razortheory.gitbook.io/unicef-project-connect/technical-documentation/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.
