# mah3456/wasfati architecture

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

- Interactive diagram: https://gitdiagram.com/mah3456/wasfati
- Repository: https://github.com/mah3456/wasfati

## Overview

This is a Flutter recipe-sharing app backed by a Flask API. The main workflow is user sign-in, browsing or filtering recipes, opening recipe details, and optionally creating a recipe with an image; users can also comment, favorite recipes, and manage their profiles. The graph separates mobile presentation/state/API access from backend route domains and persistence. Flutter source excerpts were not provided, so client-side links follow the README’s documented architecture; backend links reflect sampled route and app-factory code.

Main entry points: [`api backend/api/src/__init__.py`](https://github.com/mah3456/wasfati/blob/main/api%20backend/api/src/__init__.py) (App factory), [`api backend/api/src/Recipe/routes.py`](https://github.com/mah3456/wasfati/blob/main/api%20backend/api/src/Recipe/routes.py) (Recipe routes), [`app/lib/presentation/providers`](https://github.com/mah3456/wasfati/tree/main/app/lib/presentation/providers) (State providers), [`api backend/api/src/extensions.py`](https://github.com/mah3456/wasfati/blob/main/api%20backend/api/src/extensions.py) (Database extension)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Flutter app"]
  node_mobile_entry["App entry<br/>[main.dart]"]
  node_auth_views["Authentication"]
  node_home_view["Recipe browsing<br/>[home.dart]"]
  node_recipe_views["Recipe screens"]
  node_user_views["User screens"]
  node_providers["State providers"]
  node_api_clients["API clients"]
end

subgraph group_backend["Flask API"]
  node_api_server["API server<br/>[app.py]"]
  node_app_factory["App factory<br/>[__init__.py]"]
  node_user_routes["User routes<br/>[routes.py]"]
  node_recipe_routes["Recipe routes<br/>[routes.py]"]
  node_comment_routes["Comment routes<br/>[routes.py]"]
  node_favorite_routes["Favorite routes<br/>[routes.py]"]
end

subgraph group_data["Persistence and media"]
  node_models["Domain models<br/>[models.py]"]
  node_db_extensions["Database extension<br/>[extensions.py]"]
  node_database[("SQL database")]
  node_image_processing["Image processing"]
  node_uploads[("Recipe uploads")]
end

node_user(("App user"))

node_user -->|"uses"| node_mobile_entry
node_mobile_entry -->|"opens"| node_auth_views
node_mobile_entry -->|"opens"| node_home_view
node_user -->|"creates and views"| node_recipe_views
node_user -->|"manages account"| node_user_views
node_auth_views -.->|"updates state"| node_providers
node_home_view -.->|"reads state"| node_providers
node_recipe_views -.->|"updates state"| node_providers
node_user_views -.->|"updates state"| node_providers
node_providers -.->|"requests data"| node_api_clients
node_api_clients -.->|"sends requests"| node_api_server
node_api_server -->|"creates app"| node_app_factory
node_app_factory -->|"registers"| node_user_routes
node_app_factory -->|"registers"| node_recipe_routes
node_app_factory -->|"registers"| node_comment_routes
node_app_factory -->|"registers"| node_favorite_routes
node_user_routes -->|"queries and commits"| node_db_extensions
node_recipe_routes -->|"queries and commits"| node_db_extensions
node_comment_routes -->|"queries and commits"| node_db_extensions
node_favorite_routes -->|"queries and commits"| node_db_extensions
node_user_routes -->|"uses user model"| node_models
node_recipe_routes -->|"uses recipe model"| node_models
node_comment_routes -->|"uses domain models"| node_models
node_favorite_routes -->|"uses favorite model"| node_models
node_db_extensions -->|"persists records"| node_database
node_recipe_routes -->|"processes uploads"| node_image_processing
node_recipe_routes -->|"stores images"| node_uploads

click node_mobile_entry "https://github.com/mah3456/wasfati/blob/main/app/lib/main.dart"
click node_auth_views "https://github.com/mah3456/wasfati/tree/main/app/lib/presentation/view/auth"
click node_home_view "https://github.com/mah3456/wasfati/blob/main/app/lib/presentation/view/home.dart"
click node_recipe_views "https://github.com/mah3456/wasfati/tree/main/app/lib/presentation/view/recipes"
click node_user_views "https://github.com/mah3456/wasfati/tree/main/app/lib/presentation/view/user"
click node_providers "https://github.com/mah3456/wasfati/tree/main/app/lib/presentation/providers"
click node_api_clients "https://github.com/mah3456/wasfati/tree/main/app/lib/services/api"
click node_api_server "https://github.com/mah3456/wasfati/blob/main/api%20backend/api/app.py"
click node_app_factory "https://github.com/mah3456/wasfati/blob/main/api%20backend/api/src/__init__.py"
click node_user_routes "https://github.com/mah3456/wasfati/blob/main/api%20backend/api/src/User/routes.py"
click node_recipe_routes "https://github.com/mah3456/wasfati/blob/main/api%20backend/api/src/Recipe/routes.py"
click node_comment_routes "https://github.com/mah3456/wasfati/blob/main/api%20backend/api/src/Comments/routes.py"
click node_favorite_routes "https://github.com/mah3456/wasfati/blob/main/api%20backend/api/src/User/Favorites/routes.py"
click node_models "https://github.com/mah3456/wasfati/blob/main/api%20backend/api/src/models.py"
click node_db_extensions "https://github.com/mah3456/wasfati/blob/main/api%20backend/api/src/extensions.py"
click node_image_processing "https://github.com/mah3456/wasfati/blob/main/api%20backend/api/src/Recipe/removImageBackgroudn.py"
click node_uploads "https://github.com/mah3456/wasfati/tree/main/api%20backend/api/src/uploads/images"

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_mobile_entry,node_auth_views,node_home_view,node_recipe_views,node_user_views,node_providers,node_api_clients,node_user toneBlue
class node_api_server,node_app_factory,node_user_routes,node_recipe_routes,node_comment_routes,node_favorite_routes toneAmber
class node_models,node_db_extensions,node_database,node_image_processing,node_uploads toneMint
```

## Components

### Flutter app

- [App entry](https://github.com/mah3456/wasfati/blob/main/app/lib/main.dart): `app/lib/main.dart`
- [Authentication](https://github.com/mah3456/wasfati/tree/main/app/lib/presentation/view/auth): `app/lib/presentation/view/auth`
- [Recipe browsing](https://github.com/mah3456/wasfati/blob/main/app/lib/presentation/view/home.dart): `app/lib/presentation/view/home.dart`
- [Recipe screens](https://github.com/mah3456/wasfati/tree/main/app/lib/presentation/view/recipes): `app/lib/presentation/view/recipes`
- [User screens](https://github.com/mah3456/wasfati/tree/main/app/lib/presentation/view/user): `app/lib/presentation/view/user`
- [State providers](https://github.com/mah3456/wasfati/tree/main/app/lib/presentation/providers): `app/lib/presentation/providers`
- [API clients](https://github.com/mah3456/wasfati/tree/main/app/lib/services/api): `app/lib/services/api`

### Flask API

- [API server](https://github.com/mah3456/wasfati/blob/main/api%20backend/api/app.py): `api backend/api/app.py`
- [App factory](https://github.com/mah3456/wasfati/blob/main/api%20backend/api/src/__init__.py): `api backend/api/src/__init__.py`
- [User routes](https://github.com/mah3456/wasfati/blob/main/api%20backend/api/src/User/routes.py): `api backend/api/src/User/routes.py`
- [Recipe routes](https://github.com/mah3456/wasfati/blob/main/api%20backend/api/src/Recipe/routes.py): `api backend/api/src/Recipe/routes.py`
- [Comment routes](https://github.com/mah3456/wasfati/blob/main/api%20backend/api/src/Comments/routes.py): `api backend/api/src/Comments/routes.py`
- [Favorite routes](https://github.com/mah3456/wasfati/blob/main/api%20backend/api/src/User/Favorites/routes.py): `api backend/api/src/User/Favorites/routes.py`

### Persistence and media

- [Domain models](https://github.com/mah3456/wasfati/blob/main/api%20backend/api/src/models.py): `api backend/api/src/models.py`
- [Database extension](https://github.com/mah3456/wasfati/blob/main/api%20backend/api/src/extensions.py): `api backend/api/src/extensions.py`
- **SQL database**
- [Image processing](https://github.com/mah3456/wasfati/blob/main/api%20backend/api/src/Recipe/removImageBackgroudn.py): `api backend/api/src/Recipe/removImageBackgroudn.py`
- [Recipe uploads](https://github.com/mah3456/wasfati/tree/main/api%20backend/api/src/uploads/images): `api backend/api/src/uploads/images`

### Other components

- **App user**

## Connections

- App user → App entry: uses
- App entry → Authentication: opens
- App entry → Recipe browsing: opens
- App user → Recipe screens: creates and views
- App user → User screens: manages account
- Authentication → State providers: updates state
- Recipe browsing → State providers: reads state
- Recipe screens → State providers: updates state
- User screens → State providers: updates state
- State providers → API clients: requests data
- API clients → API server: sends requests
- API server → App factory: creates app
- App factory → User routes: registers
- App factory → Recipe routes: registers
- App factory → Comment routes: registers
- App factory → Favorite routes: registers
- User routes → Database extension: queries and commits
- Recipe routes → Database extension: queries and commits
- Comment routes → Database extension: queries and commits
- Favorite routes → Database extension: queries and commits
- User routes → Domain models: uses user model
- Recipe routes → Domain models: uses recipe model
- Comment routes → Domain models: uses domain models
- Favorite routes → Domain models: uses favorite model
- Database extension → SQL database: persists records
- Recipe routes → Image processing: processes uploads
- Recipe routes → Recipe uploads: stores images
