# ahmedyasser1-9/web-assignment architecture

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

- Interactive diagram: https://gitdiagram.com/ahmedyasser1-9/web-assignment
- Repository: https://github.com/ahmedyasser1-9/web-assignment

## Overview

Tasty Django is a recipe-sharing web application with recipe browsing and search, recipe creation and editing, favorites, and user sign-up and login. A browser user reaches HTML pages served by Django; the JavaScript frontend requests recipe and favorites data and submits changes through API routes. Those routes dispatch to views, which read and update recipe, favorite, and user records. The graph also preserves the Django admin capability. Source excerpts show the main request paths; some frontend pages and view implementations were not sampled, so their internal links are omitted.

Main entry points: [`tasty_django/recipes/urls.py`](https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/recipes/urls.py) (API routing), [`tasty_django/recipes/views.py`](https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/recipes/views.py) (Favorites API), [`tasty_django/recipes/models.py`](https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/recipes/models.py) (Recipe records), [`tasty_django/tasty_django/urls.py`](https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/tasty_django/urls.py) (Root page routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Browser experience"]
  node_pages["HTML pages"]
  node_recipe_ui["Recipe interactions<br/>[functions.js]"]
  node_recipe_detail_ui["Recipe detail view<br/>[recipe-template.js]"]
end

subgraph group_web["Django web layer"]
  node_django_routes["Root page routing<br/>[urls.py]"]
  node_api_routes["API routing<br/>[urls.py]"]
  node_recipe_views["Recipe API<br/>[views.py]"]
  node_favorite_views["Favorites API<br/>[views.py]"]
  node_account_views["Account API<br/>[views.py]"]
  node_serializers["API serializers<br/>[serializers.py]"]
end

subgraph group_domain["Recipe and account domain"]
  node_recipe_records["Recipe records<br/>[models.py]"]
  node_favorite_records["Favorite records<br/>[models.py]"]
  node_user_records["User accounts<br/>[models.py]"]
  node_database[("SQLite database<br/>[db.sqlite3]")]
end

subgraph group_operations["Administration"]
  node_django_admin["Django admin<br/>[admin.py]"]
end

node_visitor(("Browser user"))

node_visitor -->|"opens pages"| node_pages
node_django_routes -->|"serves pages"| node_pages
node_django_routes -->|"includes routes"| node_api_routes
node_api_routes -->|"routes recipes"| node_recipe_views
node_api_routes -->|"routes favorites"| node_favorite_views
node_api_routes -->|"routes accounts"| node_account_views
node_recipe_ui -->|"requests recipes"| node_recipe_views
node_recipe_detail_ui -->|"fetches recipes"| node_recipe_views
node_recipe_ui -->|"requests favorites"| node_favorite_views
node_recipe_views -->|"reads and writes"| node_recipe_records
node_favorite_views -->|"reads and writes"| node_favorite_records
node_favorite_views -->|"looks up recipes"| node_recipe_records
node_account_views -->|"checks accounts"| node_user_records
node_serializers -->|"serializes records"| node_recipe_records
node_django_admin -->|"served by admin route"| node_django_routes
node_recipe_records -.->|"persists in"| node_database
node_favorite_records -.->|"persists in"| node_database
node_user_records -.->|"persists in"| node_database

click node_pages "https://github.com/ahmedyasser1-9/web-assignment/tree/main/tasty_django"
click node_recipe_ui "https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/JS/functions.js"
click node_recipe_detail_ui "https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/JS/recipe-template.js"
click node_django_routes "https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/tasty_django/urls.py"
click node_api_routes "https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/recipes/urls.py"
click node_recipe_views "https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/recipes/views.py"
click node_favorite_views "https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/recipes/views.py"
click node_account_views "https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/recipes/views.py"
click node_serializers "https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/recipes/serializers.py"
click node_recipe_records "https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/recipes/models.py"
click node_favorite_records "https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/recipes/models.py"
click node_user_records "https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/recipes/models.py"
click node_database "https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/db.sqlite3"
click node_django_admin "https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/recipes/admin.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_pages,node_recipe_ui,node_recipe_detail_ui,node_visitor toneBlue
class node_django_routes,node_api_routes,node_recipe_views,node_favorite_views,node_account_views,node_serializers toneAmber
class node_recipe_records,node_favorite_records,node_user_records,node_database toneMint
class node_django_admin toneRose
```

## Components

### Browser experience

- [HTML pages](https://github.com/ahmedyasser1-9/web-assignment/tree/main/tasty_django): `tasty_django`
- [Recipe interactions](https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/JS/functions.js): `tasty_django/JS/functions.js`
- [Recipe detail view](https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/JS/recipe-template.js): `tasty_django/JS/recipe-template.js`

### Django web layer

- [Root page routing](https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/tasty_django/urls.py): `tasty_django/tasty_django/urls.py`
- [API routing](https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/recipes/urls.py): `tasty_django/recipes/urls.py`
- [Recipe API](https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/recipes/views.py): `tasty_django/recipes/views.py`
- [Favorites API](https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/recipes/views.py): `tasty_django/recipes/views.py`
- [Account API](https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/recipes/views.py): `tasty_django/recipes/views.py`
- [API serializers](https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/recipes/serializers.py): `tasty_django/recipes/serializers.py`

### Recipe and account domain

- [Recipe records](https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/recipes/models.py): `tasty_django/recipes/models.py`
- [Favorite records](https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/recipes/models.py): `tasty_django/recipes/models.py`
- [User accounts](https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/recipes/models.py): `tasty_django/recipes/models.py`
- [SQLite database](https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/db.sqlite3): `tasty_django/db.sqlite3`

### Administration

- [Django admin](https://github.com/ahmedyasser1-9/web-assignment/blob/main/tasty_django/recipes/admin.py): `tasty_django/recipes/admin.py`

### Other components

- **Browser user**

## Connections

- Browser user → HTML pages: opens pages (evidence: `tasty_django/tasty_django/urls.py`)
- Root page routing → HTML pages: serves pages (evidence: `tasty_django/tasty_django/urls.py`)
- Root page routing → API routing: includes routes (evidence: `tasty_django/tasty_django/urls.py`)
- API routing → Recipe API: routes recipes (evidence: `tasty_django/recipes/urls.py`)
- API routing → Favorites API: routes favorites (evidence: `tasty_django/recipes/urls.py`)
- API routing → Account API: routes accounts (evidence: `tasty_django/recipes/urls.py`)
- Recipe interactions → Recipe API: requests recipes (evidence: `tasty_django/JS/functions.js`)
- Recipe detail view → Recipe API: fetches recipes (evidence: `tasty_django/JS/recipe-template.js`)
- Recipe interactions → Favorites API: requests favorites (evidence: `tasty_django/JS/functions.js`)
- Recipe API → Recipe records: reads and writes (evidence: `tasty_django/recipes/views.py`)
- Favorites API → Favorite records: reads and writes (evidence: `tasty_django/recipes/views.py`)
- Favorites API → Recipe records: looks up recipes (evidence: `tasty_django/recipes/views.py`)
- Account API → User accounts: checks accounts (evidence: `tasty_django/recipes/views.py`)
- API serializers → Recipe records: serializes records (evidence: `tasty_django/recipes/serializers.py`)
- Django admin → Root page routing: served by admin route (evidence: `tasty_django/tasty_django/urls.py`)
- Recipe records → SQLite database: persists in
- Favorite records → SQLite database: persists in
- User accounts → SQLite database: persists in
