docs(architecture): add Archify backend visualization
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
5a503c7520
commit
cc9e46c8fb
|
|
@ -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"]
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -7,3 +7,7 @@ coverage/
|
|||
src/generated/
|
||||
*.log
|
||||
.tmp/
|
||||
.archify/**/*.browser-check.json
|
||||
.archify/**/*.delivery.json
|
||||
.archify/**/*.finalize.json
|
||||
.archify/**/*.finalize-summary.json
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
[submodule "tools/archify"]
|
||||
path = tools/archify
|
||||
url = https://github.com/tt-a1i/archify.git
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit d5a1333d7447c866a765adac7d4d062f2f02e4d2
|
||||
Loading…
Reference in New Issue