Lesson 02 · 2 in the route · 4 min read · Level 2
How to make yours with the engine
Document your project with ArqViva: research it, copy the template, fill N, E and FLOWS, write the manifest and pass the importer with no privacy hits.
Goal
Produce a living-architecture page and its manifest for a project of yours, so that tools/import-arquitecturas.py --check <repo> exits 0 and the page can be published under /arquitecturas/.
Why
The engine (ArqViva) does not draw by hand: it reads data. If the data is true, the page is true; if you invent an arrow, the diagram lies just as elegantly. So the real work is the research, not the drawing.
Steps
- Research and write
docs/arquitectura.notas.md. Walk the repo and answer: actors, containers (every piece deployed on its own, with its technology and the machine it runs on), the real calls between them (protocol and payload), 3 to 6 flows, data and deployment. If something does not exist, write “no aplica” and skip that view. Anything the code does not show is marked “por confirmar” and not drawn. - Copy the template. Copy
shared/arquitectura-viva/plantilla-arquitectura.htmlto your repo’sdocs/arquitectura.html. Change only text and data: the engine’s CSS and JavaScript stay untouched. Delete the tab and section of any view that does not apply. - Fill
N. One object per container on a 1200×690 canvas:x, y, w, h, kind, ttl, tech, color(blueown,violetfrom another repo,amberexternal),ext: trueif it exists outside the project,respandkv. Avoid the idsusr,wrkandapi: the template uses them for its own pills. - Fill
E. Each call hasid, a, b, as, bs, l, plusay/byto shift the anchor point. A call id must not collide with a node id. - Fill
FLOWS. A flow is{id, t, steps}. A step["e1","text"]is the call; with{rev:true}it is the reply;["srv","text"]is an internal step of one box;{note:"text", over:["web","srv"]}is a note. AddSTATESonly if the project has a state machine, andTABLES/RELonly if it stores data. - Write
docs/arquitectura.json. Fields:schema: 1, a kebab-caseslug,nameandoneLinerwith non-emptyesanden,machines(generic labels only, such as “PC Windows”, “Mac mini”, “Hostinger”, “GitHub”),containers,callsandflows(they must equal what the page declares),views,hasCore,updated(YYYY-MM-DD),statusandlandingwithorderandprojectSlug. Start atdraft; switch todoneonly after opening the page and checking boxes and flows. Delete the example’s_reglaskey. - Validate.
ArqViva.validateprints, in red on the page, every id that points nowhere. Fix them all. - Run the importer.
python tools/import-arquitecturas.py --check <repo>validates the manifest, the graph and the counts without writing anything, and audits privacy.
A minimal example with 3 nodes, 2 calls and 1 flow:
const N = {
web: {x:40, y:250, w:200, h:100, kind:"browser", ttl:"Page", tech:"HTML + JS", color:"blue",
resp:"Sends the query and renders the result.", kv:{"Runs on":"User's browser"}},
srv: {x:480, y:250, w:220, h:100, kind:"service", ttl:"Service", tech:"Python", color:"blue",
resp:"Validates the query and reads the store.", kv:{"Input":"JSON","Output":"JSON"}},
store: {x:920, y:250, w:220, h:100, kind:"files", ttl:"Store", tech:"JSON on disk", color:"amber", ext:true,
resp:"Holds the reference data.", kv:{"No database":"plain text files"}},
};
const E = [
{id:"e1", a:"web", b:"srv", as:"r", bs:"l", l:"POST /search", ay:0, by:0},
{id:"e2", a:"srv", b:"store", as:"r", bs:"l", l:"reads data.json", ay:0, by:0},
];
const FLOWS = [
{id:"search", t:"Look something up", steps:[
["e1", "The page sends the query"],
["srv", "Validates the received text"],
["e2", "Reads the data file"],
{note:"No database: everything is a file read", over:["srv","store"]},
["e1", "Returns the result as JSON", {rev:true}],
]},
];
What actually went wrong
The first version of the manual told authors to write sequences as Mermaid blocks. A sequenceDiagram failed with “Syntax error in text” because one message contained a semicolon. That manual still carries the Mermaid mention; since 2026-10-11 the engine uses no Mermaid and no CDN, and the importer rejects any pre.mermaid. When in doubt, SCHEMA.md wins. The importer also fails hard on privacy hits: it exits with code 1 and writes nothing, printing the file and line of each hit.
How to verify
- Open
docs/arquitectura.htmlin a browser: every box responds to a click and every flow replays with no red errors. - Run
python tools/import-arquitecturas.py --check <repo>. Exit 0 means valid with no hits; 1 means privacy or public-copy hits; 2 means an invalid manifest or page (schema, counts, a step or call pointing nowhere). - Privacy rule: no IP address, host name, personal path, email or credential in the page, the manifest or the notes.
Self-check
- Why is the research, not the drawing, the central work?
- Which three things must match between the manifest and the page?
- What is the difference between
["e1","text"]and["e1","text",{rev:true}]? - What do the importer’s exit codes 0, 1 and 2 mean?
- Which node ids should you avoid, and why?