Skip to content

Commit d84749c

Browse files
author
Alwin Mark
committed
Initial commit
* architecture documents
0 parents  commit d84749c

34 files changed

+1472
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Render PlantUML Diagrams
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
paths:
7+
- "docs/plantuml/src/*.puml"
8+
- ".github/workflows/render-plantuml.yml"
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
render:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Render PlantUML diagrams via Docker
24+
run: |
25+
docker run --rm \
26+
-w /work \
27+
-v "$PWD:/work" \
28+
plantuml/plantuml \
29+
-tsvg \
30+
-o ../out \
31+
doc/plantuml/src/*.puml
32+
33+
- name: Commit rendered diagrams
34+
uses: stefanzweifel/git-auto-commit-action@v5
35+
with:
36+
commit_message: "chore(docs): render PlantUML diagrams"
37+
file_pattern: "doc/plantuml/out/*.svg"
38+

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Protopipe Frontend Platform
2+
3+
Kubernetes-native frontend platform for SSR-based UI composition,
4+
artifact-driven experimentation, and contract-first development.
5+
6+
## Architecture Documentation (arc42)
7+
8+
This repository uses the **arc42 architecture documentation template**.
9+
The README serves as an index; detailed architecture documentation lives in
10+
dedicated chapters under `docs/arc42`.
11+
12+
👉 **Start here:**
13+
- [Architecture Overview](doc/arc42/README.md)
14+
15+
16+
## Repository Structure
17+
18+
- `services/` – runtime components (operator, composer, message bridge)
19+
- `packages/` – shared specs, ABIs, tooling
20+
- `docs/` – architecture, ADRs, diagrams
21+
- `deployments/` – Helm / Kustomize
22+
- `examples/` – reference implementations
23+
24+
## License
25+
26+
This project is licensed under **GPL-3.0-only**.
27+
See [LICENSE](LICENSE) for details.
28+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# 0001 – Record Architecture Decisions
2+
3+
Date: 2025-12-29
4+
5+
## Status
6+
7+
Accepted
8+
9+
## Context
10+
11+
The Protopipe Frontend Platform is a long-lived architectural system that
12+
must remain understandable, maintainable, and evolvable over time.
13+
14+
Architecture decisions are frequently made implicitly during implementation
15+
or discussions, which leads to loss of rationale, repeated debates, and
16+
inconsistent implementation choices—especially in distributed and
17+
open-source-friendly environments.
18+
19+
A lightweight but explicit mechanism is required to document and communicate
20+
architectural decisions and their consequences.
21+
22+
## Decision
23+
24+
We will record all significant architecture decisions using
25+
**Architecture Decision Records (ADRs)**.
26+
27+
ADRs are maintained as Markdown files in the repository under `docs/adr/`
28+
and follow a standard structure including context, decision, and consequences.
29+
30+
ADRs are created using the `adr-tools` workflow and are versioned together
31+
with the source code.
32+
33+
## Consequences
34+
35+
- Architecture decisions become explicit and reviewable.
36+
- Rationale behind decisions is preserved over time.
37+
- New contributors can understand architectural constraints faster.
38+
- Maintaining ADRs introduces a small but intentional documentation overhead.
39+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# 0002 – Model Pages and Experiments as Kubernetes CRDs
2+
3+
Date: 2025-12-29
4+
5+
## Status
6+
7+
Accepted
8+
9+
## Context
10+
11+
The frontend platform is Kubernetes-native and must integrate cleanly into
12+
cluster-level workflows, GitOps processes, and declarative configuration
13+
management.
14+
15+
Pages and experiments are core architectural concepts that influence routing,
16+
rendering, and delivery behavior. Treating them as application-internal
17+
configuration would limit observability, automation, and governance.
18+
19+
## Decision
20+
21+
Pages and Experiments are modeled as **custom Kubernetes resources (CRDs)**.
22+
23+
- A **Page** CRD represents the smallest deployable frontend unit.
24+
- An **Experiment** CRD defines assignment rules and artifact overrides.
25+
26+
A Kubernetes Operator reconciles these resources and produces effective runtime
27+
configuration for the frontend composer.
28+
29+
## Consequences
30+
31+
- Frontend behavior becomes declarative and cluster-visible.
32+
- Pages and experiments integrate naturally with GitOps workflows.
33+
- Kubernetes becomes the single source of truth for delivery configuration.
34+
- Operator complexity increases and must be carefully managed and tested.
35+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# 0003 – Introduce Render Function Artifacts as the Rendering Boundary
2+
3+
Date: 2025-12-29
4+
5+
## Status
6+
7+
Accepted
8+
9+
## Context
10+
11+
Frontend teams must be able to work independently, using different technologies
12+
and release cycles, without introducing shared frontend baselines or tight
13+
coupling.
14+
15+
Traditional frontend integration approaches often rely on shared runtimes,
16+
framework versions, or client-side composition, which does not scale well
17+
organizationally.
18+
19+
A stable, testable rendering boundary is required.
20+
21+
## Decision
22+
23+
We introduce **Render Function Artifacts (RFAs)** as the primary rendering
24+
boundary.
25+
26+
An RFA exposes a pure rendering contract:
27+
28+
```
29+
render(data, context)->html(+meta)
30+
```
31+
32+
RFAs are:
33+
- Technology-agnostic internally
34+
- Independently buildable and testable
35+
- Executed server-side by the frontend composer
36+
37+
## Consequences
38+
39+
- Teams can choose internal frontend technologies freely.
40+
- Rendering becomes deterministic and testable.
41+
- Shared frontend baselines are avoided.
42+
- Server-side execution requires isolation and resource control.
43+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# 0004 – Use Artifact-based Experiments Instead of Feature Toggles in Product Code
2+
3+
Date: 2025-12-29
4+
5+
## Status
6+
7+
Accepted
8+
9+
## Context
10+
11+
Feature toggles embedded in product code often lead to long-lived conditional
12+
logic, increased complexity, and incomplete cleanup after experiments end.
13+
14+
The platform is designed around experiments as first-class delivery mechanisms
15+
and supports routing at the artifact level.
16+
17+
## Decision
18+
19+
Experiments are implemented by **routing to different artifact implementations**
20+
rather than toggling behavior inside product code.
21+
22+
Snapshot artifacts built from feature branches can be referenced directly by
23+
experiments and promoted or discarded without modifying merged code.
24+
25+
## Consequences
26+
27+
- Product code remains clean and toggle-free.
28+
- Definition of Done is reached at merge time.
29+
- Experiments become reproducible and auditable.
30+
- Artifact lifecycle management (retention, cleanup) becomes necessary.
31+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# 0005 – Keep Metrics in Prometheus; Avoid Counters in CRD Status
2+
3+
Date: 2025-12-29
4+
5+
## Status
6+
7+
Accepted
8+
9+
## Context
10+
11+
Kubernetes CRD status fields are designed to represent reconciliation state and
12+
conditions, not high-frequency or time-series metrics.
13+
14+
Embedding counters or metrics into CRD status would increase API server load,
15+
complicate reconciliation logic, and blur responsibility boundaries.
16+
17+
## Decision
18+
19+
Operational metrics such as request counts, cache hits, and latencies are
20+
exported exclusively via **Prometheus metrics**.
21+
22+
CRD status fields are limited to:
23+
- Effective configuration
24+
- Resolution results
25+
- Conditions and error states
26+
27+
## Consequences
28+
29+
- Clear separation between control-plane state and telemetry.
30+
- Better scalability and observability.
31+
- Metrics analysis relies on external tooling (Prometheus/Grafana).
32+
- CRD status remains stable and predictable.
33+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# 0006 – Adopt Docs-as-Code with arc42 Chapters and PlantUML Diagrams
2+
3+
Date: 2025-12-29
4+
5+
## Status
6+
7+
Accepted
8+
9+
## Context
10+
11+
Architecture documentation must remain accurate, reviewable, and closely aligned
12+
with the implemented system.
13+
14+
External documentation systems or slide-based approaches tend to drift from
15+
reality and are rarely kept up to date.
16+
17+
## Decision
18+
19+
Architecture documentation is maintained as **docs-as-code** within the
20+
repository using:
21+
22+
- arc42 chapter structure
23+
- Markdown files
24+
- PlantUML diagrams rendered via CI
25+
26+
Documentation changes are reviewed and versioned together with code changes.
27+
28+
## Consequences
29+
30+
- Architecture documentation stays close to implementation.
31+
- Diagrams are reproducible and version-controlled.
32+
- Contributors can review documentation changes like code.
33+
- Requires CI support and disciplined maintenance.
34+

doc/adr/README.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Architecture Decision Records (ADR)
2+
3+
This directory contains the **Architecture Decision Records (ADRs)** for the
4+
**Protopipe Frontend Platform**.
5+
6+
ADRs document significant architectural decisions, including their context,
7+
the decision taken, and the resulting consequences. They serve as a durable,
8+
reviewable record of architectural intent and rationale.
9+
10+
The ADRs in this repository are maintained using the
11+
[`adr-tools`](https://github.com/npryce/adr-tools) workflow and are versioned
12+
together with the source code.
13+
14+
---
15+
16+
## Accepted Decisions
17+
18+
- [ADR-0001: Record Architecture Decisions](0001-record-architecture-decisions.md)
19+
- [ADR-0002: Model Pages and Experiments as Kubernetes CRDs](0002-model-pages-and-experiments-as-kubernetes-crds.md)
20+
- [ADR-0003: Introduce Render Function Artifacts as the Rendering Boundary](0003-introduce-render-function-artifacts-as-the-rendering-boundary.md)
21+
- [ADR-0004: Use Artifact-based Experiments Instead of Feature Toggles in Product Code](0004-use-artifact-based-experiments-instead-of-feature-toggles-in-product-code.md)
22+
- [ADR-0005: Keep Metrics in Prometheus; Avoid Counters in CRD Status](0005-keep-metrics-in-prometheus-avoid-counters-in-crd-status.md)
23+
- [ADR-0006: Adopt Docs-as-Code with arc42 Chapters and PlantUML Diagrams](0006-adopt-docs-as-code-with-arc42-chapters-and-plantuml-diagrams.md)
24+
- [ADR-0007: Establish ADR Governance and Lifecycle](0007-establish-adr-governance-and-lifecycle.md)
25+
26+
---
27+
28+
## Proposed Decisions
29+
30+
_(none at this time)_
31+
32+
---
33+
34+
## Superseded Decisions
35+
36+
_(none at this time)_
37+
38+
---
39+
40+
## ADR Lifecycle
41+
42+
Each ADR follows a simple lifecycle:
43+
44+
1. **Proposed**
45+
The decision is under discussion and not yet binding.
46+
47+
2. **Accepted**
48+
The decision is agreed upon and considered architectural guidance.
49+
50+
3. **Superseded**
51+
The decision has been replaced by a newer ADR, which must explicitly
52+
reference the superseded decision.
53+
54+
---
55+
56+
## Contribution Guidelines
57+
58+
- Architectural changes of structural relevance **require an ADR**.
59+
- ADRs must follow the standard template:
60+
- Context
61+
- Decision
62+
- Consequences
63+
- ADRs are reviewed by the core maintainers.
64+
- Once accepted, ADRs should not be modified retroactively; changes require
65+
a new ADR that supersedes the previous one.
66+
67+
---
68+
69+
## Relationship to arc42
70+
71+
The arc42 chapter
72+
**09 – Architecture Decisions**
73+
references this directory as the authoritative source for architectural
74+
decisions.
75+
76+
See:
77+
`docs/arc42/09-architecture-decisions.md`
78+

0 commit comments

Comments
 (0)