# adnsk446/restaurant-customer-satisfaction-fuzzy-logic architecture

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

- Interactive diagram: https://gitdiagram.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic
- Repository: https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic

## Overview

This is a Streamlit restaurant-satisfaction calculator backed by a Mamdani fuzzy inference system. Users enter seven experience ratings, calculate a 0–100 satisfaction score, and can inspect the fuzzy analysis, recommendations, sensitivity curves, and membership-function comparisons. The graph separates the UI from the inference pipeline and its analysis features. Internal pipeline stages are documented in the README; sampled source confirms the UI-to-engine calls and the engine’s main orchestration, but not every internal implementation detail.

Main entry points: [`app.py`](https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/app.py) (Rating Controls), [`fuzzy_system.py`](https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py) (Inference Pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Streamlit UI"]
  node_rating_ui["Rating Controls<br/>[app.py]"]
  node_result_view["Score Display<br/>[app.py]"]
  node_fuzzy_panel["Fuzzy Analysis Panel<br/>[app.py]"]
  node_sensitivity_view["Sensitivity View<br/>[app.py]"]
  node_membership_compare["Membership Comparison<br/>[app.py]"]
end

subgraph group_engine["Fuzzy Engine"]
  node_fuzzy_pipeline["Inference Pipeline<br/>[fuzzy_system.py]"]
  node_membership["Membership Functions<br/>[fuzzy_system.py]"]
  node_rule_base["Fuzzy Rule Base<br/>[fuzzy_system.py]"]
  node_fuzzification["Fuzzification<br/>[fuzzy_system.py]"]
  node_rule_evaluation["Rule Evaluation<br/>[fuzzy_system.py]"]
  node_aggregation["Aggregation<br/>[fuzzy_system.py]"]
  node_defuzzification["Defuzzification<br/>[fuzzy_system.py]"]
  node_satisfaction["Satisfaction Score<br/>[fuzzy_system.py]"]
end

subgraph group_analysis["Analysis Tools"]
  node_contributions["Contribution Analysis<br/>[fuzzy_system.py]"]
  node_recommendations["Recommendations<br/>[fuzzy_system.py]"]
  node_sensitivity["Sensitivity Analysis<br/>[fuzzy_system.py]"]
end

node_customer(("Customer"))

node_customer -->|"enters ratings"| node_rating_ui
node_rating_ui -->|"requests inference"| node_fuzzy_pipeline
node_fuzzy_pipeline -->|"fuzzifies inputs"| node_fuzzification
node_fuzzification -->|"uses functions"| node_membership
node_fuzzy_pipeline -->|"evaluates rules"| node_rule_evaluation
node_rule_evaluation -->|"applies rules"| node_rule_base
node_fuzzy_pipeline -->|"aggregates output"| node_aggregation
node_aggregation -->|"centroid method"| node_defuzzification
node_fuzzy_pipeline -->|"returns score"| node_satisfaction
node_satisfaction -->|"displays score"| node_result_view
node_rating_ui -->|"requests analysis"| node_contributions
node_rating_ui -->|"requests advice"| node_recommendations
node_fuzzy_pipeline -->|"shows memberships and rules"| node_fuzzy_panel
node_rating_ui -->|"requests curve"| node_sensitivity
node_sensitivity -->|"plots curve"| node_sensitivity_view
node_rating_ui -->|"selects comparison"| node_membership_compare
node_membership_compare -->|"compares function families"| node_membership

click node_rating_ui "https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/app.py"
click node_result_view "https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/app.py"
click node_fuzzy_pipeline "https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py"
click node_membership "https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py"
click node_rule_base "https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py"
click node_fuzzification "https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py"
click node_rule_evaluation "https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py"
click node_aggregation "https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py"
click node_defuzzification "https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py"
click node_satisfaction "https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py"
click node_contributions "https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py"
click node_recommendations "https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py"
click node_fuzzy_panel "https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/app.py"
click node_sensitivity "https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py"
click node_sensitivity_view "https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/app.py"
click node_membership_compare "https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/app.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_rating_ui,node_result_view,node_fuzzy_panel,node_sensitivity_view,node_membership_compare toneBlue
class node_fuzzy_pipeline,node_membership,node_rule_base,node_fuzzification,node_rule_evaluation,node_aggregation,node_defuzzification,node_satisfaction toneAmber
class node_contributions,node_recommendations,node_sensitivity toneMint
class node_customer toneIndigo
```

## Components

### Streamlit UI

- [Rating Controls](https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/app.py): `app.py`
- [Score Display](https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/app.py): `app.py`
- [Fuzzy Analysis Panel](https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/app.py): `app.py`
- [Sensitivity View](https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/app.py): `app.py`
- [Membership Comparison](https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/app.py): `app.py`

### Fuzzy Engine

- [Inference Pipeline](https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py): `fuzzy_system.py`
- [Membership Functions](https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py): `fuzzy_system.py`
- [Fuzzy Rule Base](https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py): `fuzzy_system.py`
- [Fuzzification](https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py): `fuzzy_system.py`
- [Rule Evaluation](https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py): `fuzzy_system.py`
- [Aggregation](https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py): `fuzzy_system.py`
- [Defuzzification](https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py): `fuzzy_system.py`
- [Satisfaction Score](https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py): `fuzzy_system.py`

### Analysis Tools

- [Contribution Analysis](https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py): `fuzzy_system.py`
- [Recommendations](https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py): `fuzzy_system.py`
- [Sensitivity Analysis](https://github.com/adnsk446/restaurant-customer-satisfaction-fuzzy-logic/blob/main/fuzzy_system.py): `fuzzy_system.py`

### Other components

- **Customer**

## Connections

- Customer → Rating Controls: enters ratings (evidence: `README.md`)
- Rating Controls → Inference Pipeline: requests inference (evidence: `app.py`)
- Inference Pipeline → Fuzzification: fuzzifies inputs (evidence: `fuzzy_system.py`)
- Fuzzification → Membership Functions: uses functions (evidence: `README.md`)
- Inference Pipeline → Rule Evaluation: evaluates rules (evidence: `fuzzy_system.py`)
- Rule Evaluation → Fuzzy Rule Base: applies rules (evidence: `README.md`)
- Inference Pipeline → Aggregation: aggregates output (evidence: `fuzzy_system.py`)
- Aggregation → Defuzzification: centroid method (evidence: `README.md`)
- Inference Pipeline → Satisfaction Score: returns score (evidence: `fuzzy_system.py`)
- Satisfaction Score → Score Display: displays score (evidence: `app.py`)
- Rating Controls → Contribution Analysis: requests analysis (evidence: `app.py`)
- Rating Controls → Recommendations: requests advice (evidence: `app.py`)
- Inference Pipeline → Fuzzy Analysis Panel: shows memberships and rules (evidence: `app.py`)
- Rating Controls → Sensitivity Analysis: requests curve (evidence: `app.py`)
- Sensitivity Analysis → Sensitivity View: plots curve (evidence: `app.py`)
- Rating Controls → Membership Comparison: selects comparison (evidence: `app.py`)
- Membership Comparison → Membership Functions: compares function families (evidence: `app.py`)
