# josecampos777/cobol-core-banking architecture

> Architecture diagram of the GitHub repository josecampos777/cobol-core-banking, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/josecampos777/cobol-core-banking
- Repository: https://github.com/josecampos777/cobol-core-banking

## Overview

1. **Repository purpose**
   This repo is a small banking/financial processing stack centered on a legacy-style batch engine. Its architecture combines a COBOL computation core, flat-file master data, a migration path into Oracle, and Docker-based runtime orchestration.

2. **Core processing engine**
   The main business logic lives in `intereses.cob`. This is the calculation engine for interest processing, so it is the primary compute boundary in the system. It represents the legacy domain logic that produces financial results from account data.

3. **Operational input data**
   `cuentas.dat` is the master data file consumed by the core process. From the repository description, it holds balances and positional account information, so it is the main input source for batch computation.

4. **Batch orchestration layer**
   `run_banco.sh` acts as the execution orchestrator. The README describes it as a JCL-like runner that compiles and executes the COBOL program through Docker, so it is the boundary between the host environment and the isolated legacy runtime.

5. **Containerized runtime boundary**
   Docker is a key architectural layer even though the compose files are not listed here. The system is designed to run the GnuCOBOL toolchain in containers, which isolates compilation and execution from the host and makes the legacy workload portable.

6. **Migration subsystem**
   `legacy_to_oracle_migration.py` is the bridge from flat-file legacy storage into relational persistence. Its role is distinct from the COBOL batch engine: it handles data movement and transformation into Oracle rather than financial computation.

7. **Database schema layer**
   `script TBL_CORE_BANKING.sql` defines the Oracle 11g XE schema and tables used by the migration path. This file represents the database contract for the modernized storage layer and is the destination boundary for migrated legacy data.

8. **Configuration and environment**
   `.env.example` suggests the system expects environment-driven configuration, likely for container settings, file paths, and database connectivity. This is important because it implies the runtime is parameterized rather than hardcoded.

9. **Primary data flows**
   The main flow appears to be: legacy account file in `cuentas.dat` → COBOL batch processing in `intereses.cob` → execution under Docker via `run_banco.sh`. A separate but related flow is: flat-file or legacy data → `legacy_to_oracle_migration.py` → Oracle tables defined in `script TBL_CORE_BANKING.sql`.

10. **Architectural split**
   The repo is split into two clear concerns: batch financial computation and legacy-to-relational migration. The COBOL side preserves legacy processing semantics, while the Python/SQL side enables database-backed integration with Oracle.

11. **What is not present**
   There is no evidence here of a web tier, message broker, or large application framework. The architecture is intentionally minimal and batch-oriented, with files, scripts, and database schema doing most of the work.

12. **How to diagram it**
   An accurate diagram should show three main zones: a legacy batch processing zone (`cuentas.dat`, `intereses.cob`, `run_banco.sh`), a migration/integration zone (`legacy_to_oracle_migration.py`), and a persistence zone (`script TBL_CORE_BANKING.sql` / Oracle 11g XE), all executed within or coordinated by Docker.

Main entry points: [`run_banco.sh`](https://github.com/josecampos777/cobol-core-banking/blob/main/run_banco.sh) (Batch runner), [`legacy_to_oracle_migration.py`](https://github.com/josecampos777/cobol-core-banking/blob/main/legacy_to_oracle_migration.py) (Migration bridge), [`intereses.cob`](https://github.com/josecampos777/cobol-core-banking/blob/main/intereses.cob) (Interest core), [`cuentas.dat`](https://github.com/josecampos777/cobol-core-banking/blob/main/cuentas.dat) (Accounts file)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_legacy_batch["Legacy batch"]
  node_cuentas_dat["Accounts file<br/>flat-file input<br/>[cuentas.dat]"]
  node_intereses_cob["Interest core<br/>COBOL compute<br/>[intereses.cob]"]
  node_run_banco_sh["Batch runner<br/>shell orchestrator<br/>[run_banco.sh]"]
end

subgraph group_migration["Migration"]
  node_legacy_to_oracle_migration_py["Migration bridge<br/>Python ETL"]
end

subgraph group_persistence["Oracle persistence"]
  node_tbl_core_banking_sql["Oracle schema<br/>SQL DDL"]
  node_oracle_db[("Oracle 11g XE<br/>relational store")]
end

subgraph group_runtime["Runtime"]
  node_docker_runtime{{"Docker runtime<br/>container boundary"}}
  node_env_example["Env config<br/>runtime config<br/>[.env.example]"]
end

node_cuentas_dat -->|"input data"| node_intereses_cob
node_intereses_cob -->|"executed by"| node_run_banco_sh
node_run_banco_sh -->|"runs in"| node_docker_runtime
node_env_example -.->|"configures"| node_run_banco_sh
node_legacy_to_oracle_migration_py -->|"reads"| node_cuentas_dat
node_legacy_to_oracle_migration_py -->|"targets schema"| node_tbl_core_banking_sql
node_tbl_core_banking_sql -->|"defines"| node_oracle_db
node_legacy_to_oracle_migration_py -->|"loads into"| node_oracle_db
node_docker_runtime -->|"hosts"| node_intereses_cob
node_docker_runtime -->|"executes"| node_run_banco_sh

click node_cuentas_dat "https://github.com/josecampos777/cobol-core-banking/blob/main/cuentas.dat"
click node_intereses_cob "https://github.com/josecampos777/cobol-core-banking/blob/main/intereses.cob"
click node_run_banco_sh "https://github.com/josecampos777/cobol-core-banking/blob/main/run_banco.sh"
click node_env_example "https://github.com/josecampos777/cobol-core-banking/blob/main/.env.example"
click node_legacy_to_oracle_migration_py "https://github.com/josecampos777/cobol-core-banking/blob/main/legacy_to_oracle_migration.py"
click node_tbl_core_banking_sql "https://github.com/josecampos777/cobol-core-banking/blob/main/script TBL_CORE_BANKING.sql"

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_cuentas_dat,node_intereses_cob,node_run_banco_sh toneBlue
class node_legacy_to_oracle_migration_py toneAmber
class node_tbl_core_banking_sql,node_oracle_db toneMint
class node_docker_runtime,node_env_example toneRose
```

## Components

### Legacy batch

COBOL interest processing and its file-based execution path.

- [Accounts file](https://github.com/josecampos777/cobol-core-banking/blob/main/cuentas.dat): flat-file input · Master account data and balances consumed by batch processing. · `cuentas.dat`
- [Interest core](https://github.com/josecampos777/cobol-core-banking/blob/main/intereses.cob): COBOL compute · Legacy interest calculation engine for financial processing. · `intereses.cob`
- [Batch runner](https://github.com/josecampos777/cobol-core-banking/blob/main/run_banco.sh): shell orchestrator · JCL-like script that compiles and runs the COBOL workload. · `run_banco.sh`

### Migration

Bridge from legacy files into relational storage.

- [Migration bridge](https://github.com/josecampos777/cobol-core-banking/blob/main/legacy_to_oracle_migration.py): Python ETL · Transforms legacy data into relational Oracle persistence. · `legacy_to_oracle_migration.py`

### Oracle persistence

Schema and tables for the modernized banking store.

- [Oracle schema](https://github.com/josecampos777/cobol-core-banking/blob/HEAD/script%20TBL_CORE_BANKING.sql): SQL DDL · Database contract defining the target banking tables. · `script TBL_CORE_BANKING.sql`
- **Oracle 11g XE**: relational store · Target database used by the migration path.

### Runtime

Containerized execution and environment configuration.

- **Docker runtime**: container boundary · Isolated toolchain and execution environment for the legacy batch stack.
- [Env config](https://github.com/josecampos777/cobol-core-banking/blob/main/.env.example): runtime config · Example environment-driven settings for paths, containers, and connectivity. · `.env.example`

## Connections

- Accounts file → Interest core: input data · Flat-file account records feed the interest calculation engine.
- Interest core → Batch runner: executed by · The COBOL program is compiled and launched by the batch runner.
- Batch runner → Docker runtime: runs in · Execution is delegated to the containerized toolchain.
- Env config → Batch runner: configures · Environment values parameterize the runner and runtime setup.
- Migration bridge → Accounts file: reads · Migration consumes legacy file-based source data.
- Migration bridge → Oracle schema: targets schema · Transformation aligns with the Oracle table structure.
- Oracle schema → Oracle 11g XE: defines · DDL establishes the relational destination for migrated data.
- Migration bridge → Oracle 11g XE: loads into · Migrated data is persisted into Oracle.
- Docker runtime → Interest core: hosts · The container boundary provides the legacy COBOL runtime.
- Docker runtime → Batch runner: executes · The host script orchestrates compilation and execution inside Docker.
