# shambhujadhav4/tourist-destinations-recommendation architecture

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

- Interactive diagram: https://gitdiagram.com/shambhujadhav4/tourist-destinations-recommendation
- Repository: https://github.com/shambhujadhav4/tourist-destinations-recommendation

## Overview

##### Project type and purpose
- This is a data-driven, monolithic web-application built with Streamlit.
- Its purpose is to let end users select a city and category, then generate personalized tourist destination recommendations via a K-Nearest Neighbors (KNN) algorithm.

##### File structure
- Top-level files:
- .devcontainer/devcontainer.json – development container configuration
- LICENSE, README.md – documentation and license
- TouristRecommender/ directory:
- .streamlit/config.toml – Streamlit UI settings
- app.py – main Streamlit application entry point
- requirements.txt – Python dependencies (streamlit, pandas, scikit-learn, etc.)
- Tourist5.csv, Touristnew.csv – datasets stored as flat files
- Screenshots/ – UI and demo images (for documentation only)

##### README for additional insights
- Tech stack: Python 3.11, Streamlit, scikit-learn, pandas
- Core functionality: UI layer for input, ML layer for KNN recommendations, CSV-backed data layer
- No external microservices or databases—everything is self-contained

a. Main components
- User’s Web Browser (Client)
- Streamlit Application (app.py) – UI & controller
- Recommendation Engine – KNN implementation using scikit-learn
- Data Storage – CSV files loaded via pandas
- Development / Deployment Environment – Python interpreter & .devcontainer
- (Optional) Hosting Platform – Streamlit Cloud or Docker container
b. Relationships and data flow
1. User selects city & category in browser → HTTP request reaches Streamlit app
2. Streamlit app loads and preprocesses CSV data via pandas
3. Streamlit controller invokes scikit-learn KNN module to compute nearest neighbors
4. Recommendation results flow back to Streamlit frontend
5. Streamlit renders results to the user’s browser
c. Architectural patterns & design principles
- Monolithic single-process architecture
- Clear separation between UI (Streamlit), business logic (KNN engine), and data layer (pandas + CSV)
- Environment as code (requirements.txt + .devcontainer) for reproducibility
d. Key technologies
- Streamlit – frontend UI & simple web server
- pandas – data ingestion and preprocessing
- scikit-learn – KNN algorithm
- .devcontainer – standardize dev environment
- requirements.txt – dependency management

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    Browser["User's Web Browser"]:::frontend

    %% Application Layer
    subgraph "Streamlit Application"
        App["app.py"]:::app
        Config["config.toml"]:::config
    end

    %% Data Layer
    subgraph "Data Layer"
        CSV1["Tourist5.csv"]:::data
        CSV2["Touristnew.csv"]:::data
    end

    %% ML Engine
    ML["KNN Recommendation Engine"]:::ml

    %% Environment & Documentation
    subgraph "Dev/Deploy & Documentation"
        Req["requirements.txt"]:::env
        DevC["devcontainer.json"]:::env
        README["README.md"]:::doc
        License["LICENSE"]:::doc
        Screens["Screenshots/"]:::doc
    end

    %% Flow
    Browser -->|"User selections"| App
    App -->|"Load data"| CSV1
    App -->|"Load data"| CSV2
    App -->|"KNN query"| ML
    ML -->|"Recommendations"| App
    App -->|"Render output"| Browser

    %% Click Events
    click App "https://github.com/shambhujadhav4/tourist-destinations-recommendation/blob/main/TouristRecommender/app.py"
    click Config "https://github.com/shambhujadhav4/tourist-destinations-recommendation/blob/main/TouristRecommender/.streamlit/config.toml"
    click CSV1 "https://github.com/shambhujadhav4/tourist-destinations-recommendation/blob/main/TouristRecommender/Tourist5.csv"
    click CSV2 "https://github.com/shambhujadhav4/tourist-destinations-recommendation/blob/main/TouristRecommender/Touristnew.csv"
    click Req "https://github.com/shambhujadhav4/tourist-destinations-recommendation/blob/main/TouristRecommender/requirements.txt"
    click DevC "https://github.com/shambhujadhav4/tourist-destinations-recommendation/blob/main/.devcontainer/devcontainer.json"
    click README "https://github.com/shambhujadhav4/tourist-destinations-recommendation/blob/main/README.md"
    click License "https://github.com/shambhujadhav4/tourist-destinations-recommendation/tree/main/LICENSE"
    click Screens "https://github.com/shambhujadhav4/tourist-destinations-recommendation/tree/main/TouristRecommender/Screenshots"

    %% Styles
    classDef frontend fill:#BBDEFB,stroke:#0D47A1,color:#0D47A1;
    classDef app fill:#E3F2FD,stroke:#1976D2,color:#1976D2;
    classDef config fill:#E3F2FD,stroke:#1976D2,color:#1976D2;
    classDef data fill:#C8E6C9,stroke:#2E7D32,color:#2E7D32;
    classDef ml fill:#FFE0B2,stroke:#E65100,color:#E65100;
    classDef env fill:#ECEFF1,stroke:#607D8B,color:#37474F;
    classDef doc fill:#F5F5F5,stroke:#9E9E9E,color:#424242;
```
