# surajjayakumar2004/ai-restaurant-recommendation architecture

> Architecture diagram of the GitHub repository surajjayakumar2004/ai-restaurant-recommendation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/surajjayakumar2004/ai-restaurant-recommendation
- Repository: https://github.com/surajjayakumar2004/ai-restaurant-recommendation

## Overview

##### Main Components

A. Data Layer
- Raw Data Storage (CSV files)
- Processed Data Storage
- 9 input CSV files as source data
- Processed data outputs

B. Processing Layer
- Data Preprocessing Module
- Feature Engineering Pipeline
- Recommendation Engine

C. Application Layer
- Web Interface (Flask)
- Static Assets (CSS, Images)
- Templates

##### Component Relationships

**[Data Layer] → [Processing Layer] → [Application Layer]**

##### Detailed Component Breakdown

A. Data Layer (Bottom Tier):
- Restaurant Data (geoplaces2.csv, chefmoz*.csv files)
- User Data (user*.csv files)
- Ratings Data (rating_final.csv)
- A "Processed Data" section showing processed_data*.csv files

B. Processing Layer (Middle Tier):
- Data Preprocessing Module (src/data_preprocessing.py)
- Feature Engineering Pipeline (src/processed_restaurant_data.py)
- Recommendation Engine (src/recommendation_engine.py)
- Data Visualization Component (src/data_visualization.py)
- Model Component (src/model.py)

C. Application Layer (Top Tier):
- Flask Web Server (app.py)
- Templates Directory (HTML files)
- Static Assets (CSS, Images)

##### Flow Representation

- Raw CSV files → Data Preprocessing
- Preprocessed Data → Feature Engineering
- Feature Engineered Data → Recommendation Engine
- Recommendation Engine → Flask Application
- Flask Application → User Interface

##### Additional Elements

- Utils Module (src/utils.py)
- Configuration Files
- Static Assets
- Template Engine

##### Technical Details

- Python/Flask as the web framework
- CSV data sources
- HTML/CSS frontend
- Machine learning components
- Data preprocessing pipeline
- Recommendation algorithm

Remember to indicate the scalability points and future improvement areas mentioned in the README, such as the potential integration of advanced algorithms and geo-location features.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Define styles
    classDef data fill:#b3d9ff,stroke:#333
    classDef processing fill:#90EE90,stroke:#333
    classDef application fill:#FFB366,stroke:#333
    classDef frontend fill:#DDA0DD,stroke:#333
    classDef storage fill:#87CEEB,stroke:#333

    subgraph Frontend
        UI["Web Interface"]:::frontend
        Templates["Templates"]:::frontend
        StaticAssets["Static Assets"]:::frontend
    end

    subgraph AppLayer["Application Layer"]
        FlaskApp["Flask Application"]:::application
        APIEndpoints["API Endpoints"]:::application
    end

    subgraph ProcessingLayer["Processing Layer"]
        DataPrep["Data Preprocessing"]:::processing
        FeatureEng["Feature Engineering"]:::processing
        Model["Model Component"]:::processing
        RecEngine["Recommendation Engine"]:::processing
        Utils["Utilities"]:::processing
        DataViz["Data Visualization"]:::processing
    end

    subgraph DataStorage["Data Storage Layer"]
        RawData["Raw Data Storage"]:::storage
        ProcessedData["Processed Data Storage"]:::storage

        subgraph RawCSVs["Raw CSV Files"]
            RestaurantData["Restaurant Data"]:::data
            UserData["User Data"]:::data
            RatingsData["Ratings Data"]:::data
            RestaurantAttrib["Restaurant Attributes"]:::data
        end

        subgraph ProcessedCSVs["Processed CSV Files"]
            ProcessedMain["Processed Main Data"]:::data
            ProcessedRest1["Processed Restaurant Data 1"]:::data
            ProcessedRest2["Processed Restaurant Data 2"]:::data
        end
    end

    %% Connections
    UI --> FlaskApp
    Templates --> UI
    StaticAssets --> UI
    FlaskApp --> APIEndpoints
    APIEndpoints --> RecEngine
    DataPrep --> FeatureEng
    FeatureEng --> Model
    Model --> RecEngine
    RawData --> DataPrep
    DataPrep --> ProcessedData
    Utils --> DataPrep
    Utils --> RecEngine
    DataViz --> UI

    %% Click events
    click RawData "https://github.com/SurajJayakumar2004/AI-Restaurant-Recommendation/tree/main/data/"
    click RestaurantData "https://github.com/SurajJayakumar2004/AI-Restaurant-Recommendation/blob/main/data/geoplaces2.csv"
    click UserData "https://github.com/SurajJayakumar2004/AI-Restaurant-Recommendation/blob/main/data/userprofile.csv"
    click RatingsData "https://github.com/SurajJayakumar2004/AI-Restaurant-Recommendation/blob/main/data/rating_final.csv"
    click ProcessedMain "https://github.com/SurajJayakumar2004/AI-Restaurant-Recommendation/blob/main/data/processed_data.csv"
    click ProcessedRest1 "https://github.com/SurajJayakumar2004/AI-Restaurant-Recommendation/blob/main/data/processed_restaurant_data1.csv"
    click ProcessedRest2 "https://github.com/SurajJayakumar2004/AI-Restaurant-Recommendation/blob/main/data/processed_restaurant_data2.csv"
    click DataPrep "https://github.com/SurajJayakumar2004/AI-Restaurant-Recommendation/blob/main/src/data_preprocessing.py"
    click FeatureEng "https://github.com/SurajJayakumar2004/AI-Restaurant-Recommendation/blob/main/src/processed_restaurant_data.py"
    click Model "https://github.com/SurajJayakumar2004/AI-Restaurant-Recommendation/blob/main/src/model.py"
    click RecEngine "https://github.com/SurajJayakumar2004/AI-Restaurant-Recommendation/blob/main/src/recommendation_engine.py"
    click Utils "https://github.com/SurajJayakumar2004/AI-Restaurant-Recommendation/blob/main/src/utils.py"
    click DataViz "https://github.com/SurajJayakumar2004/AI-Restaurant-Recommendation/blob/main/src/data_visualization.py"
    click FlaskApp "https://github.com/SurajJayakumar2004/AI-Restaurant-Recommendation/blob/main/app.py"
    click StaticAssets "https://github.com/SurajJayakumar2004/AI-Restaurant-Recommendation/tree/main/static/css/"
    click Templates "https://github.com/SurajJayakumar2004/AI-Restaurant-Recommendation/tree/main/templates/"

    %% Legend
    subgraph Legend
        L1["Frontend Component"]:::frontend
        L2["Application Component"]:::application
        L3["Processing Component"]:::processing
        L4["Data Storage"]:::storage
        L5["Data Files"]:::data
    end
```
