# nicolasantoniosilvaruiz-cmyk/fundosancarlosapi architecture

> Architecture diagram of the GitHub repository nicolasantoniosilvaruiz-cmyk/fundosancarlosapi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi
- Repository: https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi

## Overview

San Carlos monitors water-tank levels and petroleum inventory through a Django service and Android client. The main workflow is Android sign-in and panel requests to the mobile API, which reads tank measurements and returns status; low-water evaluation creates alerts and can trigger browser or Android notifications. The app also exposes administration and petroleum operations. Edges reflect shown calls, indexed references, or documented API behavior; unsampled web routing and some integrations are left unconnected where their wiring is not evidenced.

Main entry points: [`django/monitoreo/models.py`](https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/models.py) (Domain records), [`django/monitoreo/services.py`](https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/services.py) (Level evaluation), [`android/app/src/main/java/cl/fundosancarlos/app/MainActivity.java`](https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/android/app/src/main/java/cl/fundosancarlos/app/MainActivity.java) (Mobile screens), [`django/monitoreo/api_movil.py`](https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/api_movil.py) (Mobile API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Android client"]
  node_android["Mobile screens<br/>[MainActivity.java]"]
  node_android_api["HTTP client<br/>[Api.java]"]
  node_local[("Local session/cache<br/>[LocalStore.java]")]
  node_android_push["Push handling<br/>[PushAndroid.java]"]
  node_messaging["FCM receiver"]
end

subgraph group_api["Service APIs"]
  node_mobile_api["Mobile API<br/>[api_movil.py]"]
  node_water_api["Water API<br/>[api_agua.py]"]
  node_web_ui["Web views<br/>[views.py]"]
  node_management_api["Management API<br/>[gestion_api.py]"]
  node_config["Runtime settings<br/>[settings.py]"]
end

subgraph group_domain["Monitoring domain"]
  node_models[("Domain records<br/>[models.py]")]
  node_monitoring["Level evaluation<br/>[services.py]"]
end

subgraph group_admin["Administration"]
  node_employees["Employee forms<br/>[gestion_forms.py]"]
  node_admin_services["Admin operations"]
  node_standard_forms["Web forms<br/>[forms.py]"]
end

subgraph group_notify["Notifications"]
  node_web_push["Browser push<br/>[push.py]"]
  node_fcm["Android push sender<br/>[fcm.py]"]
end

node_operator(("Operator"))
node_water_device(("Water device"))
node_push_service["Push provider"]

node_operator -->|"uses"| node_android
node_android -->|"requests through"| node_android_api
node_android -->|"stores session"| node_local
node_android -->|"configures push"| node_android_push
node_android_api -->|"calls API"| node_mobile_api
node_water_device -.->|"submits readings"| node_water_api
node_mobile_api -->|"references"| node_water_api
node_water_api -->|"reads and writes"| node_models
node_water_api -->|"uses status services"| node_monitoring
node_mobile_api -->|"reads and writes"| node_models
node_mobile_api -->|"uses status services"| node_monitoring
node_monitoring -->|"evaluates readings"| node_models
node_monitoring -->|"schedules alert notice"| node_web_push
node_monitoring -->|"schedules alert notice"| node_fcm
node_web_push -->|"reads subscriptions"| node_models
node_fcm -->|"references records"| node_models
node_web_push -->|"sends notice"| node_push_service
node_fcm -.->|"sends notice"| node_push_service
node_messaging -->|"checks preferences"| node_local
node_messaging -->|"displays notice"| node_android_push
node_messaging -->|"registers token"| node_android_api
node_operator -.->|"uses"| node_web_ui
node_web_ui -->|"uses forms"| node_standard_forms
node_web_ui -->|"calls operations"| node_admin_services
node_management_api -->|"calls operations"| node_admin_services
node_management_api -->|"references forms"| node_employees
node_admin_services -->|"validates employees"| node_employees
node_admin_services -->|"updates records"| node_models
node_management_api -->|"references records"| node_models
node_config -->|"configures user model"| node_models

click node_android "https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/android/app/src/main/java/cl/fundosancarlos/app/MainActivity.java"
click node_android_api "https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/android/app/src/main/java/cl/fundosancarlos/app/Api.java"
click node_local "https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/android/app/src/main/java/cl/fundosancarlos/app/LocalStore.java"
click node_android_push "https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/android/app/src/main/java/cl/fundosancarlos/app/PushAndroid.java"
click node_messaging "https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/android/app/src/main/java/cl/fundosancarlos/app/WaterMessagingService.java"
click node_mobile_api "https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/api_movil.py"
click node_water_api "https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/api_agua.py"
click node_web_ui "https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/views.py"
click node_management_api "https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/gestion_api.py"
click node_models "https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/models.py"
click node_monitoring "https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/services.py"
click node_employees "https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/gestion_forms.py"
click node_admin_services "https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/gestion_services.py"
click node_standard_forms "https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/forms.py"
click node_web_push "https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/push.py"
click node_fcm "https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/fcm.py"
click node_config "https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/config/settings.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_android,node_android_api,node_local,node_android_push,node_messaging toneBlue
class node_mobile_api,node_water_api,node_web_ui,node_management_api,node_config toneAmber
class node_models,node_monitoring toneMint
class node_employees,node_admin_services,node_standard_forms toneRose
class node_web_push,node_fcm,node_operator,node_water_device,node_push_service toneIndigo
```

## Components

### Android client

- [Mobile screens](https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/android/app/src/main/java/cl/fundosancarlos/app/MainActivity.java): `android/app/src/main/java/cl/fundosancarlos/app/MainActivity.java`
- [HTTP client](https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/android/app/src/main/java/cl/fundosancarlos/app/Api.java): `android/app/src/main/java/cl/fundosancarlos/app/Api.java`
- [Local session/cache](https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/android/app/src/main/java/cl/fundosancarlos/app/LocalStore.java): `android/app/src/main/java/cl/fundosancarlos/app/LocalStore.java`
- [Push handling](https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/android/app/src/main/java/cl/fundosancarlos/app/PushAndroid.java): `android/app/src/main/java/cl/fundosancarlos/app/PushAndroid.java`
- [FCM receiver](https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/android/app/src/main/java/cl/fundosancarlos/app/WaterMessagingService.java): `android/app/src/main/java/cl/fundosancarlos/app/WaterMessagingService.java`

### Service APIs

- [Mobile API](https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/api_movil.py): `django/monitoreo/api_movil.py`
- [Water API](https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/api_agua.py): `django/monitoreo/api_agua.py`
- [Web views](https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/views.py): `django/monitoreo/views.py`
- [Management API](https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/gestion_api.py): `django/monitoreo/gestion_api.py`
- [Runtime settings](https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/config/settings.py): `django/config/settings.py`

### Monitoring domain

- [Domain records](https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/models.py): `django/monitoreo/models.py`
- [Level evaluation](https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/services.py): `django/monitoreo/services.py`

### Administration

- [Employee forms](https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/gestion_forms.py): `django/monitoreo/gestion_forms.py`
- [Admin operations](https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/gestion_services.py): `django/monitoreo/gestion_services.py`
- [Web forms](https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/forms.py): `django/monitoreo/forms.py`

### Notifications

- [Browser push](https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/push.py): `django/monitoreo/push.py`
- [Android push sender](https://github.com/nicolasantoniosilvaruiz-cmyk/fundosancarlosapi/blob/main/django/monitoreo/fcm.py): `django/monitoreo/fcm.py`

### Other components

- **Operator**
- **Water device**
- **Push provider**

## Connections

- Operator → Mobile screens: uses
- Mobile screens → HTTP client: requests through (evidence: `android/app/src/main/java/cl/fundosancarlos/app/MainActivity.java`)
- Mobile screens → Local session/cache: stores session (evidence: `android/app/src/main/java/cl/fundosancarlos/app/MainActivity.java`)
- Mobile screens → Push handling: configures push (evidence: `android/app/src/main/java/cl/fundosancarlos/app/MainActivity.java`)
- HTTP client → Mobile API: calls API (evidence: `android/app/src/main/java/cl/fundosancarlos/app/Api.java`)
- Water device → Water API: submits readings
- Mobile API → Water API: references (evidence: `django/monitoreo/api_movil.py`)
- Water API → Domain records: reads and writes (evidence: `django/monitoreo/api_agua.py`)
- Water API → Level evaluation: uses status services (evidence: `django/monitoreo/api_agua.py`)
- Mobile API → Domain records: reads and writes (evidence: `django/monitoreo/api_movil.py`)
- Mobile API → Level evaluation: uses status services (evidence: `django/monitoreo/api_movil.py`)
- Level evaluation → Domain records: evaluates readings (evidence: `django/monitoreo/services.py`)
- Level evaluation → Browser push: schedules alert notice (evidence: `django/monitoreo/services.py`)
- Level evaluation → Android push sender: schedules alert notice (evidence: `django/monitoreo/services.py`)
- Browser push → Domain records: reads subscriptions (evidence: `django/monitoreo/push.py`)
- Android push sender → Domain records: references records (evidence: `django/monitoreo/api_movil.py`)
- Browser push → Push provider: sends notice (evidence: `django/monitoreo/push.py`)
- Android push sender → Push provider: sends notice
- FCM receiver → Local session/cache: checks preferences (evidence: `android/app/src/main/java/cl/fundosancarlos/app/WaterMessagingService.java`)
- FCM receiver → Push handling: displays notice (evidence: `android/app/src/main/java/cl/fundosancarlos/app/WaterMessagingService.java`)
- FCM receiver → HTTP client: registers token (evidence: `android/app/src/main/java/cl/fundosancarlos/app/WaterMessagingService.java`)
- Operator → Web views: uses
- Web views → Web forms: uses forms (evidence: `django/monitoreo/views.py`)
- Web views → Admin operations: calls operations (evidence: `django/monitoreo/views.py`)
- Management API → Admin operations: calls operations (evidence: `django/monitoreo/gestion_api.py`)
- Management API → Employee forms: references forms (evidence: `django/monitoreo/gestion_api.py`)
- Admin operations → Employee forms: validates employees (evidence: `django/monitoreo/gestion_services.py`)
- Admin operations → Domain records: updates records (evidence: `django/monitoreo/gestion_services.py`)
- Management API → Domain records: references records (evidence: `django/monitoreo/gestion_api.py`)
- Runtime settings → Domain records: configures user model (evidence: `django/config/settings.py`)
