# rathorchanchal1/order-delivery-system architecture

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

- Interactive diagram: https://gitdiagram.com/rathorchanchal1/order-delivery-system
- Repository: https://github.com/rathorchanchal1/order-delivery-system

## Overview

This repository contains a Spring Boot order-delivery application plus a separate notification application. The documented workflow is cart creation, payment verification, order confirmation, Kafka messaging, and order-state progression. The graph follows README-described relationships; source excerpts were unavailable, so implementation details beyond the file tree are not inferred. The README’s scheduler and service boundaries are not represented by clear implementation paths in the tree.

Main entry points: [`orderDeliverySystem/src/main/java/com/example/demo/Service/OrderService.java`](https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Service/OrderService.java) (Order management), [`orderDeliverySystem/src/main/java/com/example/demo/Controller/CartController.java`](https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Controller/CartController.java) (Cart API), [`orderDeliverySystem/src/main/java/com/example/demo/Service/CartService.java`](https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Service/CartService.java) (Cart operations), [`orderDeliverySystem/src/main/java/com/example/demo/Controller/PaymentController.java`](https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Controller/PaymentController.java) (Payment API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_commerce["Shopping and payments"]
  node_cart_api["Cart API"]
  node_cart_service["Cart operations<br/>[CartService.java]"]
  node_cart_store[("Cart storage<br/>[CartRepo.java]")]
  node_payment_api["Payment API"]
  node_payment_service["Payment processing"]
  node_payment_store[("Payment storage<br/>[PaymentRepo.java]")]
end

subgraph group_orders["Order workflow"]
  node_order_api["Order API"]
  node_order_service["Order management<br/>[OrderService.java]"]
  node_order_store[("Order storage<br/>[OrderRepo.java]")]
  node_state_machine["Order state machine"]
  node_status_store[("Status storage")]
end

subgraph group_messaging["Messaging"]
  node_kafka["Kafka"]
  node_notification_consumer["Notification consumer<br/>[KafkaConsumer.java]"]
end

node_customer(("Customer"))

node_customer -->|"adds products"| node_cart_api
node_cart_api -->|"handles cart"| node_cart_service
node_cart_service -->|"initiates payment"| node_payment_api
node_payment_api -->|"processes payment"| node_payment_service
node_payment_service -->|"confirms paid cart"| node_order_api
node_order_api -->|"manages order"| node_order_service
node_order_service -->|"publishes status"| node_kafka
node_order_service -->|"tracks status"| node_state_machine
node_kafka -.->|"delivers events"| node_notification_consumer

click node_cart_api "https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Controller/CartController.java"
click node_cart_service "https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Service/CartService.java"
click node_cart_store "https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Repository/CartRepo.java"
click node_payment_api "https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Controller/PaymentController.java"
click node_payment_service "https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Service/PaymentService.java"
click node_payment_store "https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Repository/PaymentRepo.java"
click node_order_api "https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Controller/OrderController.java"
click node_order_service "https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Service/OrderService.java"
click node_order_store "https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Repository/OrderRepo.java"
click node_state_machine "https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Config/StateMachineConfig.java"
click node_status_store "https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Repository/StatusRepository.java"
click node_notification_consumer "https://github.com/rathorchanchal1/order-delivery-system/blob/main/Notification/src/main/java/com/example/Notification/Kafka/KafkaConsumer.java"

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_cart_api,node_cart_service,node_cart_store,node_payment_api,node_payment_service,node_payment_store toneBlue
class node_order_api,node_order_service,node_order_store,node_state_machine,node_status_store toneAmber
class node_kafka,node_notification_consumer toneMint
class node_customer toneIndigo
```

## Components

### Shopping and payments

- [Cart API](https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Controller/CartController.java): `orderDeliverySystem/src/main/java/com/example/demo/Controller/CartController.java`
- [Cart operations](https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Service/CartService.java): `orderDeliverySystem/src/main/java/com/example/demo/Service/CartService.java`
- [Cart storage](https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Repository/CartRepo.java): `orderDeliverySystem/src/main/java/com/example/demo/Repository/CartRepo.java`
- [Payment API](https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Controller/PaymentController.java): `orderDeliverySystem/src/main/java/com/example/demo/Controller/PaymentController.java`
- [Payment processing](https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Service/PaymentService.java): `orderDeliverySystem/src/main/java/com/example/demo/Service/PaymentService.java`
- [Payment storage](https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Repository/PaymentRepo.java): `orderDeliverySystem/src/main/java/com/example/demo/Repository/PaymentRepo.java`

### Order workflow

- [Order API](https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Controller/OrderController.java): `orderDeliverySystem/src/main/java/com/example/demo/Controller/OrderController.java`
- [Order management](https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Service/OrderService.java): `orderDeliverySystem/src/main/java/com/example/demo/Service/OrderService.java`
- [Order storage](https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Repository/OrderRepo.java): `orderDeliverySystem/src/main/java/com/example/demo/Repository/OrderRepo.java`
- [Order state machine](https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Config/StateMachineConfig.java): `orderDeliverySystem/src/main/java/com/example/demo/Config/StateMachineConfig.java`
- [Status storage](https://github.com/rathorchanchal1/order-delivery-system/blob/main/orderDeliverySystem/src/main/java/com/example/demo/Repository/StatusRepository.java): `orderDeliverySystem/src/main/java/com/example/demo/Repository/StatusRepository.java`

### Messaging

- **Kafka**
- [Notification consumer](https://github.com/rathorchanchal1/order-delivery-system/blob/main/Notification/src/main/java/com/example/Notification/Kafka/KafkaConsumer.java): `Notification/src/main/java/com/example/Notification/Kafka/KafkaConsumer.java`

### Other components

- **Customer**

## Connections

- Customer → Cart API: adds products (evidence: `README.md`)
- Cart API → Cart operations: handles cart (evidence: `README.md`)
- Cart operations → Payment API: initiates payment (evidence: `README.md`)
- Payment API → Payment processing: processes payment (evidence: `README.md`)
- Payment processing → Order API: confirms paid cart (evidence: `README.md`)
- Order API → Order management: manages order (evidence: `README.md`)
- Order management → Kafka: publishes status (evidence: `README.md`)
- Order management → Order state machine: tracks status (evidence: `README.md`)
- Kafka → Notification consumer: delivers events
