# datascientest/pipeline-calculatrice-jenkins architecture

> Architecture diagram of the GitHub repository datascientest/pipeline-calculatrice-jenkins, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/datascientest/pipeline-calculatrice-jenkins
- Repository: https://github.com/datascientest/pipeline-calculatrice-jenkins

## Overview

1. **Repository purpose**
   - This is a very small Python project centered on a command-line calculator for integers.
   - The repo is also used as a teaching example for a Jenkins pipeline tutorial, so the codebase is intentionally simple and testable.

2. **Core domain layer: `sources/calc.py`**
   - `calc.py` contains the calculator’s business logic: addition, subtraction, multiplication, and division.
   - This is the main reusable subsystem and likely the most stable boundary in the repo.
   - Because the README says it operates on integers, the functions probably implement basic arithmetic rather than UI or persistence concerns.

3. **Application entry point: `sources/prog.py`**
   - `prog.py` is the executable program that launches the calculator.
   - Its role is orchestration: it likely reads user input, calls functions from `calc.py`, and displays results.
   - This file is the boundary between the pure computation layer and runtime interaction.

4. **Testing layer: `sources/test_calc.py`**
   - `test_calc.py` is the unit test suite for the calculator functions.
   - It validates the behavior of `calc.py` independently from the launcher in `prog.py`.
   - This separation means the calculation logic can be tested without involving any interactive program flow.

5. **Data flow**
   - The primary flow is: user interaction in `prog.py` → arithmetic function in `calc.py` → result returned to `prog.py` → output shown to the user.
   - The test flow is separate: `test_calc.py` → imports and exercises `calc.py` directly.
   - There is no indication of external storage, network calls, or shared state.

6. **Subsystem boundaries**
   - `calc.py` should be treated as a pure logic boundary.
   - `prog.py` is the UI/entry boundary.
   - `test_calc.py` is the verification boundary that protects the logic layer from regressions.

7. **Runtime and language**
   - The repository is a Python project with a very small footprint.
   - No framework is involved; the architecture is lightweight and script-based.
   - The project appears designed to run locally and be validated by automated tests.

8. **CI/CD intent**
   - The README explicitly frames the repo as input for a Jenkins pipeline tutorial.
   - Jenkins is therefore an external automation concern, not part of the app itself.
   - In an architecture diagram, Jenkins would sit outside the codebase and run the test suite as part of pipeline validation.

9. **What is notably absent**
   - There is no database, API server, message broker, or frontend in this repo.
   - There are no visible infrastructure components beyond the intended Jenkins tutorial context.
   - The architecture is intentionally minimal: computation, program entry, and tests.

10. **How to diagram it**
   - Show `prog.py` as the user-facing launcher.
   - Show `calc.py` as the central computation module.
   - Show `test_calc.py` as a separate test consumer of `calc.py`.
   - Optionally show Jenkins outside the repo as a pipeline system that runs the tests and validates the project.

Main entry points: [`sources/prog.py`](https://github.com/datascientest/pipeline-calculatrice-jenkins/blob/main/sources/prog.py) (Launcher), [`sources/calc.py`](https://github.com/datascientest/pipeline-calculatrice-jenkins/blob/main/sources/calc.py) (Calculator), [`sources/test_calc.py`](https://github.com/datascientest/pipeline-calculatrice-jenkins/blob/main/sources/test_calc.py) (Unit tests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sources["Source code"]
  node_calc["Calculator<br/>pure logic<br/>[calc.py]"]
  node_prog["Launcher<br/>CLI entry<br/>[prog.py]"]
  node_tests["Unit tests<br/>test suite<br/>[test_calc.py]"]
end

subgraph group_external["External systems"]
  node_jenkins(("Jenkins<br/>pipeline CI"))
  node_user(("User<br/>human input"))
end

node_user -->|"uses"| node_prog
node_prog -->|"calls"| node_calc
node_calc -->|"returns"| node_prog
node_tests -->|"verifies"| node_calc
node_jenkins -->|"runs"| node_tests
node_jenkins -.->|"checks"| node_prog

click node_calc "https://github.com/datascientest/pipeline-calculatrice-jenkins/blob/main/sources/calc.py"
click node_prog "https://github.com/datascientest/pipeline-calculatrice-jenkins/blob/main/sources/prog.py"
click node_tests "https://github.com/datascientest/pipeline-calculatrice-jenkins/blob/main/sources/test_calc.py"

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_calc,node_prog,node_tests toneBlue
class node_jenkins,node_user toneAmber
```

## Components

### Source code

Core calculator modules and tests.

- [Calculator](https://github.com/datascientest/pipeline-calculatrice-jenkins/blob/main/sources/calc.py): pure logic · Integer arithmetic functions for add, subtract, multiply, and divide. · `sources/calc.py`
- [Launcher](https://github.com/datascientest/pipeline-calculatrice-jenkins/blob/main/sources/prog.py): CLI entry · Executable entry point that coordinates user interaction and calculator calls. · `sources/prog.py`
- [Unit tests](https://github.com/datascientest/pipeline-calculatrice-jenkins/blob/main/sources/test_calc.py): test suite · Tests that exercise the calculator logic directly. · `sources/test_calc.py`

### External systems

Automation and runtime context outside the repository.

- **Jenkins**: pipeline CI · External automation that runs the repository tests and validates the tutorial pipeline.
- **User**: human input · Local person interacting with the calculator program.

## Connections

- User → Launcher: uses · A user runs the calculator program and provides input.
- Launcher → Calculator: calls · The launcher delegates arithmetic work to the calculation module.
- Calculator → Launcher: returns · Computed results flow back to the launcher for display.
- Unit tests → Calculator: verifies · Unit tests import and exercise the calculator functions directly.
- Jenkins → Unit tests: runs · The pipeline executes the test suite as part of validation.
- Jenkins → Launcher: checks · The pipeline can also validate that the program project remains buildable and runnable.
