# anjuuu999/recipe-manager-python architecture

> Architecture diagram of the GitHub repository anjuuu999/recipe-manager-python, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anjuuu999/recipe-manager-python
- Repository: https://github.com/anjuuu999/recipe-manager-python

## Overview

#### Purpose and Entry Point
A standalone Python 3 console application for creating, browsing, searching, and categorizing recipes. The executable entry point and primary application implementation are in `W2212865_recipe_manager.py`.

#### Console Menu Controller
`W2212865_recipe_manager.py` contains the menu-driven control loop and user interaction flow. It presents available operations, collects console input, validates choices, dispatches to recipe operations, and returns users to the menu until exit.

#### Recipe Management Domain
The application manages recipe records containing detailed recipe information, including ingredients and category. Core user capabilities—viewing all recipes, adding recipes, searching by ingredient, and filtering by meal category—are implemented in `W2212865_recipe_manager.py`.

#### Input Validation Boundary
All user-provided menu selections and recipe fields pass through validation logic before processing or persistence. This protects the in-memory recipe workflow from malformed console input and enforces supported categories such as breakfast, lunch, dinner, dessert, and snack. Validation is centralized within `W2212865_recipe_manager.py`.

#### Persistence Layer
Recipe data is persisted as text in `Recipes.txt`. The application reads stored recipes into its working representation at startup or when needed, modifies that representation through user operations, and writes updated data back to `Recipes.txt`. File I/O uses Python built-ins; there is no database or network service.

#### Search and Filtering Flow
Search/filter operations consume the loaded recipe collection without requiring external services:
- Ingredient search selects matching recipe records.
- Category filtering selects recipes belonging to a requested category.
- Result records are rendered as detailed console output.

These flows are implemented by functions in `W2212865_recipe_manager.py` and depend on the persistent source data in `Recipes.txt`.

#### Runtime and Supporting Artifacts
The runtime is Python 3 with standard-library-only dependencies, launched via `python W2212865_recipe_manager.py`. `README.txt` provides original submission documentation, while `W2212865_design_testing.pdf` captures the coursework design and test report; neither is part of the runtime path.

Main entry points: [`W2212865_recipe_manager.py`](https://github.com/anjuuu999/recipe-manager-python/blob/main/W2212865_recipe_manager.py) (Recipe Collection), [`Recipes.txt`](https://github.com/anjuuu999/recipe-manager-python/blob/main/Recipes.txt) (Recipes Store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Python Console Runtime"]
  node_user(("Console User<br/>actor"))
  node_entry["Recipe Manager<br/>Python entry point"]
  node_menu["Menu Controller<br/>control loop"]
  node_console_output["Console Results<br/>output renderer"]
end

subgraph group_domain["Recipe Workflow"]
  node_validation["Input Validation"]
  node_recipe_collection["Recipe Collection<br/>in-memory records"]
  node_add_recipe["Add Recipe<br/>recipe operation"]
  node_browse_recipes["Browse Recipes<br/>recipe operation"]
  node_ingredient_search["Ingredient Search<br/>recipe operation"]
  node_category_filter["Category Filter<br/>recipe operation"]
end

node_recipes_file["Recipes Store<br/>text persistence<br/>[Recipes.txt]"]
node_readme["Submission README<br/>documentation<br/>[README.txt]"]
node_design_report["Design &amp; Test Report<br/>documentation"]

node_user -->|"launches and interacts"| node_entry
node_entry -->|"runs"| node_menu
node_menu -->|"validates input"| node_validation
node_validation -->|"accepted recipe input"| node_add_recipe
node_validation -->|"accepted search input"| node_ingredient_search
node_validation -->|"accepted category"| node_category_filter
node_menu -->|"dispatches"| node_browse_recipes
node_add_recipe -->|"adds record"| node_recipe_collection
node_browse_recipes -->|"reads records"| node_recipe_collection
node_ingredient_search -->|"searches"| node_recipe_collection
node_category_filter -->|"filters"| node_recipe_collection
node_recipe_collection -->|"loads from and saves to"| node_recipes_file
node_browse_recipes -->|"renders"| node_console_output
node_ingredient_search -->|"renders matches"| node_console_output
node_category_filter -->|"renders matches"| node_console_output
node_console_output -->|"displays"| node_user

click node_entry "https://github.com/anjuuu999/recipe-manager-python/blob/main/W2212865_recipe_manager.py"
click node_menu "https://github.com/anjuuu999/recipe-manager-python/blob/main/W2212865_recipe_manager.py"
click node_validation "https://github.com/anjuuu999/recipe-manager-python/blob/main/W2212865_recipe_manager.py"
click node_recipe_collection "https://github.com/anjuuu999/recipe-manager-python/blob/main/W2212865_recipe_manager.py"
click node_add_recipe "https://github.com/anjuuu999/recipe-manager-python/blob/main/W2212865_recipe_manager.py"
click node_browse_recipes "https://github.com/anjuuu999/recipe-manager-python/blob/main/W2212865_recipe_manager.py"
click node_ingredient_search "https://github.com/anjuuu999/recipe-manager-python/blob/main/W2212865_recipe_manager.py"
click node_category_filter "https://github.com/anjuuu999/recipe-manager-python/blob/main/W2212865_recipe_manager.py"
click node_console_output "https://github.com/anjuuu999/recipe-manager-python/blob/main/W2212865_recipe_manager.py"
click node_recipes_file "https://github.com/anjuuu999/recipe-manager-python/blob/main/Recipes.txt"
click node_readme "https://github.com/anjuuu999/recipe-manager-python/blob/main/README.txt"
click node_design_report "https://github.com/anjuuu999/recipe-manager-python/blob/main/W2212865_design_testing.pdf"

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_user,node_entry,node_menu,node_console_output toneBlue
class node_validation,node_recipe_collection,node_add_recipe,node_browse_recipes,node_ingredient_search,node_category_filter toneAmber
class node_recipes_file,node_readme,node_design_report toneNeutral
```

## Components

### Python Console Runtime

- **Console User**: actor
- [Recipe Manager](https://github.com/anjuuu999/recipe-manager-python/blob/main/W2212865_recipe_manager.py): Python entry point · Menu-driven application and primary implementation. · `W2212865_recipe_manager.py`
- [Menu Controller](https://github.com/anjuuu999/recipe-manager-python/blob/main/W2212865_recipe_manager.py): control loop · Collects choices, dispatches operations, and repeats until exit. · `W2212865_recipe_manager.py`
- [Console Results](https://github.com/anjuuu999/recipe-manager-python/blob/main/W2212865_recipe_manager.py): output renderer · Renders detailed recipe records. · `W2212865_recipe_manager.py`

### Recipe Workflow

- [Input Validation](https://github.com/anjuuu999/recipe-manager-python/blob/main/W2212865_recipe_manager.py): validation · Validates menu choices, recipe fields, and supported categories. · `W2212865_recipe_manager.py`
- [Recipe Collection](https://github.com/anjuuu999/recipe-manager-python/blob/main/W2212865_recipe_manager.py): in-memory records · Working recipe representation including ingredients and category. · `W2212865_recipe_manager.py`
- [Add Recipe](https://github.com/anjuuu999/recipe-manager-python/blob/main/W2212865_recipe_manager.py): recipe operation · `W2212865_recipe_manager.py`
- [Browse Recipes](https://github.com/anjuuu999/recipe-manager-python/blob/main/W2212865_recipe_manager.py): recipe operation · `W2212865_recipe_manager.py`
- [Ingredient Search](https://github.com/anjuuu999/recipe-manager-python/blob/main/W2212865_recipe_manager.py): recipe operation · Selects records matching an ingredient. · `W2212865_recipe_manager.py`
- [Category Filter](https://github.com/anjuuu999/recipe-manager-python/blob/main/W2212865_recipe_manager.py): recipe operation · Selects records by meal category. · `W2212865_recipe_manager.py`

### Other components

- [Recipes Store](https://github.com/anjuuu999/recipe-manager-python/blob/main/Recipes.txt): text persistence · Text-backed recipe data. · `Recipes.txt`
- [Submission README](https://github.com/anjuuu999/recipe-manager-python/blob/main/README.txt): documentation · Original submission documentation outside the runtime path. · `README.txt`
- [Design & Test Report](https://github.com/anjuuu999/recipe-manager-python/blob/main/W2212865_design_testing.pdf): documentation · Coursework design and test report outside the runtime path. · `W2212865_design_testing.pdf`

## Connections

- Console User → Recipe Manager: launches and interacts
- Recipe Manager → Menu Controller: runs
- Menu Controller → Input Validation: validates input
- Input Validation → Add Recipe: accepted recipe input
- Input Validation → Ingredient Search: accepted search input
- Input Validation → Category Filter: accepted category
- Menu Controller → Browse Recipes: dispatches
- Add Recipe → Recipe Collection: adds record
- Browse Recipes → Recipe Collection: reads records
- Ingredient Search → Recipe Collection: searches
- Category Filter → Recipe Collection: filters
- Recipe Collection → Recipes Store: loads from and saves to
- Browse Recipes → Console Results: renders
- Ingredient Search → Console Results: renders matches
- Category Filter → Console Results: renders matches
- Console Results → Console User: displays
