# asmaa6777/web architecture

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

- Interactive diagram: https://gitdiagram.com/asmaa6777/web
- Repository: https://github.com/asmaa6777/web

## Overview

Recipe Finder is a Django application for discovering and saving recipes, with account/profile features and a staff content-management dashboard. The principal user flow is browsing or searching recipes, opening a recipe, and optionally saving it as a favorite; trending ranks recipes by favorites. Staff can manage recipes and accounts, with activity recorded in a log. The graph includes the documented seed and image-sync capabilities. Edges reflect shown calls or README statements; unsampled route wiring and database interactions are not asserted.

Main entry points: [`management/views.py`](https://github.com/asmaa6777/web/blob/main/management/views.py) (Staff dashboard and actions), [`recipes/models.py`](https://github.com/asmaa6777/web/blob/main/recipes/models.py) (Recipe and category), [`recipes/views.py`](https://github.com/asmaa6777/web/blob/main/recipes/views.py) (Browse and search), [`social/views.py`](https://github.com/asmaa6777/web/blob/main/social/views.py) (Favorites and trending)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_accounts["Accounts"]
  node_account_views["Account and profile<br/>[views.py]"]
  node_user_model["Custom user<br/>[models.py]"]
end

subgraph group_recipes["Recipe discovery"]
  node_recipe_views["Browse and search<br/>[views.py]"]
  node_recipe_model["Recipe and category<br/>[models.py]"]
end

subgraph group_social["Favorites and trends"]
  node_social_views["Favorites and trending<br/>[views.py]"]
  node_favorite_model["Favorite records<br/>[models.py]"]
end

subgraph group_staff["Staff management"]
  node_staff_views["Staff dashboard and actions<br/>[views.py]"]
  node_recipe_form["Recipe form<br/>[forms.py]"]
  node_activity_log["User activity log<br/>[models.py]"]
end

subgraph group_data_ops["Recipe data operations"]
  node_seed_command["Seed recipes and categories<br/>[seed_data.py]"]
  node_image_sync["Sync recipe images"]
  node_image_map["Recipe image map"]
end

node_visitor(("Visitor or user"))

node_visitor -->|"browse or search"| node_recipe_views
node_visitor -->|"manage account"| node_account_views
node_visitor -->|"save or explore"| node_social_views
node_visitor -->|"manage content"| node_staff_views
node_account_views -->|"creates and updates"| node_user_model
node_recipe_views -->|"queries recipes"| node_recipe_model
node_recipe_views -->|"checks favorites"| node_favorite_model
node_social_views -->|"queries recipes"| node_recipe_model
node_social_views -->|"reads and toggles"| node_favorite_model
node_staff_views -->|"manages users"| node_user_model
node_staff_views -->|"manages recipes"| node_recipe_model
node_staff_views -->|"validates recipe edits"| node_recipe_form
node_staff_views -->|"records activity"| node_activity_log
node_seed_command -->|"creates recipes"| node_recipe_model
node_seed_command -->|"runs image sync"| node_image_sync
node_image_sync -->|"looks up filenames"| node_image_map

click node_account_views "https://github.com/asmaa6777/web/blob/main/accounts/views.py"
click node_user_model "https://github.com/asmaa6777/web/blob/main/accounts/models.py"
click node_recipe_views "https://github.com/asmaa6777/web/blob/main/recipes/views.py"
click node_recipe_model "https://github.com/asmaa6777/web/blob/main/recipes/models.py"
click node_social_views "https://github.com/asmaa6777/web/blob/main/social/views.py"
click node_favorite_model "https://github.com/asmaa6777/web/blob/main/social/models.py"
click node_staff_views "https://github.com/asmaa6777/web/blob/main/management/views.py"
click node_recipe_form "https://github.com/asmaa6777/web/blob/main/recipes/forms.py"
click node_activity_log "https://github.com/asmaa6777/web/blob/main/management/models.py"
click node_seed_command "https://github.com/asmaa6777/web/blob/main/recipes/management/commands/seed_data.py"
click node_image_sync "https://github.com/asmaa6777/web/blob/main/recipes/sync_recipe_images.py"
click node_image_map "https://github.com/asmaa6777/web/blob/main/recipes/recipe_image_map.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_account_views,node_user_model,node_visitor toneBlue
class node_recipe_views,node_recipe_model toneAmber
class node_social_views,node_favorite_model toneMint
class node_staff_views,node_recipe_form,node_activity_log toneRose
class node_seed_command,node_image_sync,node_image_map toneIndigo
```

## Components

### Accounts

- [Account and profile](https://github.com/asmaa6777/web/blob/main/accounts/views.py): `accounts/views.py`
- [Custom user](https://github.com/asmaa6777/web/blob/main/accounts/models.py): `accounts/models.py`

### Recipe discovery

- [Browse and search](https://github.com/asmaa6777/web/blob/main/recipes/views.py): `recipes/views.py`
- [Recipe and category](https://github.com/asmaa6777/web/blob/main/recipes/models.py): `recipes/models.py`

### Favorites and trends

- [Favorites and trending](https://github.com/asmaa6777/web/blob/main/social/views.py): `social/views.py`
- [Favorite records](https://github.com/asmaa6777/web/blob/main/social/models.py): `social/models.py`

### Staff management

- [Staff dashboard and actions](https://github.com/asmaa6777/web/blob/main/management/views.py): `management/views.py`
- [Recipe form](https://github.com/asmaa6777/web/blob/main/recipes/forms.py): `recipes/forms.py`
- [User activity log](https://github.com/asmaa6777/web/blob/main/management/models.py): `management/models.py`

### Recipe data operations

- [Seed recipes and categories](https://github.com/asmaa6777/web/blob/main/recipes/management/commands/seed_data.py): `recipes/management/commands/seed_data.py`
- [Sync recipe images](https://github.com/asmaa6777/web/blob/main/recipes/sync_recipe_images.py): `recipes/sync_recipe_images.py`
- [Recipe image map](https://github.com/asmaa6777/web/blob/main/recipes/recipe_image_map.py): `recipes/recipe_image_map.py`

### Other components

- **Visitor or user**

## Connections

- Visitor or user → Browse and search: browse or search (evidence: `README.md`)
- Visitor or user → Account and profile: manage account (evidence: `README.md`)
- Visitor or user → Favorites and trending: save or explore (evidence: `README.md`)
- Visitor or user → Staff dashboard and actions: manage content (evidence: `README.md`)
- Account and profile → Custom user: creates and updates (evidence: `accounts/views.py`)
- Browse and search → Recipe and category: queries recipes (evidence: `recipes/views.py`)
- Browse and search → Favorite records: checks favorites (evidence: `recipes/views.py`)
- Favorites and trending → Recipe and category: queries recipes (evidence: `social/views.py`)
- Favorites and trending → Favorite records: reads and toggles (evidence: `social/views.py`)
- Staff dashboard and actions → Custom user: manages users (evidence: `management/views.py`)
- Staff dashboard and actions → Recipe and category: manages recipes (evidence: `management/views.py`)
- Staff dashboard and actions → Recipe form: validates recipe edits (evidence: `management/views.py`)
- Staff dashboard and actions → User activity log: records activity (evidence: `management/views.py`)
- Seed recipes and categories → Recipe and category: creates recipes (evidence: `recipes/management/commands/seed_data.py`)
- Seed recipes and categories → Sync recipe images: runs image sync (evidence: `recipes/management/commands/seed_data.py`)
- Sync recipe images → Recipe image map: looks up filenames (evidence: `recipes/sync_recipe_images.py`)
