# dana0507/wonka-s-chocolate-app architecture

> Architecture diagram of the GitHub repository dana0507/wonka-s-chocolate-app, 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/dana0507/wonka-s-chocolate-app
- Repository: https://github.com/dana0507/wonka-s-chocolate-app

## Overview

Wonka is a chocolate-shopping Android app backed by PHP endpoints and a MySQL database. Its apparent user journey spans account access, product discovery and chocolate customization, favorites and cart management, checkout, and profile or ticket features. The tree supports these distinct product areas, but no README or Android source excerpts were provided, so Android navigation and client-to-server calls cannot be verified; those links are omitted. PHP-to-database operations and shared connection imports are shown where the excerpts or source index provide evidence.

Main entry points: [`wonka/connection.php`](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/connection.php) (Database connection), [`wonka (2).sql`](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka%20(2).sql) (Wonka database), [`wonka/login.php`](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/login.php) (Authentication endpoints), [`wonka/signup.php`](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/signup.php) (Registration endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_android["Android app"]
  node_app_entry["App entry<br/>[MainActivity.java]"]
  node_catalog_ui["Product browsing"]
  node_product_ui["Product details"]
  node_custom_ui["Chocolate builder<br/>[chooseType.java]"]
  node_cart_ui["Cart and checkout"]
  node_favorites_ui["Favorites"]
  node_profile_ui["User profile"]
end

subgraph group_accounts["Accounts and profile"]
  node_auth["Login and signup<br/>[LoginActivity.java]"]
  node_auth_api["Authentication endpoints<br/>[login.php]"]
  node_signup_api["Registration endpoint<br/>[signup.php]"]
  node_profile_api["Profile endpoints<br/>[update_profile.php]"]
  node_user_api["User lookup<br/>[get_user.php]"]
end

subgraph group_shopping["Shopping and checkout"]
  node_catalog_api["Product catalog<br/>[get_products.php]"]
  node_cart_api["Cart endpoints<br/>[addToCart.php]"]
  node_favorites_api["Favorite endpoints<br/>[get_favorites.php]"]
  node_orders_api["Order creation<br/>[add_order.php]"]
end

subgraph group_extras["Customization and tickets"]
  node_builder_api["Chocolate persistence<br/>[save_chocolate.php]"]
  node_ingredients_api["Ingredient lookup<br/>[getIngredients.php]"]
  node_ticket_api["Ticket validation<br/>[check_code.php]"]
end

subgraph group_backend["PHP backend"]
  node_db_connection["Database connection<br/>[connection.php]"]
  node_database[("Wonka database<br/>[wonka &#40;2&#41;.sql]")]
end

node_shopper(("Shopper"))

node_shopper -.->|"uses"| node_app_entry
node_shopper -.->|"authenticates"| node_auth
node_auth_api -->|"imports"| node_db_connection
node_signup_api -->|"imports"| node_db_connection
node_profile_api -->|"imports"| node_db_connection
node_user_api -->|"imports"| node_db_connection
node_cart_api -->|"imports"| node_db_connection
node_orders_api -->|"imports"| node_db_connection
node_builder_api -->|"imports"| node_db_connection
node_ingredients_api -->|"imports"| node_db_connection
node_ticket_api -->|"imports"| node_db_connection
node_auth_api -->|"queries users"| node_database
node_signup_api -->|"writes users"| node_database
node_profile_api -->|"updates users"| node_database
node_user_api -->|"reads users"| node_database
node_cart_api -->|"updates carts"| node_database
node_orders_api -->|"writes orders"| node_database
node_builder_api -->|"writes products"| node_database
node_ingredients_api -->|"reads ingredients"| node_database
node_ticket_api -->|"checks tickets"| node_database

click node_app_entry "https://github.com/dana0507/wonka-s-chocolate-app/blob/main/app/src/main/java/com/example/wonka/MainActivity.java"
click node_catalog_ui "https://github.com/dana0507/wonka-s-chocolate-app/blob/main/app/src/main/java/com/example/wonka/ProductsActivity.java"
click node_product_ui "https://github.com/dana0507/wonka-s-chocolate-app/blob/main/app/src/main/java/com/example/wonka/ProductViewActivity.java"
click node_custom_ui "https://github.com/dana0507/wonka-s-chocolate-app/blob/main/app/src/main/java/com/example/wonka/chooseType.java"
click node_cart_ui "https://github.com/dana0507/wonka-s-chocolate-app/blob/main/app/src/main/java/com/example/wonka/CheckoutActivity.java"
click node_favorites_ui "https://github.com/dana0507/wonka-s-chocolate-app/blob/main/app/src/main/java/com/example/wonka/FavoritesListActivity.java"
click node_profile_ui "https://github.com/dana0507/wonka-s-chocolate-app/blob/main/app/src/main/java/com/example/wonka/UserProfileActivity.java"
click node_auth "https://github.com/dana0507/wonka-s-chocolate-app/blob/main/app/src/main/java/com/example/wonka/LoginActivity.java"
click node_auth_api "https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/login.php"
click node_signup_api "https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/signup.php"
click node_profile_api "https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/update_profile.php"
click node_user_api "https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/get_user.php"
click node_catalog_api "https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/get_products.php"
click node_cart_api "https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/addToCart.php"
click node_favorites_api "https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/get_favorites.php"
click node_orders_api "https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/add_order.php"
click node_builder_api "https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/save_chocolate.php"
click node_ingredients_api "https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/getIngredients.php"
click node_ticket_api "https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/check_code.php"
click node_db_connection "https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/connection.php"
click node_database "https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka%20(2).sql"

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_entry,node_catalog_ui,node_product_ui,node_custom_ui,node_cart_ui,node_favorites_ui,node_profile_ui toneBlue
class node_auth,node_auth_api,node_signup_api,node_profile_api,node_user_api toneAmber
class node_catalog_api,node_cart_api,node_favorites_api,node_orders_api toneMint
class node_builder_api,node_ingredients_api,node_ticket_api toneRose
class node_db_connection,node_database,node_shopper toneIndigo
```

## Components

### Android app

- [App entry](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/app/src/main/java/com/example/wonka/MainActivity.java): `app/src/main/java/com/example/wonka/MainActivity.java`
- [Product browsing](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/app/src/main/java/com/example/wonka/ProductsActivity.java): `app/src/main/java/com/example/wonka/ProductsActivity.java`
- [Product details](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/app/src/main/java/com/example/wonka/ProductViewActivity.java): `app/src/main/java/com/example/wonka/ProductViewActivity.java`
- [Chocolate builder](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/app/src/main/java/com/example/wonka/chooseType.java): `app/src/main/java/com/example/wonka/chooseType.java`
- [Cart and checkout](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/app/src/main/java/com/example/wonka/CheckoutActivity.java): `app/src/main/java/com/example/wonka/CheckoutActivity.java`
- [Favorites](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/app/src/main/java/com/example/wonka/FavoritesListActivity.java): `app/src/main/java/com/example/wonka/FavoritesListActivity.java`
- [User profile](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/app/src/main/java/com/example/wonka/UserProfileActivity.java): `app/src/main/java/com/example/wonka/UserProfileActivity.java`

### Accounts and profile

- [Login and signup](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/app/src/main/java/com/example/wonka/LoginActivity.java): `app/src/main/java/com/example/wonka/LoginActivity.java`
- [Authentication endpoints](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/login.php): `wonka/login.php`
- [Registration endpoint](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/signup.php): `wonka/signup.php`
- [Profile endpoints](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/update_profile.php): `wonka/update_profile.php`
- [User lookup](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/get_user.php): `wonka/get_user.php`

### Shopping and checkout

- [Product catalog](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/get_products.php): `wonka/get_products.php`
- [Cart endpoints](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/addToCart.php): `wonka/addToCart.php`
- [Favorite endpoints](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/get_favorites.php): `wonka/get_favorites.php`
- [Order creation](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/add_order.php): `wonka/add_order.php`

### Customization and tickets

- [Chocolate persistence](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/save_chocolate.php): `wonka/save_chocolate.php`
- [Ingredient lookup](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/getIngredients.php): `wonka/getIngredients.php`
- [Ticket validation](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/check_code.php): `wonka/check_code.php`

### PHP backend

- [Database connection](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka/connection.php): `wonka/connection.php`
- [Wonka database](https://github.com/dana0507/wonka-s-chocolate-app/blob/main/wonka%20(2).sql): `wonka (2).sql`

### Other components

- **Shopper**

## Connections

- Shopper → App entry: uses
- Shopper → Login and signup: authenticates
- Authentication endpoints → Database connection: imports (evidence: `wonka/login.php`)
- Registration endpoint → Database connection: imports (evidence: `wonka/signup.php`)
- Profile endpoints → Database connection: imports (evidence: `wonka/update_profile.php`)
- User lookup → Database connection: imports (evidence: `wonka/get_user.php`)
- Cart endpoints → Database connection: imports (evidence: `wonka/addToCart.php`)
- Order creation → Database connection: imports (evidence: `wonka/add_order.php`)
- Chocolate persistence → Database connection: imports (evidence: `wonka/save_chocolate.php`)
- Ingredient lookup → Database connection: imports (evidence: `wonka/getIngredients.php`)
- Ticket validation → Database connection: imports (evidence: `wonka/check_code.php`)
- Authentication endpoints → Wonka database: queries users (evidence: `wonka/login.php`)
- Registration endpoint → Wonka database: writes users (evidence: `wonka/signup.php`)
- Profile endpoints → Wonka database: updates users (evidence: `wonka/update_profile.php`)
- User lookup → Wonka database: reads users (evidence: `wonka/get_user.php`)
- Cart endpoints → Wonka database: updates carts (evidence: `wonka/addToCart.php`)
- Order creation → Wonka database: writes orders (evidence: `wonka/add_order.php`)
- Chocolate persistence → Wonka database: writes products (evidence: `wonka/save_chocolate.php`)
- Ingredient lookup → Wonka database: reads ingredients (evidence: `wonka/getIngredients.php`)
- Ticket validation → Wonka database: checks tickets (evidence: `wonka/check_code.php`)
