# ewostatewos18/payment_verification_frontend architecture

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

- Interactive diagram: https://gitdiagram.com/ewostatewos18/payment_verification_frontend
- Repository: https://github.com/ewostatewos18/payment_verification_frontend

## Overview

This is a Next.js frontend for verifying Ethiopian bank and mobile-money payments. Users choose Telebirr, BOA, or CBE, provide transaction details or a receipt image (upload or camera capture), and submit for backend verification; the result is presented as success, failure, validation, or manual-entry guidance. Bank pages coordinate input and verification, while shared components handle history and result presentation. The README documents all three bank APIs and image verification. Some source is only partially excerpted, so unverified internal calls are omitted.

Main entry points: [`src/components/ResultModal.tsx`](https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/components/ResultModal.tsx) (Result dispatcher), [`src/app/telebirr/page.tsx`](https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/app/telebirr/page.tsx) (Telebirr verification), [`src/app/boa/page.tsx`](https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/app/boa/page.tsx) (BOA verification), [`src/app/cbe/page.tsx`](https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/app/cbe/page.tsx) (CBE verification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_verification["Bank verification"]
  node_home["Bank selection<br/>[page.tsx]"]
  node_telebirr["Telebirr verification<br/>[page.tsx]"]
  node_boa["BOA verification<br/>[page.tsx]"]
  node_cbe["CBE verification<br/>[page.tsx]"]
end

subgraph group_shared_ui["Shared interface"]
  node_layout["Bank layout"]
  node_history_input["History input<br/>[HistoryInput.tsx]"]
  node_result["Result dispatcher<br/>[ResultModal.tsx]"]
  node_success["Success display<br/>[SuccessModal.tsx]"]
  node_error["Error display<br/>[ErrorModal.tsx]"]
  node_manual["Manual verification"]
  node_validation["Validation display"]
end

subgraph group_services["Verification services"]
  node_modal_helpers["Result formatting<br/>[modalHelpers.ts]"]
  node_api["API client<br/>[api.ts]"]
  node_error_handler["Error handling<br/>[errorHandler.ts]"]
  node_history_store[("Verification history")]
  node_response_types["Verification types<br/>[verification.ts]"]
end

node_user(("User"))
node_backend{{"Laravel API"}}

node_user -->|"selects bank"| node_home
node_user -->|"submits details"| node_telebirr
node_user -->|"submits details"| node_boa
node_user -->|"submits details"| node_cbe
node_telebirr -->|"requests verification"| node_api
node_boa -->|"requests verification"| node_api
node_cbe -->|"requests verification"| node_api
node_api -->|"posts verification"| node_backend
node_telebirr -->|"processes errors"| node_error_handler
node_boa -->|"processes errors"| node_error_handler
node_cbe -->|"processes errors"| node_error_handler
node_telebirr -->|"shows response"| node_result
node_boa -->|"shows response"| node_result
node_cbe -->|"shows response"| node_result
node_telebirr -->|"renders input"| node_history_input
node_boa -->|"renders input"| node_history_input
node_cbe -->|"renders input"| node_history_input
node_history_input -->|"loads history"| node_history_store
node_layout -->|"renders result"| node_result
node_result -->|"evaluates response"| node_modal_helpers
node_result -->|"renders success"| node_success
node_result -->|"renders failure"| node_error
node_result -->|"renders manual flow"| node_manual
node_result -->|"renders validation"| node_validation
node_error -->|"gets error info"| node_modal_helpers

click node_home "https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/app/page.tsx"
click node_telebirr "https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/app/telebirr/page.tsx"
click node_boa "https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/app/boa/page.tsx"
click node_cbe "https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/app/cbe/page.tsx"
click node_layout "https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/components/BankVerificationLayout.tsx"
click node_history_input "https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/components/HistoryInput.tsx"
click node_result "https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/components/ResultModal.tsx"
click node_success "https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/components/modals/SuccessModal.tsx"
click node_error "https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/components/modals/ErrorModal.tsx"
click node_manual "https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/components/modals/ManualVerificationModal.tsx"
click node_validation "https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/components/modals/ValidationErrorModal.tsx"
click node_modal_helpers "https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/utils/modalHelpers.ts"
click node_api "https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/lib/api.ts"
click node_error_handler "https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/lib/errorHandler.ts"
click node_history_store "https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/utils/verificationHistory.ts"
click node_response_types "https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/types/verification.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_home,node_telebirr,node_boa,node_cbe,node_user toneBlue
class node_layout,node_history_input,node_result,node_success,node_error,node_manual,node_validation toneAmber
class node_modal_helpers,node_api,node_error_handler,node_history_store,node_response_types,node_backend toneMint
```

## Components

### Bank verification

- [Bank selection](https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Telebirr verification](https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/app/telebirr/page.tsx): `src/app/telebirr/page.tsx`
- [BOA verification](https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/app/boa/page.tsx): `src/app/boa/page.tsx`
- [CBE verification](https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/app/cbe/page.tsx): `src/app/cbe/page.tsx`

### Shared interface

- [Bank layout](https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/components/BankVerificationLayout.tsx): `src/components/BankVerificationLayout.tsx`
- [History input](https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/components/HistoryInput.tsx): `src/components/HistoryInput.tsx`
- [Result dispatcher](https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/components/ResultModal.tsx): `src/components/ResultModal.tsx`
- [Success display](https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/components/modals/SuccessModal.tsx): `src/components/modals/SuccessModal.tsx`
- [Error display](https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/components/modals/ErrorModal.tsx): `src/components/modals/ErrorModal.tsx`
- [Manual verification](https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/components/modals/ManualVerificationModal.tsx): `src/components/modals/ManualVerificationModal.tsx`
- [Validation display](https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/components/modals/ValidationErrorModal.tsx): `src/components/modals/ValidationErrorModal.tsx`

### Verification services

- [Result formatting](https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/utils/modalHelpers.ts): `src/utils/modalHelpers.ts`
- [API client](https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/lib/api.ts): `src/lib/api.ts`
- [Error handling](https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/lib/errorHandler.ts): `src/lib/errorHandler.ts`
- [Verification history](https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/utils/verificationHistory.ts): `src/utils/verificationHistory.ts`
- [Verification types](https://github.com/ewostatewos18/payment_verification_frontend/blob/main/src/types/verification.ts): `src/types/verification.ts`

### Other components

- **User**
- **Laravel API**

## Connections

- User → Bank selection: selects bank (evidence: `README.md`)
- User → Telebirr verification: submits details (evidence: `README.md`)
- User → BOA verification: submits details (evidence: `README.md`)
- User → CBE verification: submits details (evidence: `README.md`)
- Telebirr verification → API client: requests verification (evidence: `src/app/telebirr/page.tsx`)
- BOA verification → API client: requests verification (evidence: `src/app/boa/page.tsx`)
- CBE verification → API client: requests verification (evidence: `src/app/cbe/page.tsx`)
- API client → Laravel API: posts verification (evidence: `src/lib/api.ts`)
- Telebirr verification → Error handling: processes errors (evidence: `src/app/telebirr/page.tsx`)
- BOA verification → Error handling: processes errors (evidence: `src/app/boa/page.tsx`)
- CBE verification → Error handling: processes errors (evidence: `src/app/cbe/page.tsx`)
- Telebirr verification → Result dispatcher: shows response (evidence: `src/app/telebirr/page.tsx`)
- BOA verification → Result dispatcher: shows response (evidence: `src/app/boa/page.tsx`)
- CBE verification → Result dispatcher: shows response (evidence: `src/app/cbe/page.tsx`)
- Telebirr verification → History input: renders input (evidence: `src/app/telebirr/page.tsx`)
- BOA verification → History input: renders input (evidence: `src/app/boa/page.tsx`)
- CBE verification → History input: renders input (evidence: `src/app/cbe/page.tsx`)
- History input → Verification history: loads history (evidence: `src/components/HistoryInput.tsx`)
- Bank layout → Result dispatcher: renders result (evidence: `src/components/BankVerificationLayout.tsx`)
- Result dispatcher → Result formatting: evaluates response (evidence: `src/components/ResultModal.tsx`)
- Result dispatcher → Success display: renders success (evidence: `src/components/ResultModal.tsx`)
- Result dispatcher → Error display: renders failure (evidence: `src/components/ResultModal.tsx`)
- Result dispatcher → Manual verification: renders manual flow (evidence: `src/components/ResultModal.tsx`)
- Result dispatcher → Validation display: renders validation (evidence: `src/components/ResultModal.tsx`)
- Error display → Result formatting: gets error info (evidence: `src/components/modals/ErrorModal.tsx`)
