# riverify/rikky-takeaway architecture

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

- Interactive diagram: https://gitdiagram.com/riverify/rikky-takeaway
- Repository: https://github.com/riverify/rikky-takeaway

## Overview

Rikky Takeaway is a two-sided takeaway ordering application: staff manage employees, categories, dishes, set meals, and orders in the backend; customers register or log in, browse offerings, manage addresses and a cart, and place and review orders in the mobile-oriented frontend. The Java controllers and service layers expose these domain capabilities, backed by MySQL and Redis caching; email verification is documented. Backend implementation details beyond the sampled controllers and dish/set-meal services are represented at their existing directory paths, so their internal call wiring is not expanded.

Main entry points: [`src/main/java/com/fubukiss/rikky/controller`](https://github.com/riverify/rikky-takeaway/tree/main/src/main/java/com/fubukiss/rikky/controller) (Catalog APIs), [`src/main/java/com/fubukiss/rikky/common`](https://github.com/riverify/rikky-takeaway/tree/main/src/main/java/com/fubukiss/rikky/common) (Shared web support), [`src/main/resources/backend/api`](https://github.com/riverify/rikky-takeaway/tree/main/src/main/resources/backend/api) (Backend UI APIs), [`src/main/resources/front/api`](https://github.com/riverify/rikky-takeaway/tree/main/src/main/resources/front/api) (Frontend UI APIs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Web clients"]
  node_backend_ui["Backend UI APIs"]
  node_frontend_ui["Frontend UI APIs"]
end

subgraph group_access["HTTP access"]
  node_employee_api["Employee API"]
  node_catalog_api["Catalog APIs"]
  node_customer_api["Customer APIs"]
  node_orders_api["Orders API"]
end

subgraph group_catalog["Catalog management"]
  node_employee_domain["Employee management"]
  node_category_domain["Category management"]
  node_dish_domain["Dish and flavors"]
  node_setmeal_domain["Set meal management"]
end

subgraph group_ordering["Customer ordering"]
  node_user_domain["User accounts"]
  node_address_domain["Address book"]
  node_cart_domain["Shopping cart"]
  node_order_domain["Order processing"]
end

subgraph group_state["Application state"]
  node_mysql[("MySQL data")]
  node_redis[("Redis cache")]
  node_common["Shared web support"]
end

node_staff(("Staff member"))
node_customer(("Customer"))
node_email["Email SMTP"]

node_staff -->|"uses"| node_backend_ui
node_customer -->|"uses"| node_frontend_ui
node_backend_ui -->|"requests"| node_employee_api
node_backend_ui -->|"requests"| node_catalog_api
node_backend_ui -->|"requests"| node_orders_api
node_frontend_ui -->|"requests"| node_customer_api
node_frontend_ui -->|"browses"| node_catalog_api
node_frontend_ui -->|"orders"| node_orders_api
node_employee_api -->|"manages"| node_employee_domain
node_catalog_api -->|"manages"| node_category_domain
node_catalog_api -->|"manages"| node_dish_domain
node_catalog_api -->|"manages"| node_setmeal_domain
node_customer_api -->|"authenticates"| node_user_domain
node_customer_api -->|"manages"| node_address_domain
node_customer_api -->|"updates"| node_cart_domain
node_orders_api -->|"processes"| node_order_domain
node_employee_domain -->|"reads/writes"| node_mysql
node_category_domain -->|"reads/writes"| node_mysql
node_dish_domain -->|"reads/writes"| node_mysql
node_setmeal_domain -->|"reads/writes"| node_mysql
node_user_domain -->|"reads/writes"| node_mysql
node_address_domain -->|"reads/writes"| node_mysql
node_cart_domain -->|"reads/writes"| node_mysql
node_order_domain -->|"reads/writes"| node_mysql
node_dish_domain -->|"caches listings"| node_redis
node_setmeal_domain -->|"caches listings"| node_redis
node_user_domain -.->|"sends codes"| node_email
node_common -->|"handles errors"| node_employee_api
node_common -->|"handles errors"| node_catalog_api
node_common -->|"handles errors"| node_customer_api
node_common -->|"handles errors"| node_orders_api

click node_backend_ui "https://github.com/riverify/rikky-takeaway/tree/main/src/main/resources/backend/api"
click node_frontend_ui "https://github.com/riverify/rikky-takeaway/tree/main/src/main/resources/front/api"
click node_employee_api "https://github.com/riverify/rikky-takeaway/blob/main/src/main/java/com/fubukiss/rikky/controller/EmployeeController.java"
click node_catalog_api "https://github.com/riverify/rikky-takeaway/tree/main/src/main/java/com/fubukiss/rikky/controller"
click node_customer_api "https://github.com/riverify/rikky-takeaway/tree/main/src/main/java/com/fubukiss/rikky/controller"
click node_orders_api "https://github.com/riverify/rikky-takeaway/blob/main/src/main/java/com/fubukiss/rikky/controller/OrdersController.java"
click node_employee_domain "https://github.com/riverify/rikky-takeaway/tree/main/src/main/java/com/fubukiss/rikky/service/impl"
click node_category_domain "https://github.com/riverify/rikky-takeaway/tree/main/src/main/java/com/fubukiss/rikky/service/impl"
click node_dish_domain "https://github.com/riverify/rikky-takeaway/blob/main/src/main/java/com/fubukiss/rikky/service/impl/DishServiceImpl.java"
click node_setmeal_domain "https://github.com/riverify/rikky-takeaway/blob/main/src/main/java/com/fubukiss/rikky/service/impl/SetmealServiceImpl.java"
click node_user_domain "https://github.com/riverify/rikky-takeaway/blob/main/src/main/java/com/fubukiss/rikky/service/impl/UserServiceImpl.java"
click node_address_domain "https://github.com/riverify/rikky-takeaway/tree/main/src/main/java/com/fubukiss/rikky/service/impl"
click node_cart_domain "https://github.com/riverify/rikky-takeaway/blob/main/src/main/java/com/fubukiss/rikky/service/impl/ShoppingCartServiceImpl.java"
click node_order_domain "https://github.com/riverify/rikky-takeaway/blob/main/src/main/java/com/fubukiss/rikky/service/impl/OrdersServiceImpl.java"
click node_common "https://github.com/riverify/rikky-takeaway/tree/main/src/main/java/com/fubukiss/rikky/common"

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_backend_ui,node_frontend_ui toneBlue
class node_employee_api,node_catalog_api,node_customer_api,node_orders_api toneAmber
class node_employee_domain,node_category_domain,node_dish_domain,node_setmeal_domain toneMint
class node_user_domain,node_address_domain,node_cart_domain,node_order_domain toneRose
class node_mysql,node_redis,node_common,node_staff,node_customer,node_email toneIndigo
```

## Components

### Web clients

- [Backend UI APIs](https://github.com/riverify/rikky-takeaway/tree/main/src/main/resources/backend/api): `src/main/resources/backend/api`
- [Frontend UI APIs](https://github.com/riverify/rikky-takeaway/tree/main/src/main/resources/front/api): `src/main/resources/front/api`

### HTTP access

- [Employee API](https://github.com/riverify/rikky-takeaway/blob/main/src/main/java/com/fubukiss/rikky/controller/EmployeeController.java): `src/main/java/com/fubukiss/rikky/controller/EmployeeController.java`
- [Catalog APIs](https://github.com/riverify/rikky-takeaway/tree/main/src/main/java/com/fubukiss/rikky/controller): `src/main/java/com/fubukiss/rikky/controller`
- [Customer APIs](https://github.com/riverify/rikky-takeaway/tree/main/src/main/java/com/fubukiss/rikky/controller): `src/main/java/com/fubukiss/rikky/controller`
- [Orders API](https://github.com/riverify/rikky-takeaway/blob/main/src/main/java/com/fubukiss/rikky/controller/OrdersController.java): `src/main/java/com/fubukiss/rikky/controller/OrdersController.java`

### Catalog management

- [Employee management](https://github.com/riverify/rikky-takeaway/tree/main/src/main/java/com/fubukiss/rikky/service/impl): `src/main/java/com/fubukiss/rikky/service/impl`
- [Category management](https://github.com/riverify/rikky-takeaway/tree/main/src/main/java/com/fubukiss/rikky/service/impl): `src/main/java/com/fubukiss/rikky/service/impl`
- [Dish and flavors](https://github.com/riverify/rikky-takeaway/blob/main/src/main/java/com/fubukiss/rikky/service/impl/DishServiceImpl.java): `src/main/java/com/fubukiss/rikky/service/impl/DishServiceImpl.java`
- [Set meal management](https://github.com/riverify/rikky-takeaway/blob/main/src/main/java/com/fubukiss/rikky/service/impl/SetmealServiceImpl.java): `src/main/java/com/fubukiss/rikky/service/impl/SetmealServiceImpl.java`

### Customer ordering

- [User accounts](https://github.com/riverify/rikky-takeaway/blob/main/src/main/java/com/fubukiss/rikky/service/impl/UserServiceImpl.java): `src/main/java/com/fubukiss/rikky/service/impl/UserServiceImpl.java`
- [Address book](https://github.com/riverify/rikky-takeaway/tree/main/src/main/java/com/fubukiss/rikky/service/impl): `src/main/java/com/fubukiss/rikky/service/impl`
- [Shopping cart](https://github.com/riverify/rikky-takeaway/blob/main/src/main/java/com/fubukiss/rikky/service/impl/ShoppingCartServiceImpl.java): `src/main/java/com/fubukiss/rikky/service/impl/ShoppingCartServiceImpl.java`
- [Order processing](https://github.com/riverify/rikky-takeaway/blob/main/src/main/java/com/fubukiss/rikky/service/impl/OrdersServiceImpl.java): `src/main/java/com/fubukiss/rikky/service/impl/OrdersServiceImpl.java`

### Application state

- **MySQL data**
- **Redis cache**
- [Shared web support](https://github.com/riverify/rikky-takeaway/tree/main/src/main/java/com/fubukiss/rikky/common): `src/main/java/com/fubukiss/rikky/common`

### Other components

- **Staff member**
- **Customer**
- **Email SMTP**

## Connections

- Staff member → Backend UI APIs: uses
- Customer → Frontend UI APIs: uses
- Backend UI APIs → Employee API: requests
- Backend UI APIs → Catalog APIs: requests
- Backend UI APIs → Orders API: requests
- Frontend UI APIs → Customer APIs: requests
- Frontend UI APIs → Catalog APIs: browses
- Frontend UI APIs → Orders API: orders
- Employee API → Employee management: manages
- Catalog APIs → Category management: manages
- Catalog APIs → Dish and flavors: manages
- Catalog APIs → Set meal management: manages
- Customer APIs → User accounts: authenticates
- Customer APIs → Address book: manages
- Customer APIs → Shopping cart: updates
- Orders API → Order processing: processes
- Employee management → MySQL data: reads/writes
- Category management → MySQL data: reads/writes
- Dish and flavors → MySQL data: reads/writes
- Set meal management → MySQL data: reads/writes
- User accounts → MySQL data: reads/writes
- Address book → MySQL data: reads/writes
- Shopping cart → MySQL data: reads/writes
- Order processing → MySQL data: reads/writes
- Dish and flavors → Redis cache: caches listings
- Set meal management → Redis cache: caches listings
- User accounts → Email SMTP: sends codes
- Shared web support → Employee API: handles errors
- Shared web support → Catalog APIs: handles errors
- Shared web support → Customer APIs: handles errors
- Shared web support → Orders API: handles errors
