Weekend Creative Challenge: ASCII Architect
Describe a system in plain English, get back an ASCII architecture diagram that goes anywhere text goes. Built with Amazon Bedrock, Lambda, API Gateway and S3.
Vision & what the app does
Every developer has had this moment: you are explaining a system to someone and words are not enough. You need a picture. So you open a diagramming tool, drag boxes around for twenty minutes, export a PNG, and drop it into a README — where it quietly goes out of date within a month, because nobody ever updates an image.
ASCII Architect takes a different approach. You describe your system in plain English and it draws you an architecture diagram made entirely of text.
Type "a CI pipeline that builds, tests and deploys a web app" and it returns a proper diagram: GitHub sending a webhook down to a CI Server, which triggers a Build, which passes an artifact to Test, which passes to Deploy, which pushes to a Web Server — every box drawn with box-drawing characters, every connection labelled with what flows across it. Ask for a photo sharing app and the flow branches instead: a browser feeding an uploader and a commenter, which write out to an object store and a database in parallel.
The creative output is the diagram itself. Because it is plain text it goes anywhere text goes: a README, a commit message, a code comment, a pull request description, a terminal, a plain-text email. It survives copy-paste. It shows up as a readable diff in git when someone changes it. It needs no image hosting and no diagramming tool. You can see it working at the live link at the bottom of this article.
How I built it
One Lambda function, one static page, one model, no framework. The frontend is a single self-contained HTML file — no build step and no npm packages — so deploying it is a single copy command to S3.
Then I spent the entire weekend on one problem.
The model could not draw
The first version asked Amazon Nova Lite to produce the ASCII directly. It understood the architecture perfectly and could not draw it at all. A box would come back with a top edge of 16 characters and a bottom edge of 17, because the model inserted a connector character without removing a dash to make room. Every box was visibly crooked.
I rewrote the prompt three times. I set a hard 72-character width limit. I included a correctly drawn example. I added the instruction to count characters so vertical edges line up exactly. Each revision helped a little. None of them fixed it, because character-accurate layout on a grid is simply not something a small language model does reliably — it is arithmetic dressed up as text generation.
So I stopped asking it to draw. The model now returns only the structure — a list of nodes and a list of edges, as JSON — and about 200 lines of JavaScript lay out the ASCII deterministically. It assigns nodes to layers by longest path from the entry point, centres each layer, and draws connectors onto a character grid using a lookup table that merges box-drawing junctions correctly.
Alignment stopped being something I hoped for and became something the code guaranteed. Every box is exactly 16 characters wide because a constant says so.
The model also could not point arrows the right way
With layout fixed, a second problem surfaced. Nova Lite kept drawing databases and caches pointing into services rather than the other way round. Three prompt revisions failed to stop it, including an explicit rule written in capital letters.
The fix was the same shape as the first. A normalising function flips any edge running from a storage-like component into a service, drops duplicate and contradictory edges, forces the entry point to be a source, and attaches orphaned nodes. Roughly forty lines of code that enforce absolutely what the prompt could only request.
Things that went wrong
Lambda Function URLs were blocked. I chose a Function URL over API Gateway to avoid an extra service. Every request returned 403. The resource policy was correct, the auth type was set to none, and there was no organisation policy blocking it. What settled it was CloudWatch: the log group had exactly one stream, from a direct invoke. The HTTP requests were never reaching the function — they were being rejected above it, at the account level. I switched to an API Gateway HTTP API and it worked immediately. The lesson was diagnostic, not architectural: I spent twenty minutes re-reading a policy that was never the problem, when asking whether the request even arrived would have told me in two.
Edges that skipped a layer drew straight through boxes. When a node connected to something two layers down, the connector ran vertically through whatever sat in between, slicing through box interiors. Those edges now route down a dedicated gutter column to the left of the diagram.
My entry-point detector matched too much. I detected the request originator with a regex containing the word "app" — which matched "App Server", a backend, promoting it to entry point and orphaning the rest of the graph. Narrowing the word list fixed it.
A missing file in the zip. My deploy script packaged the handler and its dependencies but not the new renderer module, so a working local build became a module-not-found error in production. API Gateway reported only "Internal Server Error"; CloudWatch had the real answer in one line.
AWS services used and architecture overview
Amazon Bedrock (Nova Lite) — turns the description into a structured graph.
AWS Lambda (Node.js 20) — prompts the model, normalises the graph, renders the ASCII.
Amazon API Gateway (HTTP API) — public HTTPS endpoint with CORS.
Amazon S3 — static website hosting for the single-page frontend.
AWS IAM — execution role scoped to invoking the Bedrock model.
The flow is straightforward. The browser loads a static page from S3. That page posts the description to an API Gateway HTTP API, which invokes the Lambda function. The function builds the prompt, calls Bedrock through the Converse API, normalises the returned graph, renders it to ASCII, and sends the text back. Everything is serverless and idle-free: nothing runs, and nothing is billed, until somebody types a description. A generation takes about 2.5 seconds and 700 tokens.
For fun, I asked the app to describe itself. It produced a broadly correct diagram — and added a Database the app does not have. A neat illustration of the tool's honest limitation: it draws a plausible architecture, not a verified one.
What I learned
Give the model the judgement and give the code the precision. This is the single biggest thing I take away. Nova Lite is genuinely good at knowing that a photo sharing app needs an uploader, a resizer, an object store and a comment service. It is bad at counting to sixteen. Once I split the problem along that line — model decides what, code decides how — both halves became easy. I had been treating prompt engineering as the only available tool when the real fix was to move the requirement out of the prompt entirely.
Prompts request, code enforces. Both of my hard problems ended the same way: three prompt revisions, partial compliance, and eventually the rule written in JavaScript where it holds every time. A prompt is a strong suggestion. If something must be true, assert it in code.
Read the logs before re-reading the config. The Function URL 403 and the missing module both looked mysterious from outside and were obvious from CloudWatch. Asking whether the request even arrived is worth doing before any theory about why it was rejected.
Constraints improved the creative output. Capping diagrams at 72 characters and eight components made them better, not worse — tighter, more focused, fewer irrelevant parts. The limitation did the editing.
Link to app and repo
Describe something you built recently and see what comes back. The example chips on the page are a good place to start.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article