# umami-dev/interview architecture

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

- Interactive diagram: https://gitdiagram.com/umami-dev/interview
- Repository: https://github.com/umami-dev/interview

## Overview

1. This repository is a mono-repo of three largely independent take-home assignments, not one unified product. Each top-level folder has its own runtime, dependencies, and deployment model, so the architecture is best drawn as three separate subsystems under a shared repo wrapper.

2. The root-level GitHub Actions workflow and CODEOWNERS file provide repository governance and CI for the repo as a whole. They do not appear to connect the three assignments at runtime; they mainly support validation, review ownership, and submission hygiene.

3. `customer-data-pipeline` is a Python batch/data-processing project. Its source lives under `src/`, with two main entrypoints: `ingest.py` and `prepare_sync.py`. The bundled input data is in `src/data/input/`, using JSONL files for customer profiles and membership records.

4. The pipeline’s data flow is file-in/file-out: read local JSONL inputs, transform and reconcile them, then produce a structured output that is compared against `reference_output_structure.json`. The presence of `requirements.txt` indicates a lightweight Python environment focused on offline processing rather than services or APIs.

5. `dynamic-pricing` is a Ruby on Rails API service. The main request path runs from `config/routes.rb` to `app/controllers/api/v1/pricing_controller.rb`, then into `app/services/api/v1/pricing_service.rb`, with shared service behavior in `app/services/base_service.rb`.

6. This Rails app has an explicit external dependency boundary in `lib/rate_api_client.rb`, which likely encapsulates calls to a third-party rate/pricing API. That makes the pricing workflow: incoming HTTP request → controller validation/dispatch → service orchestration → external rate client → response assembly. The included controller test suggests the public API is the primary contract.

7. The Rails project is container-friendly and operationally self-contained: `Dockerfile`, `docker-compose.yml`, `config/puma.rb`, and the standard Rails environment/config files define how it runs in development and production. The database and model folders exist, but the visible domain logic is concentrated in the API/service layer rather than persistence-heavy models.

8. `terraform-parse` is infrastructure-as-code, split across two provisioning layers. `terraform/` contains Terraform definitions for cloud infrastructure, while `helm/` contains Kubernetes manifests for frontend/backend deployments, services, and an HPA. This folder represents deployment and environment wiring rather than application logic.

9. The Helm chart indicates a deployed application boundary with separate frontend and backend workloads, each exposed by its own Service and scaled via the HPA. The Terraform layer likely provisions the supporting cloud resources needed by that Kubernetes deployment, but there is no shared runtime code with the other assignments.

10. A useful diagram should show three isolated vertical stacks beneath the repo: a Python batch pipeline over local files, a Rails API that may call an external rate service, and an IaC/deployment stack that defines cloud and Kubernetes resources. The only shared concern across them is repository-level CI and review metadata, not business data flow.

11. In short: `customer-data-pipeline` is an offline data transformation job, `dynamic-pricing` is a service boundary around pricing logic and an external rate API, and `terraform-parse` is infrastructure/deployment configuration. There is no evidence of direct coupling between these subsystems.

Main entry points: [`terraform-parse/helm/Chart.yaml`](https://github.com/umami-dev/interview/blob/main/terraform-parse/helm/Chart.yaml) (Helm chart), [`.github/workflows/ci.yml`](https://github.com/umami-dev/interview/blob/main/.github/workflows/ci.yml) (CI workflow), [`customer-data-pipeline/src/ingest.py`](https://github.com/umami-dev/interview/blob/main/customer-data-pipeline/src/ingest.py) (Ingest), [`dynamic-pricing/app/services/api/v1/pricing_service.rb`](https://github.com/umami-dev/interview/blob/main/dynamic-pricing/app/services/api/v1/pricing_service.rb) (Pricing service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_repo_governance["Repo governance"]
  node_ci_workflow["CI workflow<br/>github actions<br/>[ci.yml]"]
  node_codeowners["CODEOWNERS<br/>review policy<br/>[CODEOWNERS]"]
end

subgraph group_customer_data_pipeline["Customer data pipeline"]
  node_ingest["Ingest<br/>python entrypoint<br/>[ingest.py]"]
  node_prepare_sync["Prepare sync<br/>python entrypoint<br/>[prepare_sync.py]"]
  node_customer_profiles["Profiles<br/>input data"]
  node_membership["Membership<br/>input data<br/>[membership.jsonl]"]
  node_reference_output["Reference output<br/>output contract"]
end

subgraph group_dynamic_pricing["Dynamic pricing"]
  node_routes["Routes<br/>[routes.rb]"]
  node_pricing_controller["Pricing controller<br/>api controller"]
  node_pricing_service["Pricing service<br/>[pricing_service.rb]"]
  node_base_service["Base service<br/>shared service<br/>[base_service.rb]"]
  node_rate_api_client["Rate client<br/>external client<br/>[rate_api_client.rb]"]
  node_external_rate_api(("Rate API<br/>external api"))
end

subgraph group_terraform_parse["Terraform parse"]
  node_terraform_main["Terraform<br/>iac stack<br/>[main.tf]"]
  node_helm_chart["Helm chart<br/>k8s chart<br/>[Chart.yaml]"]
  node_backend_deploy["Backend deploy<br/>k8s deployment"]
  node_backend_service["Backend service<br/>k8s service"]
  node_frontend_deploy["Frontend deploy<br/>k8s deployment"]
  node_frontend_service["Frontend service<br/>k8s service"]
  node_hpa["HPA<br/>autoscaler<br/>[hpa.yaml]"]
end

node_ci_workflow -.->|"checks"| node_ingest
node_ci_workflow -.->|"checks"| node_pricing_controller
node_ci_workflow -.->|"checks"| node_terraform_main
node_codeowners -.->|"governs"| node_ci_workflow
node_customer_profiles -->|"input"| node_ingest
node_membership -->|"input"| node_ingest
node_ingest -->|"transforms"| node_prepare_sync
node_prepare_sync -->|"matches"| node_reference_output
node_routes -->|"dispatches"| node_pricing_controller
node_pricing_controller -->|"delegates"| node_pricing_service
node_pricing_service -->|"inherits"| node_base_service
node_pricing_service -->|"calls"| node_rate_api_client
node_rate_api_client -->|"requests"| node_external_rate_api
node_terraform_main -->|"provisions"| node_helm_chart
node_helm_chart -->|"includes"| node_backend_deploy
node_helm_chart -->|"includes"| node_frontend_deploy
node_helm_chart -->|"includes"| node_backend_service
node_helm_chart -->|"includes"| node_frontend_service
node_helm_chart -->|"includes"| node_hpa

click node_ci_workflow "https://github.com/umami-dev/interview/blob/main/.github/workflows/ci.yml"
click node_codeowners "https://github.com/umami-dev/interview/blob/main/.github/CODEOWNERS"
click node_ingest "https://github.com/umami-dev/interview/blob/main/customer-data-pipeline/src/ingest.py"
click node_prepare_sync "https://github.com/umami-dev/interview/blob/main/customer-data-pipeline/src/prepare_sync.py"
click node_customer_profiles "https://github.com/umami-dev/interview/blob/main/customer-data-pipeline/src/data/input/customer_profile.jsonl"
click node_membership "https://github.com/umami-dev/interview/blob/main/customer-data-pipeline/src/data/input/membership.jsonl"
click node_reference_output "https://github.com/umami-dev/interview/blob/main/customer-data-pipeline/reference_output_structure.json"
click node_routes "https://github.com/umami-dev/interview/blob/main/dynamic-pricing/config/routes.rb"
click node_pricing_controller "https://github.com/umami-dev/interview/blob/main/dynamic-pricing/app/controllers/api/v1/pricing_controller.rb"
click node_pricing_service "https://github.com/umami-dev/interview/blob/main/dynamic-pricing/app/services/api/v1/pricing_service.rb"
click node_base_service "https://github.com/umami-dev/interview/blob/main/dynamic-pricing/app/services/base_service.rb"
click node_rate_api_client "https://github.com/umami-dev/interview/blob/main/dynamic-pricing/lib/rate_api_client.rb"
click node_terraform_main "https://github.com/umami-dev/interview/blob/main/terraform-parse/terraform/main.tf"
click node_helm_chart "https://github.com/umami-dev/interview/blob/main/terraform-parse/helm/Chart.yaml"
click node_backend_deploy "https://github.com/umami-dev/interview/blob/main/terraform-parse/helm/templates/backend-deployment.yaml"
click node_backend_service "https://github.com/umami-dev/interview/blob/main/terraform-parse/helm/templates/backend-service.yaml"
click node_frontend_deploy "https://github.com/umami-dev/interview/blob/main/terraform-parse/helm/templates/frontend-deployment.yaml"
click node_frontend_service "https://github.com/umami-dev/interview/blob/main/terraform-parse/helm/templates/frontend-service.yaml"
click node_hpa "https://github.com/umami-dev/interview/blob/main/terraform-parse/helm/templates/hpa.yaml"

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_ci_workflow,node_codeowners toneBlue
class node_ingest,node_prepare_sync,node_customer_profiles,node_membership,node_reference_output toneAmber
class node_routes,node_pricing_controller,node_pricing_service,node_base_service,node_rate_api_client,node_external_rate_api toneMint
class node_terraform_main,node_helm_chart,node_backend_deploy,node_backend_service,node_frontend_deploy,node_frontend_service,node_hpa toneRose
```

## Components

### Repo governance

Top-level CI and ownership metadata for the mono-repo.

- [CI workflow](https://github.com/umami-dev/interview/blob/main/.github/workflows/ci.yml): github actions · Repository-wide validation workflow. · `.github/workflows/ci.yml`
- [CODEOWNERS](https://github.com/umami-dev/interview/blob/main/.github/CODEOWNERS): review policy · Repository ownership and review routing. · `.github/CODEOWNERS`

### Customer data pipeline

Offline Python batch processing assignment.

- [Ingest](https://github.com/umami-dev/interview/blob/main/customer-data-pipeline/src/ingest.py): python entrypoint · Reads local customer and membership inputs. · `customer-data-pipeline/src/ingest.py`
- [Prepare sync](https://github.com/umami-dev/interview/blob/main/customer-data-pipeline/src/prepare_sync.py): python entrypoint · Reconciles records and prepares structured output. · `customer-data-pipeline/src/prepare_sync.py`
- [Profiles](https://github.com/umami-dev/interview/blob/main/customer-data-pipeline/src/data/input/customer_profile.jsonl): input data · Customer profile JSONL input. · `customer-data-pipeline/src/data/input/customer_profile.jsonl`
- [Membership](https://github.com/umami-dev/interview/blob/main/customer-data-pipeline/src/data/input/membership.jsonl): input data · Membership JSONL input. · `customer-data-pipeline/src/data/input/membership.jsonl`
- [Reference output](https://github.com/umami-dev/interview/blob/main/customer-data-pipeline/reference_output_structure.json): output contract · Expected output structure for comparison. · `customer-data-pipeline/reference_output_structure.json`

### Dynamic pricing

Rails API assignment with external pricing integration.

- [Routes](https://github.com/umami-dev/interview/blob/main/dynamic-pricing/config/routes.rb): rails routes · HTTP API route entrypoint. · `dynamic-pricing/config/routes.rb`
- [Pricing controller](https://github.com/umami-dev/interview/blob/main/dynamic-pricing/app/controllers/api/v1/pricing_controller.rb): api controller · Validates requests and dispatches pricing responses. · `dynamic-pricing/app/controllers/api/v1/pricing_controller.rb`
- [Pricing service](https://github.com/umami-dev/interview/blob/main/dynamic-pricing/app/services/api/v1/pricing_service.rb): service · Coordinates pricing logic for the API. · `dynamic-pricing/app/services/api/v1/pricing_service.rb`
- [Base service](https://github.com/umami-dev/interview/blob/main/dynamic-pricing/app/services/base_service.rb): shared service · Common service behavior used by pricing orchestration. · `dynamic-pricing/app/services/base_service.rb`
- [Rate client](https://github.com/umami-dev/interview/blob/main/dynamic-pricing/lib/rate_api_client.rb): external client · Encapsulates calls to the third-party rate API. · `dynamic-pricing/lib/rate_api_client.rb`
- **Rate API**: external api · Third-party pricing or rate data source.

### Terraform parse

Infrastructure and deployment configuration assignment.

- [Terraform](https://github.com/umami-dev/interview/blob/main/terraform-parse/terraform/main.tf): iac stack · Cloud infrastructure provisioning layer. · `terraform-parse/terraform/main.tf`
- [Helm chart](https://github.com/umami-dev/interview/blob/main/terraform-parse/helm/Chart.yaml): k8s chart · Kubernetes deployment package for the application stack. · `terraform-parse/helm/Chart.yaml`
- [Backend deploy](https://github.com/umami-dev/interview/blob/main/terraform-parse/helm/templates/backend-deployment.yaml): k8s deployment · Backend workload definition. · `terraform-parse/helm/templates/backend-deployment.yaml`
- [Backend service](https://github.com/umami-dev/interview/blob/main/terraform-parse/helm/templates/backend-service.yaml): k8s service · Backend network exposure. · `terraform-parse/helm/templates/backend-service.yaml`
- [Frontend deploy](https://github.com/umami-dev/interview/blob/main/terraform-parse/helm/templates/frontend-deployment.yaml): k8s deployment · Frontend workload definition. · `terraform-parse/helm/templates/frontend-deployment.yaml`
- [Frontend service](https://github.com/umami-dev/interview/blob/main/terraform-parse/helm/templates/frontend-service.yaml): k8s service · Frontend network exposure. · `terraform-parse/helm/templates/frontend-service.yaml`
- [HPA](https://github.com/umami-dev/interview/blob/main/terraform-parse/helm/templates/hpa.yaml): autoscaler · Horizontal pod autoscaling policy. · `terraform-parse/helm/templates/hpa.yaml`

## Connections

- CI workflow → Ingest: checks · Repo CI validates the Python pipeline.
- CI workflow → Pricing controller: checks · Repo CI validates the Rails API.
- CI workflow → Terraform: checks · Repo CI validates IaC and deployment config.
- CODEOWNERS → CI workflow: governs · Ownership and review rules apply to repository workflows.
- Profiles → Ingest: input · Customer profiles are read by the ingest step.
- Membership → Ingest: input · Membership records are read by the ingest step.
- Ingest → Prepare sync: transforms · Initial file ingestion feeds reconciliation and sync preparation.
- Prepare sync → Reference output: matches · Pipeline output is compared to the expected structure.
- Routes → Pricing controller: dispatches · Rails routes map requests to the pricing controller.
- Pricing controller → Pricing service: delegates · Controller hands request handling to service logic.
- Pricing service → Base service: inherits · Pricing service shares common service behavior.
- Pricing service → Rate client: calls · Pricing orchestration invokes the external rate client.
- Rate client → Rate API: requests · Client boundary to the third-party rate API.
- Terraform → Helm chart: provisions · Terraform supports the Kubernetes deployment layer.
- Helm chart → Backend deploy: includes · Helm chart defines backend workload templates.
- Helm chart → Frontend deploy: includes · Helm chart defines frontend workload templates.
- Helm chart → Backend service: includes · Helm chart defines backend service templates.
- Helm chart → Frontend service: includes · Helm chart defines frontend service templates.
- Helm chart → HPA: includes · Helm chart defines autoscaling policy.
