# dev-amer-oniza/nutrisyria architecture

> Architecture diagram of the GitHub repository dev-amer-oniza/nutrisyria, 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/dev-amer-oniza/nutrisyria
- Repository: https://github.com/dev-amer-oniza/nutrisyria

## Overview

This is a Laravel nutrition and food-platform application serving public users, nutritionists, and brand operators through a public site and a Filament admin panel. Public visitors can create accounts, complete health profiles, explore meal and restaurant data, and request nutrition advice; the kitchen recipe flow lets them adjust a dish and receive an analysis. Admin workflows maintain food-source records, review imports, and manage products and recipes. The graph preserves documented major domains, but most unsampled route and service wiring is omitted; edges cite only shown or indexed relationships.

Main entry points: [`app/Services/Nutrition/RecipeAnalysisService.php`](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Services/Nutrition/RecipeAnalysisService.php) (Recipe analysis), [`app/Http/Controllers/Site/KitchenRecipeController.php`](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Http/Controllers/Site/KitchenRecipeController.php) (Kitchen recipe endpoint), [`app/Filament/Clusters/FoodDatabase/Resources/Food/Resources/FoodSourceRecords/FoodSourceRecordResource.php`](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Filament/Clusters/FoodDatabase/Resources/Food/Resources/FoodSourceRecords/FoodSourceRecordResource.php) (Food database admin), [`app/Filament/Clusters/ImportReview/Resources/ImportBatches/RelationManagers/FoodSourceRecordsRelationManager.php`](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Filament/Clusters/ImportReview/Resources/ImportBatches/RelationManagers/FoodSourceRecordsRelationManager.php) (Import review)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public site"]
  node_web["Site endpoints"]
  node_google_controller["Google sign-in flow"]
  node_catalog_views["Meal and restaurant discovery"]
  node_kitchen_controller["Kitchen recipe endpoint"]
end

subgraph group_nutrition["Nutrition services"]
  node_custom_recipe["Custom recipe analysis"]
  node_recipe_analysis["Recipe analysis"]
  node_portion["Portion conversion"]
  node_grams["Gram conversion<br/>[GramsConverter.php]"]
  node_review_notes["Product review notes"]
end

subgraph group_catalog["Food and products"]
  node_food[("Food concepts<br/>[Food.php]")]
  node_source_records[("Food source records")]
  node_nutrient_values[("Nutrient values")]
  node_products[("Products and recipes<br/>[Product.php]")]
end

subgraph group_admin["Admin operations"]
  node_nutritionist_ui["Nutritionist workspace<br/>[ClientPlan.php]"]
  node_food_admin["Food database admin"]
  node_import_review["Import review"]
  node_import_services["Import processing"]
  node_product_admin["Brand product admin"]
  node_usda["USDA integration<br/>[FdcClient.php]"]
end

subgraph group_identity["Accounts and care"]
  node_google_service["Google authentication"]
  node_user[("User accounts<br/>[User.php]")]
  node_consultations["Consultations"]
end

node_visitor(("Visitor"))

node_visitor -.->|"uses"| node_web
node_visitor -.->|"starts sign-in"| node_google_controller
node_google_controller -->|"requests auth"| node_google_service
node_google_service -->|"looks up accounts"| node_user
node_visitor -.->|"submits recipe"| node_kitchen_controller
node_kitchen_controller -->|"requests analysis"| node_custom_recipe
node_kitchen_controller -->|"loads recipe draft"| node_recipe_analysis
node_kitchen_controller -->|"loads meal"| node_catalog_views
node_custom_recipe -.->|"analyzes draft"| node_recipe_analysis
node_recipe_analysis -->|"reads records"| node_source_records
node_recipe_analysis -->|"reads nutrients"| node_nutrient_values
node_recipe_analysis -.->|"converts quantities"| node_grams
node_product_admin -->|"uses conversions"| node_portion
node_product_admin -->|"uses conversions"| node_grams
node_food_admin -->|"manages records"| node_source_records
node_food_admin -->|"links foods"| node_food
node_import_review -->|"reviews batches"| node_import_services
node_import_review -->|"resolves food"| node_food
node_nutritionist_ui -.->|"supports care"| node_consultations
node_review_notes -.->|"records product reviews"| node_products
node_visitor -.->|"browses catalog"| node_catalog_views
node_usda -.->|"supplies source data"| node_import_services

click node_web "https://github.com/dev-amer-oniza/nutrisyria/tree/main/app/Http/Controllers/Site"
click node_google_controller "https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Http/Controllers/Site/Auth/GoogleAuthController.php"
click node_google_service "https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Services/Auth/GoogleAuthService.php"
click node_user "https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Models/User.php"
click node_consultations "https://github.com/dev-amer-oniza/nutrisyria/tree/main/app/Services/Consultations"
click node_catalog_views "https://github.com/dev-amer-oniza/nutrisyria/tree/main/app/Services/Site"
click node_kitchen_controller "https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Http/Controllers/Site/KitchenRecipeController.php"
click node_custom_recipe "https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Services/Site/Kitchen/CustomRecipeAnalyzer.php"
click node_recipe_analysis "https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Services/Nutrition/RecipeAnalysisService.php"
click node_food "https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Models/Food.php"
click node_source_records "https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Models/FoodSourceRecord.php"
click node_nutrient_values "https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Models/FoodNutrientValue.php"
click node_products "https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Models/Product.php"
click node_portion "https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Services/Nutrition/PortionResolver.php"
click node_grams "https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Services/Nutrition/GramsConverter.php"
click node_nutritionist_ui "https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Filament/Clusters/Consultations/Resources/Clients/Pages/ClientPlan.php"
click node_food_admin "https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Filament/Clusters/FoodDatabase/Resources/Food/Resources/FoodSourceRecords/FoodSourceRecordResource.php"
click node_import_review "https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Filament/Clusters/ImportReview/Resources/ImportBatches/RelationManagers/FoodSourceRecordsRelationManager.php"
click node_import_services "https://github.com/dev-amer-oniza/nutrisyria/tree/main/app/Services/Import"
click node_product_admin "https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Filament/Clusters/Brands/Resources/Products/RelationManagers/RecipeIngredientsRelationManager.php"
click node_review_notes "https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Services/Nutrition/ProductReviewNotes.php"
click node_usda "https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Services/Usda/FdcClient.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_web,node_google_controller,node_catalog_views,node_kitchen_controller toneBlue
class node_custom_recipe,node_recipe_analysis,node_portion,node_grams,node_review_notes toneAmber
class node_food,node_source_records,node_nutrient_values,node_products toneMint
class node_nutritionist_ui,node_food_admin,node_import_review,node_import_services,node_product_admin,node_usda toneRose
class node_google_service,node_user,node_consultations,node_visitor toneIndigo
```

## Components

### Public site

- [Site endpoints](https://github.com/dev-amer-oniza/nutrisyria/tree/main/app/Http/Controllers/Site): `app/Http/Controllers/Site`
- [Google sign-in flow](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Http/Controllers/Site/Auth/GoogleAuthController.php): `app/Http/Controllers/Site/Auth/GoogleAuthController.php`
- [Meal and restaurant discovery](https://github.com/dev-amer-oniza/nutrisyria/tree/main/app/Services/Site): `app/Services/Site`
- [Kitchen recipe endpoint](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Http/Controllers/Site/KitchenRecipeController.php): `app/Http/Controllers/Site/KitchenRecipeController.php`

### Nutrition services

- [Custom recipe analysis](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Services/Site/Kitchen/CustomRecipeAnalyzer.php): `app/Services/Site/Kitchen/CustomRecipeAnalyzer.php`
- [Recipe analysis](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Services/Nutrition/RecipeAnalysisService.php): `app/Services/Nutrition/RecipeAnalysisService.php`
- [Portion conversion](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Services/Nutrition/PortionResolver.php): `app/Services/Nutrition/PortionResolver.php`
- [Gram conversion](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Services/Nutrition/GramsConverter.php): `app/Services/Nutrition/GramsConverter.php`
- [Product review notes](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Services/Nutrition/ProductReviewNotes.php): `app/Services/Nutrition/ProductReviewNotes.php`

### Food and products

- [Food concepts](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Models/Food.php): `app/Models/Food.php`
- [Food source records](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Models/FoodSourceRecord.php): `app/Models/FoodSourceRecord.php`
- [Nutrient values](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Models/FoodNutrientValue.php): `app/Models/FoodNutrientValue.php`
- [Products and recipes](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Models/Product.php): `app/Models/Product.php`

### Admin operations

- [Nutritionist workspace](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Filament/Clusters/Consultations/Resources/Clients/Pages/ClientPlan.php): `app/Filament/Clusters/Consultations/Resources/Clients/Pages/ClientPlan.php`
- [Food database admin](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Filament/Clusters/FoodDatabase/Resources/Food/Resources/FoodSourceRecords/FoodSourceRecordResource.php): `app/Filament/Clusters/FoodDatabase/Resources/Food/Resources/FoodSourceRecords/FoodSourceRecordResource.php`
- [Import review](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Filament/Clusters/ImportReview/Resources/ImportBatches/RelationManagers/FoodSourceRecordsRelationManager.php): `app/Filament/Clusters/ImportReview/Resources/ImportBatches/RelationManagers/FoodSourceRecordsRelationManager.php`
- [Import processing](https://github.com/dev-amer-oniza/nutrisyria/tree/main/app/Services/Import): `app/Services/Import`
- [Brand product admin](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Filament/Clusters/Brands/Resources/Products/RelationManagers/RecipeIngredientsRelationManager.php): `app/Filament/Clusters/Brands/Resources/Products/RelationManagers/RecipeIngredientsRelationManager.php`
- [USDA integration](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Services/Usda/FdcClient.php): `app/Services/Usda/FdcClient.php`

### Accounts and care

- [Google authentication](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Services/Auth/GoogleAuthService.php): `app/Services/Auth/GoogleAuthService.php`
- [User accounts](https://github.com/dev-amer-oniza/nutrisyria/blob/main/app/Models/User.php): `app/Models/User.php`
- [Consultations](https://github.com/dev-amer-oniza/nutrisyria/tree/main/app/Services/Consultations): `app/Services/Consultations`

### Other components

- **Visitor**

## Connections

- Visitor → Site endpoints: uses
- Visitor → Google sign-in flow: starts sign-in
- Google sign-in flow → Google authentication: requests auth (evidence: `app/Http/Controllers/Site/Auth/GoogleAuthController.php`)
- Google authentication → User accounts: looks up accounts (evidence: `app/Services/Auth/GoogleAuthService.php`)
- Visitor → Kitchen recipe endpoint: submits recipe
- Kitchen recipe endpoint → Custom recipe analysis: requests analysis (evidence: `app/Http/Controllers/Site/KitchenRecipeController.php`)
- Kitchen recipe endpoint → Recipe analysis: loads recipe draft (evidence: `app/Http/Controllers/Site/KitchenRecipeController.php`)
- Kitchen recipe endpoint → Meal and restaurant discovery: loads meal (evidence: `app/Http/Controllers/Site/KitchenRecipeController.php`)
- Custom recipe analysis → Recipe analysis: analyzes draft
- Recipe analysis → Food source records: reads records (evidence: `app/Services/Nutrition/RecipeAnalysisService.php`)
- Recipe analysis → Nutrient values: reads nutrients (evidence: `app/Services/Nutrition/RecipeAnalysisService.php`)
- Recipe analysis → Gram conversion: converts quantities (evidence: `app/Services/Nutrition/RecipeAnalysisService.php`)
- Brand product admin → Portion conversion: uses conversions (evidence: `app/Filament/Clusters/Brands/Resources/Products/RelationManagers/RecipeIngredientsRelationManager.php`)
- Brand product admin → Gram conversion: uses conversions (evidence: `app/Filament/Clusters/Brands/Resources/Products/RelationManagers/RecipeIngredientsRelationManager.php`)
- Food database admin → Food source records: manages records (evidence: `app/Filament/Clusters/FoodDatabase/Resources/Food/Resources/FoodSourceRecords/FoodSourceRecordResource.php`)
- Food database admin → Food concepts: links foods (evidence: `app/Filament/Clusters/FoodDatabase/Resources/Food/Resources/FoodSourceRecords/FoodSourceRecordResource.php`)
- Import review → Import processing: reviews batches (evidence: `app/Filament/Clusters/ImportReview/Resources/ImportBatches/RelationManagers/FoodSourceRecordsRelationManager.php`)
- Import review → Food concepts: resolves food (evidence: `app/Filament/Clusters/ImportReview/Resources/ImportBatches/RelationManagers/FoodSourceRecordsRelationManager.php`)
- Nutritionist workspace → Consultations: supports care
- Product review notes → Products and recipes: records product reviews
- Visitor → Meal and restaurant discovery: browses catalog
- USDA integration → Import processing: supplies source data
