# meganathan223/mealmate architecture

> Architecture diagram of the GitHub repository meganathan223/mealmate, 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/meganathan223/mealmate
- Repository: https://github.com/meganathan223/mealmate

## Overview

MealMate is a static, browser-based meal-planning frontend. Users can browse and filter recipes, inspect recipe details, and choose recipes for dated weekly meal slots; separate pages provide favorites and shared navigation. The excerpts support the recipe and planner interactions, shared-component loading, and a simple favorites page. Page-to-script wiring and some page capabilities are not shown, so those connections are omitted rather than inferred.

Main entry points: [`js/components.js`](https://github.com/meganathan223/mealmate/blob/main/js/components.js) (Shared component loader), [`pages/favorites.html`](https://github.com/meganathan223/mealmate/blob/main/pages/favorites.html) (Favorites page), [`js/recipes.js`](https://github.com/meganathan223/mealmate/blob/main/js/recipes.js) (Recipe search and details), [`js/meal-planner.js`](https://github.com/meganathan223/mealmate/blob/main/js/meal-planner.js) (Weekly meal planner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_recipes["Recipe browsing"]
  node_recipe_pages["Recipe pages<br/>[recipes.html]"]
  node_recipe_ui["Recipe search and details<br/>[recipes.js]"]
  node_recipe_data["Recipe catalog<br/>[recipes-data.js]"]
  node_favorites_page["Favorites page<br/>[favorites.html]"]
  node_favorites_ui["Favorites controls<br/>[favorites.js]"]
  node_favorite_ids["Favorite IDs<br/>[favorites-id.js]"]
end

subgraph group_planning["Meal planning"]
  node_planner_page["Planner page<br/>[meal-planner.html]"]
  node_planner_ui["Weekly meal planner<br/>[meal-planner.js]"]
end

subgraph group_site["Shared site"]
  node_home_page["Home page<br/>[index.html]"]
  node_component_loader["Shared component loader<br/>[components.js]"]
  node_navbar["Navigation markup<br/>[navbar.html]"]
  node_footer["Footer markup<br/>[footer.html]"]
  node_menu_behavior["Menu and active links<br/>[main.js]"]
end

node_visitor(("Visitor"))

node_visitor -->|"browses"| node_recipe_pages
node_recipe_ui -->|"reads recipes"| node_recipe_data
node_recipe_ui -->|"renders cards"| node_recipe_pages
node_visitor -->|"plans meals"| node_planner_page
node_planner_ui -->|"lists recipes"| node_recipe_data
node_planner_ui -->|"updates week"| node_planner_page
node_visitor -->|"views favorites"| node_favorites_page
node_favorites_ui -->|"removes recipes"| node_favorites_page
node_favorite_ids -.-> node_favorites_page
node_component_loader -->|"fetches markup"| node_navbar
node_component_loader -->|"fetches markup"| node_footer
node_component_loader -->|"initializes menu"| node_menu_behavior
node_visitor -->|"opens site"| node_home_page

click node_recipe_pages "https://github.com/meganathan223/mealmate/blob/main/pages/recipes.html"
click node_recipe_ui "https://github.com/meganathan223/mealmate/blob/main/js/recipes.js"
click node_recipe_data "https://github.com/meganathan223/mealmate/blob/main/data/recipes-data.js"
click node_planner_page "https://github.com/meganathan223/mealmate/blob/main/pages/meal-planner.html"
click node_planner_ui "https://github.com/meganathan223/mealmate/blob/main/js/meal-planner.js"
click node_favorites_page "https://github.com/meganathan223/mealmate/blob/main/pages/favorites.html"
click node_favorites_ui "https://github.com/meganathan223/mealmate/blob/main/js/favorites.js"
click node_favorite_ids "https://github.com/meganathan223/mealmate/blob/main/data/favorites-id.js"
click node_home_page "https://github.com/meganathan223/mealmate/blob/main/index.html"
click node_component_loader "https://github.com/meganathan223/mealmate/blob/main/js/components.js"
click node_navbar "https://github.com/meganathan223/mealmate/blob/main/components/navbar.html"
click node_footer "https://github.com/meganathan223/mealmate/blob/main/components/footer.html"
click node_menu_behavior "https://github.com/meganathan223/mealmate/blob/main/js/main.js"

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_recipe_pages,node_recipe_ui,node_recipe_data,node_favorites_page,node_favorites_ui,node_favorite_ids toneBlue
class node_planner_page,node_planner_ui toneAmber
class node_home_page,node_component_loader,node_navbar,node_footer,node_menu_behavior toneMint
class node_visitor toneIndigo
```

## Components

### Recipe browsing

- [Recipe pages](https://github.com/meganathan223/mealmate/blob/main/pages/recipes.html): `pages/recipes.html`
- [Recipe search and details](https://github.com/meganathan223/mealmate/blob/main/js/recipes.js): `js/recipes.js`
- [Recipe catalog](https://github.com/meganathan223/mealmate/blob/main/data/recipes-data.js): `data/recipes-data.js`
- [Favorites page](https://github.com/meganathan223/mealmate/blob/main/pages/favorites.html): `pages/favorites.html`
- [Favorites controls](https://github.com/meganathan223/mealmate/blob/main/js/favorites.js): `js/favorites.js`
- [Favorite IDs](https://github.com/meganathan223/mealmate/blob/main/data/favorites-id.js): `data/favorites-id.js`

### Meal planning

- [Planner page](https://github.com/meganathan223/mealmate/blob/main/pages/meal-planner.html): `pages/meal-planner.html`
- [Weekly meal planner](https://github.com/meganathan223/mealmate/blob/main/js/meal-planner.js): `js/meal-planner.js`

### Shared site

- [Home page](https://github.com/meganathan223/mealmate/blob/main/index.html): `index.html`
- [Shared component loader](https://github.com/meganathan223/mealmate/blob/main/js/components.js): `js/components.js`
- [Navigation markup](https://github.com/meganathan223/mealmate/blob/main/components/navbar.html): `components/navbar.html`
- [Footer markup](https://github.com/meganathan223/mealmate/blob/main/components/footer.html): `components/footer.html`
- [Menu and active links](https://github.com/meganathan223/mealmate/blob/main/js/main.js): `js/main.js`

### Other components

- **Visitor**

## Connections

- Visitor → Recipe pages: browses (evidence: `README.md`)
- Recipe search and details → Recipe catalog: reads recipes (evidence: `js/recipes.js`)
- Recipe search and details → Recipe pages: renders cards (evidence: `js/recipes.js`)
- Visitor → Planner page: plans meals (evidence: `README.md`)
- Weekly meal planner → Recipe catalog: lists recipes (evidence: `js/meal-planner.js`)
- Weekly meal planner → Planner page: updates week (evidence: `js/meal-planner.js`)
- Visitor → Favorites page: views favorites (evidence: `README.md`)
- Favorites controls → Favorites page: removes recipes (evidence: `js/favorites.js`)
- Favorite IDs → Favorites page
- Shared component loader → Navigation markup: fetches markup (evidence: `js/components.js`)
- Shared component loader → Footer markup: fetches markup (evidence: `js/components.js`)
- Shared component loader → Menu and active links: initializes menu (evidence: `js/components.js`)
- Visitor → Home page: opens site (evidence: `README.md`)
