Skip to content
Custom-print e-commerce · store + back office

A custom-print store
that protects its margin.

Tiozinhos das Artz personalises gifts for people and promotional items for companies. The system works out the price of every order, and the customer follows it all the way to delivery.

My role
Architecture and development
Model
E-commerce with its own back office
Tiozinhos das Artz store home page on desktop, in Portuguese: “We make your custom item one of a kind”, with the category menu, the See products and For companies buttons and the family illustration.
1
system for store, back office and site: only one to maintain
126
automated tests on the store’s code
9 × 4
permission modules and actions: each person sees only what they should
6
order stages the customer follows without asking
The problem

A custom product is not an off-the-shelf purchase

The price changes with the quantity, and the artwork is agreed after the order. And whoever handles orders does not need to see the store’s costs.

A price that depends on quantity

Quantity tiers, minimum order, promotions and coupons combine. Wrong sums become a wrong price.

An order that only starts after the sale

From order to delivery there are 6 stages, and the customer wants to follow them without having to ask.

Margin in the dark

Without the cost sums done, a promotion becomes a loss.

What we delivered

A store that does the sums itself

The right price, from cart to receipt

Quantity tiers, promotions and coupons are worked out by the system, never by the customer’s browser.

Promotions that don’t lose money

The back office suggests the largest discount that still respects the store’s minimum margin.

Stock that never sells twice

Stock is taken together with the order. If the last unit is gone, the order is not written.

Each person sees only what they should

Whoever handles orders sees neither costs nor pricing parameters. The system enforces it, not the screen.

Tiozinhos das Artz store home page on a phone, with the family illustration above the headline.
How it works

From cart to delivery in three steps

  1. The customer chooses

    Product and quantity in the store, with the address filled in from the postcode.

  2. The artwork is agreed

    After the order, customer and store discuss and approve the artwork.

  3. The order is followed

    One page shows the 6 stages, from Received to Delivered.

For the technical reader: architecture and decisionsDiagram, four decisions and the stack.

One system: store, back office and database at the edge

The same service, at Cloudflare’s edge, delivers the store and the back office, answers the API and takes care of each page’s SEO. The database is at the edge too, and the pricing and permission rules are the same for the screen and for the server.

Architecture of the Tiozinhos das Artz store in four layers The browser runs the store and the back office and keeps only the customer’s choices in the cart. A single service at Cloudflare’s edge answers the API, computes price and stock, checks login and permissions and takes care of SEO. The database holds orders, the catalogue and the images uploaded through the back office. The integrations are payments, address by postcode and notices by WhatsApp and e-mail. BROWSER Store React Back office the same application Cart the customer’s choices only EDGE · CLOUDFLARE WORKERS API Hono Price and stock always on the server Login & permissions checked on the server SEO page by page DATABASE · CLOUDFLARE D1 Orders and catalogue database at the edge Back-office images uploaded by the team INTEGRATIONS Payments Mercado Pago Address by postcode ViaCEP + BrasilAPI Status notices WhatsApp and e-mail Architecture of the Tiozinhos das Artz store in four layers The browser runs the store and the back office and keeps only the customer’s choices in the cart. A single service at Cloudflare’s edge answers the API, computes price and stock, checks login and permissions and takes care of SEO. The database holds orders, the catalogue and the images uploaded through the back office. The integrations are payments, address by postcode and notices by WhatsApp and e-mail. BROWSER Store React Back office the same application Cart the customer’s choices only EDGE · CLOUDFLARE WORKERS API Hono Price and stock always on the server Login & permissions checked on the server SEO page by page DATABASE · CLOUDFLARE D1 Orders and catalogue database at the edge Back-office images uploaded by the team INTEGRATIONS Payments Mercado Pago Address by postcode ViaCEP + BrasilAPI Status notices WhatsApp and e-mail
There is no separate service for the back office: one deploy publishes everything. Online payment and automatic e-mail are switched on by configuration, with no new deploy.

Four choices and why

01One system for store, back office and site

Why
One codebase to maintain and one deploy to publish. There is no separate back-office service to drift out of sync with the store.

02The price always comes from the server

Why
The cart keeps only the customer’s choices and the price is always computed on the server, so the storefront can’t get the amount wrong. The total is the same in the quote, in the order and on the receipt.

03Promotions that respect the margin

Why
The back office knows the cost of each product and suggests the largest discount that still respects the store’s minimum margin. A promotion doesn’t turn into a loss.

04Permissions checked on the server, not on screen

Why
Each role defines what a person can see and do, and the server is what checks it. Whoever handles orders never receives costs or pricing parameters.

Stack

TypeScriptReact 19Vite 7Tailwind CSS v4React Router 7HonoCloudflare WorkersCloudflare D1Mercado Pago Checkout ProResendViaCEP / BrasilAPInode:test

Payment: Pix, card and boleto through Mercado Pago. Without the integration switched on, the store accepts the order and payment is arranged with the team.

What is not here: prices, order volume and revenue. Those are the store’s data.

Next step

Have a store where the price depends on the order?

Tell me how you sell today. The first conversation takes thirty minutes.

  • A price that changes with quantity
  • An order that carries on after the sale
  • A team with different access

Prefer email? contato@gustavosaez.com.br

← Other case studies