# safejakie/appli_whataplant architecture

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

- Interactive diagram: https://gitdiagram.com/safejakie/appli_whataplant
- Repository: https://github.com/safejakie/appli_whataplant

## Overview

BotanIA is a plant-identification and information app: users authenticate, submit a plant image for analysis, review a report, and can save scans to their history; a chat assistant supports follow-up questions. The dashboard also exposes scan history, profile management, and analytics data. The PHP endpoints use a shared MySQL connection. The README is empty, and the excerpts do not show the Python service internals or all dashboard requests, so uncertain connections are omitted or marked unverified.

Main entry points: [`php/config.php`](https://github.com/safejakie/appli_whataplant/blob/main/php/config.php) (Database connection), [`php/tableau.php`](https://github.com/safejakie/appli_whataplant/blob/main/php/tableau.php) (Dashboard), [`php/historique.php`](https://github.com/safejakie/appli_whataplant/blob/main/php/historique.php) (Scan history), [`php/traitement_image.php`](https://github.com/safejakie/appli_whataplant/blob/main/php/traitement_image.php) (Save scan)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_dashboard["Dashboard<br/>[tableau.php]"]
  node_history["Scan history<br/>[historique.php]"]
end

subgraph group_analysis["Plant analysis"]
  node_chat_service["Chat agent<br/>[agent.py]"]
  node_image_save["Save scan"]
end

subgraph group_accounts["Accounts and chat"]
  node_login["Sign-in<br/>[connexion.php]"]
  node_registration["Registration<br/>[inscription.php]"]
  node_profile["Profile view<br/>[profil.php]"]
  node_profile_update["Profile update<br/>[update_profil.php]"]
  node_password_update["Password reset<br/>[update_mdp.php]"]
  node_firebase["Firebase config<br/>[firebase_config.js]"]
end

subgraph group_data["Persistence and analytics"]
  node_scan_details["Scan details"]
  node_scan_delete["Delete scan<br/>[delete_scan.php]"]
  node_session_data["Session summary<br/>[get_sesssion.php]"]
  node_chat_save["Save chat<br/>[save_chat.php]"]
  node_chat_list["List chats<br/>[get_chat.php]"]
  node_chat_fetch["Load conversation"]
  node_chat_delete["Delete conversation"]
  node_analytics["Analytics export<br/>[powerbi.php]"]
  node_db_config["Database connection<br/>[config.php]"]
end

node_user(("User"))
node_mysql[("MySQL")]

node_user -->|"uses"| node_dashboard
node_dashboard -.->|"requests chat"| node_chat_service
node_dashboard -->|"saves reply"| node_chat_save
node_dashboard -->|"loads chats"| node_chat_list
node_dashboard -->|"deletes chat"| node_chat_delete
node_user -->|"registers"| node_registration
node_user -->|"signs in"| node_login
node_user -->|"views profile"| node_profile
node_user -->|"updates profile"| node_profile_update
node_firebase -->|"validates reset"| node_password_update
node_dashboard -.->|"stores scan"| node_image_save
node_dashboard -.->|"opens history"| node_history
node_history -->|"deletes scan"| node_scan_delete
node_login -->|"uses connection"| node_db_config
node_registration -->|"uses connection"| node_db_config
node_profile -->|"queries user"| node_db_config
node_profile_update -->|"updates user"| node_db_config
node_password_update -->|"updates password"| node_db_config
node_image_save -->|"inserts scan"| node_db_config
node_history -->|"reads scans"| node_db_config
node_scan_details -->|"reads scan"| node_db_config
node_scan_delete -->|"deletes scan"| node_db_config
node_session_data -->|"queries stats"| node_db_config
node_chat_save -->|"stores messages"| node_db_config
node_chat_list -->|"reads chats"| node_db_config
node_chat_fetch -->|"reads conversation"| node_db_config
node_chat_delete -->|"deletes conversation"| node_db_config
node_analytics -->|"queries scans"| node_db_config
node_db_config -->|"connects"| node_mysql

click node_dashboard "https://github.com/safejakie/appli_whataplant/blob/main/php/tableau.php"
click node_login "https://github.com/safejakie/appli_whataplant/blob/main/php/connexion.php"
click node_registration "https://github.com/safejakie/appli_whataplant/blob/main/php/inscription.php"
click node_profile "https://github.com/safejakie/appli_whataplant/blob/main/php/profil.php"
click node_profile_update "https://github.com/safejakie/appli_whataplant/blob/main/php/update_profil.php"
click node_password_update "https://github.com/safejakie/appli_whataplant/blob/main/php/update_mdp.php"
click node_firebase "https://github.com/safejakie/appli_whataplant/blob/main/js/firebase_config.js"
click node_chat_service "https://github.com/safejakie/appli_whataplant/blob/main/agent.py"
click node_image_save "https://github.com/safejakie/appli_whataplant/blob/main/php/traitement_image.php"
click node_history "https://github.com/safejakie/appli_whataplant/blob/main/php/historique.php"
click node_scan_details "https://github.com/safejakie/appli_whataplant/blob/main/php/get_scan_details.php"
click node_scan_delete "https://github.com/safejakie/appli_whataplant/blob/main/php/delete_scan.php"
click node_session_data "https://github.com/safejakie/appli_whataplant/blob/main/php/get_sesssion.php"
click node_chat_save "https://github.com/safejakie/appli_whataplant/blob/main/php/save_chat.php"
click node_chat_list "https://github.com/safejakie/appli_whataplant/blob/main/php/get_chat.php"
click node_chat_fetch "https://github.com/safejakie/appli_whataplant/blob/main/php/get_conversation.php"
click node_chat_delete "https://github.com/safejakie/appli_whataplant/blob/main/php/delete_conversation.php"
click node_analytics "https://github.com/safejakie/appli_whataplant/blob/main/php/powerbi.php"
click node_db_config "https://github.com/safejakie/appli_whataplant/blob/main/php/config.php"

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_dashboard,node_history,node_user toneBlue
class node_chat_service,node_image_save,node_mysql toneAmber
class node_login,node_registration,node_profile,node_profile_update,node_password_update,node_firebase toneMint
class node_scan_details,node_scan_delete,node_session_data,node_chat_save,node_chat_list,node_chat_fetch,node_chat_delete,node_analytics,node_db_config toneRose
```

## Components

### User interface

- [Dashboard](https://github.com/safejakie/appli_whataplant/blob/main/php/tableau.php): `php/tableau.php`
- [Scan history](https://github.com/safejakie/appli_whataplant/blob/main/php/historique.php): `php/historique.php`

### Plant analysis

- [Chat agent](https://github.com/safejakie/appli_whataplant/blob/main/agent.py): `agent.py`
- [Save scan](https://github.com/safejakie/appli_whataplant/blob/main/php/traitement_image.php): `php/traitement_image.php`

### Accounts and chat

- [Sign-in](https://github.com/safejakie/appli_whataplant/blob/main/php/connexion.php): `php/connexion.php`
- [Registration](https://github.com/safejakie/appli_whataplant/blob/main/php/inscription.php): `php/inscription.php`
- [Profile view](https://github.com/safejakie/appli_whataplant/blob/main/php/profil.php): `php/profil.php`
- [Profile update](https://github.com/safejakie/appli_whataplant/blob/main/php/update_profil.php): `php/update_profil.php`
- [Password reset](https://github.com/safejakie/appli_whataplant/blob/main/php/update_mdp.php): `php/update_mdp.php`
- [Firebase config](https://github.com/safejakie/appli_whataplant/blob/main/js/firebase_config.js): `js/firebase_config.js`

### Persistence and analytics

- [Scan details](https://github.com/safejakie/appli_whataplant/blob/main/php/get_scan_details.php): `php/get_scan_details.php`
- [Delete scan](https://github.com/safejakie/appli_whataplant/blob/main/php/delete_scan.php): `php/delete_scan.php`
- [Session summary](https://github.com/safejakie/appli_whataplant/blob/main/php/get_sesssion.php): `php/get_sesssion.php`
- [Save chat](https://github.com/safejakie/appli_whataplant/blob/main/php/save_chat.php): `php/save_chat.php`
- [List chats](https://github.com/safejakie/appli_whataplant/blob/main/php/get_chat.php): `php/get_chat.php`
- [Load conversation](https://github.com/safejakie/appli_whataplant/blob/main/php/get_conversation.php): `php/get_conversation.php`
- [Delete conversation](https://github.com/safejakie/appli_whataplant/blob/main/php/delete_conversation.php): `php/delete_conversation.php`
- [Analytics export](https://github.com/safejakie/appli_whataplant/blob/main/php/powerbi.php): `php/powerbi.php`
- [Database connection](https://github.com/safejakie/appli_whataplant/blob/main/php/config.php): `php/config.php`

### Other components

- **User**
- **MySQL**

## Connections

- User → Dashboard: uses (evidence: `php/tableau.php`)
- Dashboard → Chat agent: requests chat
- Dashboard → Save chat: saves reply (evidence: `php/tableau.php`)
- Dashboard → List chats: loads chats (evidence: `php/tableau.php`)
- Dashboard → Delete conversation: deletes chat (evidence: `php/tableau.php`)
- User → Registration: registers (evidence: `php/inscription.php`)
- User → Sign-in: signs in (evidence: `php/connexion.php`)
- User → Profile view: views profile (evidence: `php/profil.php`)
- User → Profile update: updates profile (evidence: `php/update_profil.php`)
- Firebase config → Password reset: validates reset (evidence: `php/update_mdp.php`)
- Dashboard → Save scan: stores scan
- Dashboard → Scan history: opens history
- Scan history → Delete scan: deletes scan (evidence: `php/historique.php`)
- Sign-in → Database connection: uses connection (evidence: `php/connexion.php`)
- Registration → Database connection: uses connection (evidence: `php/inscription.php`)
- Profile view → Database connection: queries user (evidence: `php/profil.php`)
- Profile update → Database connection: updates user (evidence: `php/update_profil.php`)
- Password reset → Database connection: updates password (evidence: `php/update_mdp.php`)
- Save scan → Database connection: inserts scan (evidence: `php/traitement_image.php`)
- Scan history → Database connection: reads scans (evidence: `php/historique.php`)
- Scan details → Database connection: reads scan (evidence: `php/get_scan_details.php`)
- Delete scan → Database connection: deletes scan (evidence: `php/delete_scan.php`)
- Session summary → Database connection: queries stats (evidence: `php/get_sesssion.php`)
- Save chat → Database connection: stores messages (evidence: `php/save_chat.php`)
- List chats → Database connection: reads chats (evidence: `php/get_chat.php`)
- Load conversation → Database connection: reads conversation (evidence: `php/get_conversation.php`)
- Delete conversation → Database connection: deletes conversation (evidence: `php/delete_conversation.php`)
- Analytics export → Database connection: queries scans (evidence: `php/powerbi.php`)
- Database connection → MySQL: connects (evidence: `php/config.php`)
