Read the response, not the tutorial: a React storefront on a headless CMS
Modeling a catalog in Strapi, proving its endpoints in Postman, and wiring a React cart to the live API — with three separate moments where doing what the instructions said would have produced broken code.
This project builds the data layer and storefront of a small online shop. A headless CMS stores the product catalog and generates a REST API from the content model; a React cart consumes it. Because the backend is generated rather than hand-written, the engineering shifts to three things that matter more than they sound: how the data is modeled, who is allowed to change it, and whether the client actually matches what the API returns.
That last one is where most of the interest turned out to be.
Modeling the catalog
The content model is four fields: name, country of origin, cost and units in stock. Cost and stock are integers rather than text, so the frontend can do arithmetic on them without parsing strings — a small decision that avoids a category of bug where "$3" and "3" are the same value to a human and different to a program.
A headless CMS exposes nothing publicly by default, which is the right default. For the public role I enabled only the two read operations, find and findOne. Anyone can browse the catalog; no unauthenticated caller can create, edit or delete a product. Writes need a credential, and that becomes the whole point of the next section.
Two things the raw JSON told me that the admin UI didn't
Looking at the actual API response rather than the content manager surfaced two issues immediately.
First, data quality: the JSON showed trailing spaces inside the product and country values. They are invisible in the admin interface and perfectly capable of breaking an exact-match search or filter later. I corrected them and republished.
Second, identifiers: the admin list showed one set of IDs while the API returned another. Strapi 5 stores a draft row and a published row per entry, and the API serves the published rows — so the numeric ID is not the stable handle across both. The document ID is. Reaching for the obvious-looking integer would have produced code that works until someone edits an entry.
Reads are public, writes carry a token
Before testing my own backend I spent a round on a public practice API, sending one read and one write and reading the status code, latency, size and body of each. The distinction that matters: a 200 means "here is what you asked for", while a 201 means the server accepted a payload and created a resource. The practice API confirmed creation in two ways at once — the status and a server-generated ID in the body — which is exactly the pattern to look for when verifying any write.
Applied to my own API, that became two requests. A public GET returned the full catalog with no credential. An authenticated POST, carrying a Bearer token in the Authorization header, created a new product and returned 201 with the stored record.
Tokens are credentials, so every capture of this was redacted before publication, and in a real deployment the token belongs in an environment variable rather than in source code or a shared collection. I also cross-checked the write three ways: the response timestamp matched the server's own request log entry, and the record appeared in the database. Postman, the log and the data all describing the same write is a stronger claim than any one of them alone.
Three times the instructions were wrong
This is the part I'd keep from the whole project. Three separate times, following the written guidance literally would have produced a broken result.
A prompt that didn't exist in the tutorial
The CLI asked about a cloud signup — a step the instructions didn't mention, because they were written for an older version. Nothing was broken; the tooling had simply moved on. I skipped it to keep the project local.
An AI assistant confidently pointing the wrong way
My first write request to the practice API failed with getaddrinfo ENOENT, and the tool's assistant suggested fixing the request body format. Reading the error itself told a different story: getaddrinfo is the DNS lookup, so the request never left my machine and the JSON body could not be the problem.
The suggestion was specific, plausible and wrong. The error message was right there and said something else.
I declined the suggested fix, treated it as a transient network issue — consistent with timeouts I'd already hit during installation — and re-sent the unchanged request, which succeeded. Had I "fixed" the body, I'd have changed working code and still had a DNS problem.
A breaking change the starter code didn't know about
The biggest one. The starter comments said to read each product from an attributes wrapper, which is the older response shape. Inspecting the real response showed that the current version returns fields at the top level instead. Mapping item.attributes.Name against that would have produced a list of undefined values — a UI full of blanks, with no error anywhere to explain it.
So the restock handler maps the top-level fields directly. It prevents the default form submission, awaits the request to whatever URL was typed into the field, maps each product into the four fields the UI needs, and hands the result to the state setter so React re-renders. The whole thing is wrapped in try/catch, so a bad URL or a stopped server logs an error instead of crashing the app.
When the install failed
One more debugging note, because the instinct it teaches is useful. The initial install ended with an error in the native driver behind the CMS's local database. The log was full of deprecation and cleanup warnings, all of them harmless, and the actual cause was two network timeouts: the prebuilt binary download, then the fallback that compiles from source.
Because the project files had been created correctly, re-running the install inside the project directory completed it. A timeout is not a configuration error, and reading far enough into the log to tell them apart saved a rebuild.
What's honestly incomplete
The storefront works end to end, and several things about it are clearly unfinished. Product thumbnails show broken placeholders because the image files aren't present, and photos are chosen by position in the list, so they'd mismatch after a restock anyway — the fix is a media field on the content model so each product carries its own image. The cart counts quantities by name, so two products sharing a name would share a stock count; keying by document ID solves it.
More fundamentally, a CMS handles the catalog well and has no concept of a cart, an order or a payment. Making this real commerce means user accounts, an orders collection, stock decrement on purchase and a payment provider. API URLs are also hard-coded, dependency audits report vulnerabilities in the starter packages, and the test runner is configured but the new features aren't covered.
None of that undermines what the project demonstrates. It is worth writing down because a list of what a thing can't do yet is more useful to a reader than a claim that it's finished.
Strapi 5 · React 18 · REST · Postman · API tokens · axios · React-Bootstrap · SQLite · Node.js · Webpack
Read the full engineering dossier →
The full technical report is available on request. More of my work is at esmeraldaspace.com, and I am reachable on LinkedIn.