diff --git a/.archify/architecture-mani-candles-20261003-1716/candidate.json b/.archify/architecture-mani-candles-20261003-1716/candidate.json new file mode 100644 index 0000000..c039af6 --- /dev/null +++ b/.archify/architecture-mani-candles-20261003-1716/candidate.json @@ -0,0 +1,147 @@ +{ + "schema_version": 1, + "diagram_type": "architecture", + "meta": { + "title": "Mani Candles backend", + "output": ".archify/architecture-mani-candles-20261003-1716/mani-candles-backend.html", + "quality_profile": "showcase", + "locale": "en", + "repository": { + "url": "ssh://git@git.midastix.com:2212/internal/manicanldes-backend.git", + "revision": "5a503c75207a0d2a1cbb1ee251f02eff118d7b5c", + "link_mode": "local-only" + } + }, + "components": [ + { + "id": "staff", + "type": "external", + "label": "Staff or API client", + "sublabel": "Authenticated user", + "pos": [40, 230], + "size": [150, 72] + }, + { + "id": "swagger", + "type": "frontend", + "label": "Swagger UI", + "sublabel": "API explorer in development", + "pos": [240, 230], + "size": [170, 72], + "sources": [{ "path": "src/documentation/configure-swagger.ts", "line": 8, "end_line": 40 }] + }, + { + "id": "api", + "type": "backend", + "label": "NestJS HTTP API", + "sublabel": "/api/v1 routes", + "pos": [470, 230], + "size": [160, 72], + "sources": [ + { "path": "src/main.ts", "line": 10, "end_line": 15 }, + { "path": "src/configure-app.ts", "line": 9, "end_line": 29 } + ] + }, + { + "id": "guard", + "type": "security", + "label": "Access guard", + "sublabel": "Session, rate limit, RBAC", + "pos": [690, 230], + "size": [175, 72], + "sources": [ + { "path": "src/identity/access.guard.ts", "line": 15, "end_line": 38 }, + { "path": "src/identity/access.store.ts", "line": 12, "end_line": 37 } + ] + }, + { + "id": "b2b", + "type": "backend", + "label": "B2B module", + "sublabel": "Accounts, quotes, orders", + "pos": [960, 75], + "size": [176, 78], + "sources": [ + { "path": "src/b2b/b2b.module.ts", "line": 30, "end_line": 60 }, + { "path": "src/b2b/partner-order.store.ts", "line": 43, "end_line": 106 } + ] + }, + { + "id": "commerce", + "type": "backend", + "label": "Commerce module", + "sublabel": "Catalog, inventory, checkout", + "pos": [960, 230], + "size": [176, 78], + "sources": [ + { "path": "src/app.module.ts", "line": 15, "end_line": 30 }, + { "path": "src/checkout/checkout.store.ts", "line": 15, "end_line": 76 } + ] + }, + { + "id": "operations", + "type": "backend", + "label": "Internal operations", + "sublabel": "Procurement, production", + "pos": [960, 385], + "size": [176, 78], + "sources": [ + { "path": "src/procurement/procurement.module.ts", "line": 36, "end_line": 65 }, + { "path": "src/production/production.module.ts", "line": 17, "end_line": 36 } + ] + }, + { + "id": "prisma", + "type": "backend", + "label": "Prisma data access", + "sublabel": "Scoped transactions", + "pos": [1230, 230], + "size": [180, 78], + "sources": [ + { "path": "src/database/database.service.ts", "line": 13, "end_line": 37 }, + { "path": "src/identity/access.store.ts", "line": 12, "end_line": 38 } + ] + }, + { + "id": "postgres", + "type": "database", + "label": "PostgreSQL", + "sublabel": "Orders, ledgers, files", + "pos": [1230, 385], + "size": [180, 78], + "sources": [ + { "path": "src/database/database.service.ts", "line": 16, "end_line": 36 }, + { "path": "prisma/artwork.prisma", "line": 24, "end_line": 42 } + ] + } + ], + "connections": [ + { "id": "open-docs", "from": "staff", "to": "swagger", "label": "explore" }, + { "id": "call-api", "from": "swagger", "to": "api", "label": "HTTP" }, + { "id": "protect-route", "from": "api", "to": "guard", "label": "guard" }, + { "id": "b2b-route", "from": "guard", "to": "b2b", "label": "B2B" }, + { "id": "commerce-route", "from": "guard", "to": "commerce", "label": "commerce" }, + { "id": "operations-route", "from": "guard", "to": "operations", "label": "operations" }, + { "id": "b2b-data", "from": "b2b", "to": "prisma", "label": "read / write" }, + { "id": "commerce-data", "from": "commerce", "to": "prisma", "label": "read / write" }, + { "id": "operations-data", "from": "operations", "to": "prisma", "label": "read / write" }, + { "id": "sql", "from": "prisma", "to": "postgres", "label": "SQL" } + ], + "cards": [ + { + "dot": "cyan", + "title": "How to test", + "items": ["Open /api/docs in development", "Authenticate, then call protected API routes"] + }, + { + "dot": "emerald", + "title": "Persistence", + "items": ["Prisma uses PostgreSQL for transactional data", "Private artwork files are stored as database bytes"] + }, + { + "dot": "rose", + "title": "Current boundary", + "items": ["B2B order capture does not commit stock or payment", "Provider delivery is configured as disabled"] + } + ] +} diff --git a/.archify/architecture-mani-candles-20261003-1716/mani-candles-backend.html b/.archify/architecture-mani-candles-20261003-1716/mani-candles-backend.html new file mode 100644 index 0000000..64c8084 --- /dev/null +++ b/.archify/architecture-mani-candles-20261003-1716/mani-candles-backend.html @@ -0,0 +1,13799 @@ + + + + + + + + Mani Candles backend Diagram + + + + + + + + +
+ +
+
+
+

Mani Candles backend

+
+
+ + + + +
+ + Mani Candles backend + An architecture diagram generated by Archify. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Staff or API client · Authenticated user · Architecture component + + + + Staff or API client + Authenticated user + + + + Swagger UI · API explorer in development · Architecture component + + + + Swagger UI + API explorer in development + + + + NestJS HTTP API · /api/v1 routes · Architecture component + + + + NestJS HTTP API + /api/v1 routes + + + + Access guard · Session, rate limit, RBAC · Architecture component + + + + Access guard + Session, rate limit, RBAC + + + + B2B module · Accounts, quotes, orders · Architecture component + + + + B2B module + Accounts, quotes, orders + + + + Commerce module · Catalog, inventory, checkout · Architecture component + + + + Commerce module + Catalog, inventory, checkout + + + + Internal operations · Procurement, production · Architecture component + + + + Internal operations + Procurement, production + + + + Prisma data access · Scoped transactions · Architecture component + + + + Prisma data access + Scoped transactions + + + + PostgreSQL · Orders, ledgers, files · Architecture component + + + + PostgreSQL + Orders, ledgers, files + + + + + + explore + + + + HTTP + + + + guard + + + + B2B + + + + commerce + + + + operations + + + + read / write + + + + read / write + + + + read / write + + + + SQL + + + + + + + + Legend + + + Frontend + + + + Backend + + + + Database + + + + Security + + + + External + + + +

+ + + + + + + + + +
+ + + +
+ + + + diff --git a/.gitignore b/.gitignore index 229d0fc..f05b44c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,7 @@ coverage/ src/generated/ *.log .tmp/ +.archify/**/*.browser-check.json +.archify/**/*.delivery.json +.archify/**/*.finalize.json +.archify/**/*.finalize-summary.json diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..5385afd --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "tools/archify"] + path = tools/archify + url = https://github.com/tt-a1i/archify.git diff --git a/README.md b/README.md index 78f0363..3b46367 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Mani Candles backend +Explore the [interactive backend architecture map](docs/architecture-visualization.md) for a source-linked view of the current modules and data flow. + Phase 1A provides the service foundation. Phase 1B adds staff account provisioning, authentication, sessions, recovery, configurable RBAC, and audit records. Phase 1C implements core commerce APIs. ## Setup diff --git a/docs/architecture-visualization.md b/docs/architecture-visualization.md new file mode 100644 index 0000000..6a3dd26 --- /dev/null +++ b/docs/architecture-visualization.md @@ -0,0 +1,21 @@ +# Architecture visualization + +The [interactive backend architecture map](../.archify/architecture-mani-candles-20261003-1716/mani-candles-backend.html) shows the API entry point, access checks, major feature modules, and PostgreSQL persistence. Open the HTML file in a desktop browser. Click a component to inspect its source references; use the controls in the page to change the view. + +This is a source-backed **snapshot** of commit `5a503c75207a0d2a1cbb1ee251f02eff118d7b5c`, not a live service dashboard. It does not report request traffic, database contents, test results, or runtime health. Use [Swagger UI](swagger.md) to exercise running endpoints. + +## Tooling and regeneration + +Archify is included as a Git submodule under `tools/archify`, pinned to commit `d5a1333d7447c866a765adac7d4d062f2f02e4d2`. Its upstream license is MIT. After cloning this branch, initialize it: + +```sh +git submodule update --init --depth 1 tools/archify +``` + +The editable diagram specification is [`candidate.json`](../.archify/architecture-mani-candles-20261003-1716/candidate.json). When architecture changes, update its components and source lines, set `meta.repository.revision` to the new commit being described, and regenerate from the backend root: + +```sh +node tools/archify/archify/bin/archify.mjs finalize architecture .archify/architecture-mani-candles-20261003-1716/candidate.json .archify/architecture-mani-candles-20261003-1716/mani-candles-backend.html --repo-root . --quality showcase --json +``` + +`finalize` validates the specification, verifies source references, builds the standalone HTML, and checks the result in a browser. The generated HTML needs no server or external assets. Commit the specification and HTML together after the checks pass. Browser-check receipts are local verification outputs, not project source. diff --git a/tools/archify b/tools/archify new file mode 160000 index 0000000..d5a1333 --- /dev/null +++ b/tools/archify @@ -0,0 +1 @@ +Subproject commit d5a1333d7447c866a765adac7d4d062f2f02e4d2