# Architecture Overview

There are two scenarios for how to integrate with us.

## Default integration path

<figure><img src="/files/CbsE7XstFoiwwVYUmhud" alt="Integration Architecture"><figcaption></figcaption></figure>

GeroSense API assumes server-to-server communication, which usually involves three main elements:

* `Your client application` is something that your users interact with. Usually, a mobile app that has access to users' health data via Apple HealthKit, Health Connect, or any other health data provider.
* `Your API server` is a backend that acts as a proxy between your client application and the GeroSense API. Its responsibilities include authenticating users, sending their health data to GeroSense API, and receiving and caching results from it.
* `GeroSense API` is an API service that we provide to calculate users' health metrics like biological age and resilience based on their longitudinal health data, like a history of steps or heart rate measurements. To send requests to the GeroSense API, you must get authentication credentials from us.

Read [GeroSense API Reference](/gerosense-api-reference.md) if you prefer this option.

## Integrate via Docker image instead of updating your API

If you use JWT-based authentication, there is a simplified integration path. Instead of updating your API server,  you can host our [premade Docker image](https://hub.docker.com/repository/docker/gerosense/api-proxy/general) as a proxy. It will confirm your users' identity and handle token-based authentications with our API. In this case, you only need to update your mobile application to work directly with the proxy.

<figure><img src="/files/D87aTJdrty6NRM0sOf9P" alt=""><figcaption></figcaption></figure>

If you use third-party authentication services like **Firebase** or **Supabase**, this is a recommended way of integrating with us.

Read [GeroSense API Proxy Reference](/gerosense-api-proxy-reference.md) if you prefer this option.


---

# 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://developer.gerosense.ai/getting-started/architecture-overview.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.
