# adampuchala/recruitment-task architecture

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

- Interactive diagram: https://gitdiagram.com/adampuchala/recruitment-task
- Repository: https://github.com/adampuchala/recruitment-task

## Overview

Recruitment Bank System combines account and financial-operation APIs, a mobile BFF, and asynchronous outbox/audit processing; the repository also includes a Kotlin Multiplatform client. The principal banking flow is account setup, then deposit/withdrawal/transfer with operation history, followed by outbox publication and audit persistence. The README documents the service boundaries and consistency model; sampled source supports key application-service and persistence relationships. Mobile client internals are only partially sampled, so its feature-level links are limited to visible references and documented BFF use.

Main entry points: [`mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/ConferenceService.kt`](https://github.com/adampuchala/recruitment-task/blob/main/mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/ConferenceService.kt) (Conference features), [`financial-operations-service/src/main/kotlin/com/adampuchala/bank/financial/application/FinancialApplicationService.kt`](https://github.com/adampuchala/recruitment-task/blob/main/financial-operations-service/src/main/kotlin/com/adampuchala/bank/financial/application/FinancialApplicationService.kt) (Operation processing), [`mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/App.kt`](https://github.com/adampuchala/recruitment-task/blob/main/mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/App.kt) (Mobile app), [`mobile-bff/src/main/kotlin/com/adampuchala/bank/mobile/adapter/out/WebClientDownstreamAdapters.kt`](https://github.com/adampuchala/recruitment-task/blob/main/mobile-bff/src/main/kotlin/com/adampuchala/bank/mobile/adapter/out/WebClientDownstreamAdapters.kt) (HTTP adapters)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile Client"]
  node_mobile_app["Mobile app<br/>[App.kt]"]
  node_conference["Conference features"]
  node_mobile_api["Application API<br/>[ApplicationApi.kt]"]
  node_mobile_storage[("Local settings")]
  node_notifications["Local notifications"]
end

subgraph group_edge["API Edge"]
  node_mobile_bff["Mobile BFF"]
  node_bff_facade["Account facade"]
  node_downstream["HTTP adapters"]
end

subgraph group_accounts["Account Service"]
  node_account_api["Account API"]
  node_account_service["Account application"]
  node_account_domain["Account model<br/>[Account.kt]"]
  node_account_repository[("Account persistence")]
end

subgraph group_financial["Financial Operations"]
  node_financial_api["Operations API"]
  node_financial_service["Operation processing"]
  node_financial_rules["Financial rules<br/>[FinancialRules.kt]"]
  node_financial_repository[("Operation persistence")]
end

subgraph group_events["Events and Audit"]
  node_event_contract["Completion event"]
  node_outbox["Outbox worker<br/>[OutboxPublisher.kt]"]
  node_audit_consumer["Audit consumer"]
  node_audit_handler["Audit handler"]
  node_audit_repository[("Audit persistence")]
end

node_user(("Bank customer"))
node_kafka["Redpanda Kafka"]

node_user -->|"uses"| node_mobile_app
node_mobile_app -.->|"calls"| node_mobile_api
node_mobile_app -.->|"presents"| node_conference
node_conference -->|"fetches config"| node_mobile_api
node_conference -->|"reads and writes"| node_mobile_storage
node_conference -->|"schedules"| node_notifications
node_mobile_api -->|"calls"| node_mobile_bff
node_mobile_bff -->|"delegates"| node_bff_facade
node_bff_facade -.->|"uses adapters"| node_downstream
node_downstream -->|"calls account"| node_account_api
node_downstream -->|"calls deposits"| node_financial_api
node_user -->|"manages accounts"| node_account_api
node_user -->|"requests operations"| node_financial_api
node_account_api -->|"invokes"| node_account_service
node_account_service -->|"reads and writes"| node_account_repository
node_account_service -->|"applies policy"| node_account_domain
node_financial_api -->|"invokes"| node_financial_service
node_financial_service -->|"reads and writes"| node_financial_repository
node_financial_service -->|"validates"| node_financial_rules
node_financial_service -->|"creates event"| node_event_contract
node_financial_repository -->|"stores transactionally"| node_outbox
node_outbox -->|"publishes"| node_kafka
node_kafka -->|"delivers events"| node_audit_consumer
node_audit_consumer -.->|"handles events"| node_audit_handler
node_audit_handler -->|"persists event"| node_audit_repository

click node_mobile_app "https://github.com/adampuchala/recruitment-task/blob/main/mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/App.kt"
click node_conference "https://github.com/adampuchala/recruitment-task/blob/main/mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/ConferenceService.kt"
click node_mobile_api "https://github.com/adampuchala/recruitment-task/blob/main/mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/network/ApplicationApi.kt"
click node_mobile_storage "https://github.com/adampuchala/recruitment-task/blob/main/mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/storage/ApplicationStorageImpl.kt"
click node_notifications "https://github.com/adampuchala/recruitment-task/blob/main/mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/LocalNotificationService.kt"
click node_mobile_bff "https://github.com/adampuchala/recruitment-task/blob/main/mobile-bff/src/main/kotlin/com/adampuchala/bank/mobile/adapter/in/MobileController.kt"
click node_bff_facade "https://github.com/adampuchala/recruitment-task/blob/main/mobile-bff/src/main/kotlin/com/adampuchala/bank/mobile/application/MobileAccountFacade.kt"
click node_downstream "https://github.com/adampuchala/recruitment-task/blob/main/mobile-bff/src/main/kotlin/com/adampuchala/bank/mobile/adapter/out/WebClientDownstreamAdapters.kt"
click node_account_api "https://github.com/adampuchala/recruitment-task/blob/main/account-service/src/main/kotlin/com/adampuchala/bank/account/adapter/in/AccountController.kt"
click node_account_service "https://github.com/adampuchala/recruitment-task/blob/main/account-service/src/main/kotlin/com/adampuchala/bank/account/application/AccountApplicationService.kt"
click node_account_domain "https://github.com/adampuchala/recruitment-task/blob/main/account-service/src/main/kotlin/com/adampuchala/bank/account/domain/Account.kt"
click node_account_repository "https://github.com/adampuchala/recruitment-task/blob/main/account-service/src/main/kotlin/com/adampuchala/bank/account/adapter/out/PostgresAccountRepository.kt"
click node_financial_api "https://github.com/adampuchala/recruitment-task/blob/main/financial-operations-service/src/main/kotlin/com/adampuchala/bank/financial/adapter/in/FinancialController.kt"
click node_financial_service "https://github.com/adampuchala/recruitment-task/blob/main/financial-operations-service/src/main/kotlin/com/adampuchala/bank/financial/application/FinancialApplicationService.kt"
click node_financial_rules "https://github.com/adampuchala/recruitment-task/blob/main/financial-operations-service/src/main/kotlin/com/adampuchala/bank/financial/domain/FinancialRules.kt"
click node_financial_repository "https://github.com/adampuchala/recruitment-task/blob/main/financial-operations-service/src/main/kotlin/com/adampuchala/bank/financial/adapter/out/PostgresFinancialRepository.kt"
click node_event_contract "https://github.com/adampuchala/recruitment-task/blob/main/shared-contracts/src/main/kotlin/com/adampuchala/bank/contracts/FinancialOperationCompleted.kt"
click node_outbox "https://github.com/adampuchala/recruitment-task/blob/main/outbox-worker/src/main/kotlin/com/adampuchala/bank/outbox/application/OutboxPublisher.kt"
click node_audit_consumer "https://github.com/adampuchala/recruitment-task/blob/main/audit-consumer/src/main/kotlin/com/adampuchala/bank/audit/application/AuditEventConsumer.kt"
click node_audit_handler "https://github.com/adampuchala/recruitment-task/blob/main/audit-consumer/src/main/kotlin/com/adampuchala/bank/audit/application/AuditEventHandler.kt"
click node_audit_repository "https://github.com/adampuchala/recruitment-task/blob/main/audit-consumer/src/main/kotlin/com/adampuchala/bank/audit/adapter/out/PostgresAuditRepository.kt"

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_mobile_app,node_conference,node_mobile_api,node_mobile_storage,node_notifications toneBlue
class node_mobile_bff,node_bff_facade,node_downstream toneAmber
class node_account_api,node_account_service,node_account_domain,node_account_repository toneMint
class node_financial_api,node_financial_service,node_financial_rules,node_financial_repository toneRose
class node_event_contract,node_outbox,node_audit_consumer,node_audit_handler,node_audit_repository,node_user,node_kafka toneIndigo
```

## Components

### Mobile Client

- [Mobile app](https://github.com/adampuchala/recruitment-task/blob/main/mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/App.kt): `mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/App.kt`
- [Conference features](https://github.com/adampuchala/recruitment-task/blob/main/mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/ConferenceService.kt): `mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/ConferenceService.kt`
- [Application API](https://github.com/adampuchala/recruitment-task/blob/main/mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/network/ApplicationApi.kt): `mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/network/ApplicationApi.kt`
- [Local settings](https://github.com/adampuchala/recruitment-task/blob/main/mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/storage/ApplicationStorageImpl.kt): `mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/storage/ApplicationStorageImpl.kt`
- [Local notifications](https://github.com/adampuchala/recruitment-task/blob/main/mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/LocalNotificationService.kt): `mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/LocalNotificationService.kt`

### API Edge

- [Mobile BFF](https://github.com/adampuchala/recruitment-task/blob/main/mobile-bff/src/main/kotlin/com/adampuchala/bank/mobile/adapter/in/MobileController.kt): `mobile-bff/src/main/kotlin/com/adampuchala/bank/mobile/adapter/in/MobileController.kt`
- [Account facade](https://github.com/adampuchala/recruitment-task/blob/main/mobile-bff/src/main/kotlin/com/adampuchala/bank/mobile/application/MobileAccountFacade.kt): `mobile-bff/src/main/kotlin/com/adampuchala/bank/mobile/application/MobileAccountFacade.kt`
- [HTTP adapters](https://github.com/adampuchala/recruitment-task/blob/main/mobile-bff/src/main/kotlin/com/adampuchala/bank/mobile/adapter/out/WebClientDownstreamAdapters.kt): `mobile-bff/src/main/kotlin/com/adampuchala/bank/mobile/adapter/out/WebClientDownstreamAdapters.kt`

### Account Service

- [Account API](https://github.com/adampuchala/recruitment-task/blob/main/account-service/src/main/kotlin/com/adampuchala/bank/account/adapter/in/AccountController.kt): `account-service/src/main/kotlin/com/adampuchala/bank/account/adapter/in/AccountController.kt`
- [Account application](https://github.com/adampuchala/recruitment-task/blob/main/account-service/src/main/kotlin/com/adampuchala/bank/account/application/AccountApplicationService.kt): `account-service/src/main/kotlin/com/adampuchala/bank/account/application/AccountApplicationService.kt`
- [Account model](https://github.com/adampuchala/recruitment-task/blob/main/account-service/src/main/kotlin/com/adampuchala/bank/account/domain/Account.kt): `account-service/src/main/kotlin/com/adampuchala/bank/account/domain/Account.kt`
- [Account persistence](https://github.com/adampuchala/recruitment-task/blob/main/account-service/src/main/kotlin/com/adampuchala/bank/account/adapter/out/PostgresAccountRepository.kt): `account-service/src/main/kotlin/com/adampuchala/bank/account/adapter/out/PostgresAccountRepository.kt`

### Financial Operations

- [Operations API](https://github.com/adampuchala/recruitment-task/blob/main/financial-operations-service/src/main/kotlin/com/adampuchala/bank/financial/adapter/in/FinancialController.kt): `financial-operations-service/src/main/kotlin/com/adampuchala/bank/financial/adapter/in/FinancialController.kt`
- [Operation processing](https://github.com/adampuchala/recruitment-task/blob/main/financial-operations-service/src/main/kotlin/com/adampuchala/bank/financial/application/FinancialApplicationService.kt): `financial-operations-service/src/main/kotlin/com/adampuchala/bank/financial/application/FinancialApplicationService.kt`
- [Financial rules](https://github.com/adampuchala/recruitment-task/blob/main/financial-operations-service/src/main/kotlin/com/adampuchala/bank/financial/domain/FinancialRules.kt): `financial-operations-service/src/main/kotlin/com/adampuchala/bank/financial/domain/FinancialRules.kt`
- [Operation persistence](https://github.com/adampuchala/recruitment-task/blob/main/financial-operations-service/src/main/kotlin/com/adampuchala/bank/financial/adapter/out/PostgresFinancialRepository.kt): `financial-operations-service/src/main/kotlin/com/adampuchala/bank/financial/adapter/out/PostgresFinancialRepository.kt`

### Events and Audit

- [Completion event](https://github.com/adampuchala/recruitment-task/blob/main/shared-contracts/src/main/kotlin/com/adampuchala/bank/contracts/FinancialOperationCompleted.kt): `shared-contracts/src/main/kotlin/com/adampuchala/bank/contracts/FinancialOperationCompleted.kt`
- [Outbox worker](https://github.com/adampuchala/recruitment-task/blob/main/outbox-worker/src/main/kotlin/com/adampuchala/bank/outbox/application/OutboxPublisher.kt): `outbox-worker/src/main/kotlin/com/adampuchala/bank/outbox/application/OutboxPublisher.kt`
- [Audit consumer](https://github.com/adampuchala/recruitment-task/blob/main/audit-consumer/src/main/kotlin/com/adampuchala/bank/audit/application/AuditEventConsumer.kt): `audit-consumer/src/main/kotlin/com/adampuchala/bank/audit/application/AuditEventConsumer.kt`
- [Audit handler](https://github.com/adampuchala/recruitment-task/blob/main/audit-consumer/src/main/kotlin/com/adampuchala/bank/audit/application/AuditEventHandler.kt): `audit-consumer/src/main/kotlin/com/adampuchala/bank/audit/application/AuditEventHandler.kt`
- [Audit persistence](https://github.com/adampuchala/recruitment-task/blob/main/audit-consumer/src/main/kotlin/com/adampuchala/bank/audit/adapter/out/PostgresAuditRepository.kt): `audit-consumer/src/main/kotlin/com/adampuchala/bank/audit/adapter/out/PostgresAuditRepository.kt`

### Other components

- **Bank customer**
- **Redpanda Kafka**

## Connections

- Bank customer → Mobile app: uses (evidence: `README.md`)
- Mobile app → Application API: calls
- Mobile app → Conference features: presents
- Conference features → Application API: fetches config (evidence: `mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/ConferenceService.kt`)
- Conference features → Local settings: reads and writes (evidence: `mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/ConferenceService.kt`)
- Conference features → Local notifications: schedules (evidence: `mobile-app/app/shared/src/commonMain/kotlin/com/adampuchala/mobileapp/ConferenceService.kt`)
- Application API → Mobile BFF: calls (evidence: `README.md`)
- Mobile BFF → Account facade: delegates (evidence: `mobile-bff/src/main/kotlin/com/adampuchala/bank/mobile/adapter/in/MobileController.kt`)
- Account facade → HTTP adapters: uses adapters
- HTTP adapters → Account API: calls account (evidence: `README.md`)
- HTTP adapters → Operations API: calls deposits (evidence: `README.md`)
- Bank customer → Account API: manages accounts (evidence: `README.md`)
- Bank customer → Operations API: requests operations (evidence: `README.md`)
- Account API → Account application: invokes (evidence: `account-service/src/main/kotlin/com/adampuchala/bank/account/adapter/in/AccountController.kt`)
- Account application → Account persistence: reads and writes (evidence: `account-service/src/main/kotlin/com/adampuchala/bank/account/application/AccountApplicationService.kt`)
- Account application → Account model: applies policy (evidence: `account-service/src/main/kotlin/com/adampuchala/bank/account/application/AccountApplicationService.kt`)
- Operations API → Operation processing: invokes (evidence: `financial-operations-service/src/main/kotlin/com/adampuchala/bank/financial/adapter/in/FinancialController.kt`)
- Operation processing → Operation persistence: reads and writes (evidence: `financial-operations-service/src/main/kotlin/com/adampuchala/bank/financial/application/FinancialApplicationService.kt`)
- Operation processing → Financial rules: validates (evidence: `financial-operations-service/src/main/kotlin/com/adampuchala/bank/financial/application/FinancialApplicationService.kt`)
- Operation processing → Completion event: creates event (evidence: `financial-operations-service/src/main/kotlin/com/adampuchala/bank/financial/application/FinancialApplicationService.kt`)
- Operation persistence → Outbox worker: stores transactionally (evidence: `README.md`)
- Outbox worker → Redpanda Kafka: publishes (evidence: `README.md`)
- Redpanda Kafka → Audit consumer: delivers events (evidence: `README.md`)
- Audit consumer → Audit handler: handles events
- Audit handler → Audit persistence: persists event (evidence: `audit-consumer/src/main/kotlin/com/adampuchala/bank/audit/application/AuditEventHandler.kt`)
