# wenxun2002/tastie architecture

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

- Interactive diagram: https://gitdiagram.com/wenxun2002/tastie
- Repository: https://github.com/wenxun2002/tastie

## Overview

TasTie is a Flutter recipe-sharing app with Firebase-backed services. Its apparent user journey is to browse or search recipes, optionally use weather context to guide discovery, and create or share recipes; authentication, reporting, and moderation support that experience. The tree also shows server-side AI recipe generation and weather context, plus engagement and dashboard metrics. Flutter application sources were not excerpted, so client-side interactions and most feature wiring are represented as unverified rather than asserted. Backend links reflect the sampled Cloud Function code.

Main entry points: [`functions/src/index.ts`](https://github.com/wenxun2002/tastie/blob/main/functions/src/index.ts) (Function exports), [`functions/src/weatherContext.ts`](https://github.com/wenxun2002/tastie/blob/main/functions/src/weatherContext.ts) (Weather function), [`functions/src/userModeration.ts`](https://github.com/wenxun2002/tastie/blob/main/functions/src/userModeration.ts) (User moderation), [`lib/common/services/weather_service.dart`](https://github.com/wenxun2002/tastie/blob/main/lib/common/services/weather_service.dart) (Weather context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Flutter app"]
  node_app["App entry<br/>[main.dart]"]
  node_auth["Authentication"]
end

subgraph group_recipe["Recipe experience"]
  node_browse["Recipe browsing"]
  node_detail["Recipe details"]
  node_search["Recipe search"]
  node_create["Recipe creation"]
  node_report["Recipe reporting"]
end

subgraph group_services["Client services"]
  node_weather_client["Weather context"]
  node_recipe_service["Recipe services"]
  node_smart_generate["Smart Generate"]
  node_repositories["Firestore repositories"]
end

subgraph group_backend["Cloud Functions"]
  node_moderation["User moderation<br/>[userModeration.ts]"]
  node_weather_function["Weather function<br/>[weatherContext.ts]"]
  node_function_router["Function exports<br/>[index.ts]"]
  node_metrics["Dashboard metrics<br/>[index.ts]"]
end

subgraph group_data["Firebase data"]
  node_firestore[("Cloud Firestore")]
  node_firebase_auth["Firebase Auth"]
end

node_user(("App user"))
node_gemini["Gemini API"]
node_openweather["OpenWeather API"]

node_user -.->|"uses"| node_app
node_function_router -->|"exports"| node_weather_function
node_function_router -->|"exports"| node_moderation
node_function_router -->|"calls"| node_gemini
node_function_router -->|"reads and writes"| node_firestore
node_weather_function -->|"reads rules"| node_firestore
node_weather_function -->|"requests weather"| node_openweather
node_moderation -->|"updates account"| node_firebase_auth
node_moderation -->|"updates recipes"| node_firestore
node_metrics -->|"stores metrics"| node_firestore
node_smart_generate -.->|"invokes callable"| node_function_router
node_weather_client -.->|"requests context"| node_weather_function
node_repositories -.->|"accesses data"| node_firestore

click node_app "https://github.com/wenxun2002/tastie/blob/main/lib/main.dart"
click node_auth "https://github.com/wenxun2002/tastie/tree/main/lib/pages/auth"
click node_browse "https://github.com/wenxun2002/tastie/tree/main/lib/pages/index_page"
click node_detail "https://github.com/wenxun2002/tastie/tree/main/lib/pages/index_page/index_detail_page"
click node_search "https://github.com/wenxun2002/tastie/tree/main/lib/pages/Search_Page"
click node_create "https://github.com/wenxun2002/tastie/blob/main/lib/pages/create_post_page.dart"
click node_report "https://github.com/wenxun2002/tastie/tree/main/lib/pages/report"
click node_weather_client "https://github.com/wenxun2002/tastie/blob/main/lib/common/services/weather_service.dart"
click node_recipe_service "https://github.com/wenxun2002/tastie/blob/main/lib/services/create_recipe_service.dart"
click node_smart_generate "https://github.com/wenxun2002/tastie/blob/main/lib/services/smart_generate_service.dart"
click node_repositories "https://github.com/wenxun2002/tastie/tree/main/lib/repositories"
click node_moderation "https://github.com/wenxun2002/tastie/blob/main/functions/src/userModeration.ts"
click node_weather_function "https://github.com/wenxun2002/tastie/blob/main/functions/src/weatherContext.ts"
click node_function_router "https://github.com/wenxun2002/tastie/blob/main/functions/src/index.ts"
click node_metrics "https://github.com/wenxun2002/tastie/blob/main/functions/src/index.ts"

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_app,node_auth,node_user toneBlue
class node_browse,node_detail,node_search,node_create,node_report toneAmber
class node_weather_client,node_recipe_service,node_smart_generate,node_repositories,node_gemini,node_openweather toneMint
class node_moderation,node_weather_function,node_function_router,node_metrics toneRose
class node_firestore,node_firebase_auth toneIndigo
```

## Components

### Flutter app

- [App entry](https://github.com/wenxun2002/tastie/blob/main/lib/main.dart): `lib/main.dart`
- [Authentication](https://github.com/wenxun2002/tastie/tree/main/lib/pages/auth): `lib/pages/auth`

### Recipe experience

- [Recipe browsing](https://github.com/wenxun2002/tastie/tree/main/lib/pages/index_page): `lib/pages/index_page`
- [Recipe details](https://github.com/wenxun2002/tastie/tree/main/lib/pages/index_page/index_detail_page): `lib/pages/index_page/index_detail_page`
- [Recipe search](https://github.com/wenxun2002/tastie/tree/main/lib/pages/Search_Page): `lib/pages/Search_Page`
- [Recipe creation](https://github.com/wenxun2002/tastie/blob/main/lib/pages/create_post_page.dart): `lib/pages/create_post_page.dart`
- [Recipe reporting](https://github.com/wenxun2002/tastie/tree/main/lib/pages/report): `lib/pages/report`

### Client services

- [Weather context](https://github.com/wenxun2002/tastie/blob/main/lib/common/services/weather_service.dart): `lib/common/services/weather_service.dart`
- [Recipe services](https://github.com/wenxun2002/tastie/blob/main/lib/services/create_recipe_service.dart): `lib/services/create_recipe_service.dart`
- [Smart Generate](https://github.com/wenxun2002/tastie/blob/main/lib/services/smart_generate_service.dart): `lib/services/smart_generate_service.dart`
- [Firestore repositories](https://github.com/wenxun2002/tastie/tree/main/lib/repositories): `lib/repositories`

### Cloud Functions

- [User moderation](https://github.com/wenxun2002/tastie/blob/main/functions/src/userModeration.ts): `functions/src/userModeration.ts`
- [Weather function](https://github.com/wenxun2002/tastie/blob/main/functions/src/weatherContext.ts): `functions/src/weatherContext.ts`
- [Function exports](https://github.com/wenxun2002/tastie/blob/main/functions/src/index.ts): `functions/src/index.ts`
- [Dashboard metrics](https://github.com/wenxun2002/tastie/blob/main/functions/src/index.ts): `functions/src/index.ts`

### Firebase data

- **Cloud Firestore**
- **Firebase Auth**

### Other components

- **App user**
- **Gemini API**
- **OpenWeather API**

## Connections

- App user → App entry: uses
- Function exports → Weather function: exports (evidence: `functions/src/index.ts`)
- Function exports → User moderation: exports (evidence: `functions/src/index.ts`)
- Function exports → Gemini API: calls (evidence: `functions/src/index.ts`)
- Function exports → Cloud Firestore: reads and writes (evidence: `functions/src/index.ts`)
- Weather function → Cloud Firestore: reads rules (evidence: `functions/src/weatherContext.ts`)
- Weather function → OpenWeather API: requests weather (evidence: `functions/src/weatherContext.ts`)
- User moderation → Firebase Auth: updates account (evidence: `functions/src/userModeration.ts`)
- User moderation → Cloud Firestore: updates recipes (evidence: `functions/src/userModeration.ts`)
- Dashboard metrics → Cloud Firestore: stores metrics (evidence: `functions/src/index.ts`)
- Smart Generate → Function exports: invokes callable
- Weather context → Weather function: requests context
- Firestore repositories → Cloud Firestore: accesses data
