# azizos1235/projet_mangeoire-intelligente architecture

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

- Interactive diagram: https://gitdiagram.com/azizos1235/projet_mangeoire-intelligente
- Repository: https://github.com/azizos1235/projet_mangeoire-intelligente

## Overview

This repository appears to combine livestock-management apps, cloud and ESP32 code, and feeding-behavior AI. The clearest documented workflow is feeding telemetry sent by Node-RED to the Forest AI service: it retains per-cow history, computes model features and verdicts, optionally publishes the result, and responds. The app and cloud modules are present, but their product behavior and connections are not documented in the supplied excerpts; those links are therefore omitted. Native app nodes represent platform shells, not inspected Dart features.

Main entry points: [`MI_module_AI_Forest/service.py`](https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_module_AI_Forest/service.py) (Forest AI Service), [`MI_esp32/main/main.c`](https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_esp32/main/main.c) (ESP32 Firmware), [`MI_module_AI_Forest/train_rf.py`](https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_module_AI_Forest/train_rf.py) (Feature Builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_apps["Livestock Apps"]
  node_farmer_app["Farmer App"]
  node_admin_app["Admin App"]
end

subgraph group_platform["Device and Cloud"]
  node_esp32["ESP32 Firmware<br/>[main.c]"]
  node_cloud_api["Cloud API<br/>[main.py]"]
  node_profiles["Profile Module<br/>[profile.py]"]
end

subgraph group_ai["Feeding AI"]
  node_forest_service["Forest AI Service<br/>[service.py]"]
  node_history[("Feeding History<br/>[service.py]")]
  node_features["Feature Builder<br/>[train_rf.py]"]
  node_forest_model["Forest Classifier<br/>[train_rf.py]"]
  node_regression_data["Regression Data Generator<br/>[generate_data.py]"]
  node_regression_model["Regression Trainer<br/>[train_AI.py]"]
  node_forest_data["Forest Data Generator<br/>[generate_data.py]"]
end

node_nodered(("Node-RED"))
node_amqp["AMQP Broker"]

node_esp32 -.->|"sends telemetry"| node_nodered
node_nodered -->|"POSTs readings"| node_forest_service
node_forest_service -->|"stores readings"| node_history
node_forest_service -->|"builds features"| node_features
node_forest_service -->|"requests verdict"| node_forest_model
node_forest_service -->|"publishes results"| node_amqp

click node_farmer_app "https://github.com/azizos1235/projet_mangeoire-intelligente/tree/main/MI_application/eleveur_app"
click node_admin_app "https://github.com/azizos1235/projet_mangeoire-intelligente/tree/main/MI_application/admin_app"
click node_esp32 "https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_esp32/main/main.c"
click node_cloud_api "https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_cloud_server/app/main.py"
click node_profiles "https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_cloud_server/app/profile.py"
click node_forest_service "https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_module_AI_Forest/service.py"
click node_history "https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_module_AI_Forest/service.py"
click node_features "https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_module_AI_Forest/train_rf.py"
click node_forest_model "https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_module_AI_Forest/train_rf.py"
click node_regression_data "https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_module_AI_Regression/generate_data.py"
click node_regression_model "https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_module_AI_Regression/train_AI.py"
click node_forest_data "https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_module_AI_Forest/generate_data.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_farmer_app,node_admin_app toneBlue
class node_esp32,node_cloud_api,node_profiles toneAmber
class node_forest_service,node_history,node_features,node_forest_model,node_regression_data,node_regression_model,node_forest_data toneMint
class node_nodered,node_amqp toneIndigo
```

## Components

### Livestock Apps

- [Farmer App](https://github.com/azizos1235/projet_mangeoire-intelligente/tree/main/MI_application/eleveur_app): `MI_application/eleveur_app`
- [Admin App](https://github.com/azizos1235/projet_mangeoire-intelligente/tree/main/MI_application/admin_app): `MI_application/admin_app`

### Device and Cloud

- [ESP32 Firmware](https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_esp32/main/main.c): `MI_esp32/main/main.c`
- [Cloud API](https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_cloud_server/app/main.py): `MI_cloud_server/app/main.py`
- [Profile Module](https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_cloud_server/app/profile.py): `MI_cloud_server/app/profile.py`

### Feeding AI

- [Forest AI Service](https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_module_AI_Forest/service.py): `MI_module_AI_Forest/service.py`
- [Feeding History](https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_module_AI_Forest/service.py): `MI_module_AI_Forest/service.py`
- [Feature Builder](https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_module_AI_Forest/train_rf.py): `MI_module_AI_Forest/train_rf.py`
- [Forest Classifier](https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_module_AI_Forest/train_rf.py): `MI_module_AI_Forest/train_rf.py`
- [Regression Data Generator](https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_module_AI_Regression/generate_data.py): `MI_module_AI_Regression/generate_data.py`
- [Regression Trainer](https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_module_AI_Regression/train_AI.py): `MI_module_AI_Regression/train_AI.py`
- [Forest Data Generator](https://github.com/azizos1235/projet_mangeoire-intelligente/blob/main/MI_module_AI_Forest/generate_data.py): `MI_module_AI_Forest/generate_data.py`

### Other components

- **Node-RED**
- **AMQP Broker**

## Connections

- ESP32 Firmware → Node-RED: sends telemetry
- Node-RED → Forest AI Service: POSTs readings (evidence: `MI_module_AI_Forest/service.py`)
- Forest AI Service → Feeding History: stores readings (evidence: `MI_module_AI_Forest/service.py`)
- Forest AI Service → Feature Builder: builds features (evidence: `MI_module_AI_Forest/service.py`)
- Forest AI Service → Forest Classifier: requests verdict (evidence: `MI_module_AI_Forest/service.py`)
- Forest AI Service → AMQP Broker: publishes results (evidence: `MI_module_AI_Forest/service.py`)
