# official-arvind/upipaymentalert architecture

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

- Interactive diagram: https://gitdiagram.com/official-arvind/upipaymentalert
- Repository: https://github.com/official-arvind/upipaymentalert

## Overview

UPI Payment Alert turns an Android phone into an offline payment soundbox. The main workflow is incoming bank SMS or payment-app notification, payment extraction and duplicate suppression, then spoken announcement; users configure language, volume, and speech speed in the app. The README also documents multilingual UI and speech, optional carrier SMS forwarding, and automatic startup. Runtime source was not excerpted, so edges reflect README-documented behavior; implementation-level wiring and ownership cannot be verified.

Main entry points: [`app/src/main/java/com/example/upipaymentalert/ForegroundTtsService.java`](https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/ForegroundTtsService.java) (Foreground speech service), [`app/src/main/java/com/example/upipaymentalert/broadcastreciever/SmsListener.java`](https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/broadcastreciever/SmsListener.java) (Bank SMS listener), [`app/src/main/java/com/example/upipaymentalert/NotificationListener.java`](https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/NotificationListener.java) (Payment notification listener), [`app/src/main/java/com/example/upipaymentalert/MainActivity.java`](https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/MainActivity.java) (Settings and payment screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Payment inputs"]
  node_sms["Bank SMS listener<br/>[SmsListener.java]"]
  node_notifications["Payment notification listener"]
end

subgraph group_processing["Payment processing"]
  node_parser["SMS payment parser<br/>[SmsParser.java]"]
  node_phrases["Announcement phrases"]
  node_transaction["Payment transaction"]
  node_db[("Transaction database<br/>[AppDatabase.java]")]
  node_dao["Transaction access"]
  node_notification_model["App notification model"]
end

subgraph group_speech["Speech and language"]
  node_locale["UI language switching<br/>[LocaleHelper.java]"]
  node_tts_helper["Speech engine helper"]
  node_tts_service["Foreground speech service"]
end

subgraph group_app["App and settings"]
  node_main["Settings and payment screen<br/>[MainActivity.java]"]
  node_adapter["Payment list adapter"]
  node_autostart["Automatic startup helper"]
end

node_user(("Merchant"))
node_android(("Android device"))

node_android -->|"delivers SMS"| node_sms
node_android -->|"delivers alerts"| node_notifications
node_sms -.->|"parses payment"| node_parser
node_notifications -.->|"extracts payment"| node_parser
node_parser -.->|"extracts details"| node_transaction
node_sms -.->|"announces payment"| node_tts_service
node_notifications -->|"announces payment"| node_tts_service
node_user -->|"configures soundbox"| node_main
node_main -.->|"switches language"| node_locale
node_main -->|"tests sound"| node_tts_service
node_tts_service -.->|"uses speech engine"| node_tts_helper
node_tts_service -.->|"speaks phrases"| node_phrases
node_autostart -.->|"requests startup"| node_android

click node_sms "https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/broadcastreciever/SmsListener.java"
click node_notifications "https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/NotificationListener.java"
click node_parser "https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/smsparser/SmsParser.java"
click node_phrases "https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/smsparser/AnnouncementPhrases.java"
click node_transaction "https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/model/PaymentTransaction.java"
click node_db "https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/db/AppDatabase.java"
click node_dao "https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/db/TransactionDao.java"
click node_notification_model "https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/model/AppNotification.java"
click node_main "https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/MainActivity.java"
click node_adapter "https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/PaymentAdapter.java"
click node_locale "https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/LocaleHelper.java"
click node_tts_helper "https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/TtsEngineHelper.java"
click node_tts_service "https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/ForegroundTtsService.java"
click node_autostart "https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/AutoStartHelper.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_sms,node_notifications toneBlue
class node_parser,node_phrases,node_transaction,node_db,node_dao,node_notification_model toneAmber
class node_locale,node_tts_helper,node_tts_service toneMint
class node_main,node_adapter,node_autostart toneRose
class node_user,node_android toneIndigo
```

## Components

### Payment inputs

- [Bank SMS listener](https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/broadcastreciever/SmsListener.java): `app/src/main/java/com/example/upipaymentalert/broadcastreciever/SmsListener.java`
- [Payment notification listener](https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/NotificationListener.java): `app/src/main/java/com/example/upipaymentalert/NotificationListener.java`

### Payment processing

- [SMS payment parser](https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/smsparser/SmsParser.java): `app/src/main/java/com/example/upipaymentalert/smsparser/SmsParser.java`
- [Announcement phrases](https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/smsparser/AnnouncementPhrases.java): `app/src/main/java/com/example/upipaymentalert/smsparser/AnnouncementPhrases.java`
- [Payment transaction](https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/model/PaymentTransaction.java): `app/src/main/java/com/example/upipaymentalert/model/PaymentTransaction.java`
- [Transaction database](https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/db/AppDatabase.java): `app/src/main/java/com/example/upipaymentalert/db/AppDatabase.java`
- [Transaction access](https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/db/TransactionDao.java): `app/src/main/java/com/example/upipaymentalert/db/TransactionDao.java`
- [App notification model](https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/model/AppNotification.java): `app/src/main/java/com/example/upipaymentalert/model/AppNotification.java`

### Speech and language

- [UI language switching](https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/LocaleHelper.java): `app/src/main/java/com/example/upipaymentalert/LocaleHelper.java`
- [Speech engine helper](https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/TtsEngineHelper.java): `app/src/main/java/com/example/upipaymentalert/TtsEngineHelper.java`
- [Foreground speech service](https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/ForegroundTtsService.java): `app/src/main/java/com/example/upipaymentalert/ForegroundTtsService.java`

### App and settings

- [Settings and payment screen](https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/MainActivity.java): `app/src/main/java/com/example/upipaymentalert/MainActivity.java`
- [Payment list adapter](https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/PaymentAdapter.java): `app/src/main/java/com/example/upipaymentalert/PaymentAdapter.java`
- [Automatic startup helper](https://github.com/official-arvind/upipaymentalert/blob/main/app/src/main/java/com/example/upipaymentalert/AutoStartHelper.java): `app/src/main/java/com/example/upipaymentalert/AutoStartHelper.java`

### Other components

- **Merchant**
- **Android device**

## Connections

- Android device → Bank SMS listener: delivers SMS (evidence: `README.md`)
- Android device → Payment notification listener: delivers alerts (evidence: `README.md`)
- Bank SMS listener → SMS payment parser: parses payment
- Payment notification listener → SMS payment parser: extracts payment
- SMS payment parser → Payment transaction: extracts details
- Bank SMS listener → Foreground speech service: announces payment
- Payment notification listener → Foreground speech service: announces payment (evidence: `README.md`)
- Merchant → Settings and payment screen: configures soundbox (evidence: `README.md`)
- Settings and payment screen → UI language switching: switches language
- Settings and payment screen → Foreground speech service: tests sound (evidence: `README.md`)
- Foreground speech service → Speech engine helper: uses speech engine
- Foreground speech service → Announcement phrases: speaks phrases
- Automatic startup helper → Android device: requests startup
