Playbook · Castañer
E-commerce operations guide

Mission control, the live business.

The Dashboard Castañer is the place where all the online store's data —sales, orders, stock, traffic, returns, fulfillment— comes together, live around the clock. A single source of truth, always up to date, that you can trust blindly.

Playbook v1 June 2026 Dashboard Castañer
00
Manifesto

The e-commerce control center for Castañer

The Dashboard Castañer is the place where all the online store's data —sales, orders, stock, traffic, returns, fulfillment— converges into a single truth, live around the clock.

It is not a report you look at once a month. It is the daily pulse of the business: the first thing you open in the morning and the one that answers, in seconds, the question that matters at any given moment. A single source of truth, always up to date, that you can trust blindly. That trust is the whole project; everything else —the architecture, the automation, the agents— exists to protect it.

01
Quick overview

The project in 30 seconds

What it is. A 24/7 internal dashboard of operational KPIs for castaner.com, Castañer's online store (a Catalan footwear brand, founded in 1927).

Who it's for. Castañer's e-commerce team. It started as a single-user tool and today it is multi-user with roles: management, agency, leadership, operations, marketing and the UK store team, each with their own view.

What problem it solves. Castañer sells across many channels and markets; the data lives scattered across Shopify, Klaviyo, GA4 and REVENI, often with criteria that don't match each other. The dashboard unifies it, makes it consistent and serves it consolidated, without anyone having to export spreadsheets or recalculate anything.

Key facts

7
markets: ES · FR · IT · UK · US · GR · EU_REST
2
Shopify shops: main (EUR) + UK (GBP)
~20
automated jobs: snapshots, sync, backups, emails, auditing
4
Claude Code AI subagents
3
complete languages: CA / EN / ES (~1,295 keys each)
FactDetail
MarketsES · FR · IT · UK · US · GR · EU_REST (the rest of the EU/world)
ChannelsWeb (Shopify) · Marketplaces · Physical stores (POS, 10+ locations)
2 Shopify shopsMain shop (EUR) + UK shop (GBP)
IntegrationsShopify · Klaviyo · GA4 · REVENI · carriers
LanguagesFully trilingual CA / EN / ES
Automation~20 scheduled jobs: snapshots, sync, backups, 2 automatic emails, daily auditing
AI agents4 Claude Code subagents: mail writer, 2 translators, data auditor
02
Golden rules

Principles and golden rules

Non-negotiable principles. Each one was born from a real mistake; following them is what keeps the dashboard reliable and maintainable.

2.1

Never make data up

Everything stated comes from a real figure. When a view, an email or the chat needs a number, they read the field already published in the shared data snapshot; they don't recompute it.

Why. Whenever a number is recalculated independently it tends to drift from what the dashboard shows: a slightly different total, a growth sign that doesn't match, an undercount when a channel is misattributed. The rule: to keep everyone consistent, read the published figure, don't replicate the logic.
2.2

All text goes through i18n (CA/EN/ES)

No text is fixed in a single language. Everything goes through a central dictionary with one entry per phrase in Catalan, English and Spanish.

Why. The language is assigned per user. Text fixed in one language always comes out in Catalan and breaks the experience for the English or Spanish user. New text = always the entry in all 3 languages (via the translator agents).
2.3

Reports are self-contained

The one-off reports carry their data baked inside the report itself. The published version is always the one WITH data, never an empty template waiting to be filled.

Why. An empty template that depends on fetching data later is fragile: a routine update can overwrite the published report and leave it blank. Keeping the data embedded makes each report stand on its own.
2.4

One controlled path to production

Changes reach production through a single, version-controlled process, never by dropping files directly onto the live server.

Why. Bypassing the controlled path leaves the live copy out of sync with the source of truth and silently blocks future updates. A single, predictable route keeps production traceable and reproducible.
2.5

Avoid name collisions across modules

The front-end code is split into several modules that share one common space. Two helpers with the same name silently clash, and only one of them ends up running.

Why. A duplicated name once let a bug survive several rounds of changes, because the wrong version was quietly winning. Rule: before adding a shared helper, check it isn't already used elsewhere, and give it a name specific to its context.
2.6

Visual consistency via global styles

All blocks with the title → description → filters pattern share the same vertical spacing and the same width, governed by a single global stylesheet.

Why. Spacing is never set block by block. A new block with this structure needs no extra styling: the global rules already line it up, so the whole dashboard stays uniform.
2.7

Colors only via theme variables

There is a dark mode (default) and a light mode (strictly monochrome: black/white/greys, only green and red for positives/negatives). Colors are never fixed directly; they always come from the theme.

Why. So everything adapts to the active theme automatically. The only exception is the charts, where neutral greys that read well in both themes are used.
2.8

Least-privilege access to data sources

Each integration is connected with the narrowest access it needs. Whenever possible the dashboard only reads from a source, so it can never alter the data at origin.

Why. Read-only access keeps the source systems safe by design: the dashboard observes the business, it never changes it.
2.9

UK is a world apart

UK has its own shop, its own warehouse (a dedicated 3PL partner), its own email marketing and its own currency (GBP→EUR). It shows up in Real Time, Business, Product and "UK Operations".

Why. It is EXCLUDED from Orders, Stocks, Analytics and CRM of the main shop (its orders don't affect our logistics). Last-year sales before April 2025 come from a manual reference, because the early UK history is not reliable.
03
Architecture

The system at a glance

The dashboard is a 4-layer pipeline. The key to everything is the snapshot layer: no screen or email ever touches the live database.

The 4 layers · data flow

LAYER 1Sources
Shopify main shop Shopify UK shop Klaviyo email/SMS, campaigns, flows GA4 acquisition channels REVENI returns/RMA Carriers (tracking) FX (GBP exchange rate)
scheduled collection jobs
LAYER 2Consolidated data store
orders & returnsinventory traffic & sessionsanalytics email marketingstore sales UK funnelusers & roles
snapshot published every minute
LAYER 3Published data snapshot
real timeanalyticsstocks ordersbudgetCRM email marketingreturnsUK stocks
delivered after login
LAYER 4aDashboard pages
the business pages 90s refresh (Real Time) ~15 min (orders/stocks)
LAYER 4bEmails · Chat · Reports
Daily/weekly email (insights) Manuel (chat) reads the same snapshot One-off reports

The snapshot pattern · why it exists

The dashboard pages, the daily email and the Manuel chat never query the data store directly: they all read the same published snapshot, which is regenerated periodically.

  • A single source of truth. It is impossible for the dashboard, the email and Manuel to show different figures: they all read the same field from the same snapshot.
  • Speed. Reading a ready-made snapshot is near-instant, far faster than recomputing on the fly.
  • It keeps the data store light, since it is already busy ingesting new data continuously.
  • Temporal consistency. Everyone sees the same snapshot of the same instant.
🌍
Where it all lives. The dashboard runs on a dedicated cloud server, served securely over HTTPS at a private internal address. Only the e-commerce team can reach it, after logging in.
⚠️
Key optimization. The real-time view used to be very heavy and slow to load. It was made much lighter by sending the browser only the most recent order detail up front and loading older periods on demand as needed.
04
Product

The pages, in business terms

Each tab answers a business question. "Who sees it" indicates the roles with access (the admin sees everything).

Real Time
"What's happening RIGHT NOW?" Today's sales, orders and conversion live (90 s refresh).
Who: Everyone
Business
"Are we on track vs budget and last year?" Progress against budget, indicators by country, month/year to date.
Who: Management, agency, leadership, marketing
Product
"Which models sell and which are requested when out of stock?" Rankings, mix and returns by model, all across 4 channels (Web · Stores · Marketplaces · Total).
Who: Everyone (operational)
Operations
"How is the back-office doing?" Three views in one tab: Orders (fulfillment, stuck shipments, PUDO), Returns (REVENI reasons + full RMA cycle) and Stock (inventory, restock/size/deadstock alerts, evolution).
Who: Management, agency, operations
UK Operations
"How is the UK store doing?" Business + daily funnel + stock at the UK warehouse.
Who: UK team, management, agency
Database
"How is our customer database doing?" Subscribers, sign-ups/unsubscribes, FY buyers, Klaviyo status.
Who: Management, agency, marketing
CRM
"What works in our email marketing?" Top campaigns/flows by revenue, subjects, revenue comparison TY/LY.
Who: Management, agency, leadership, marketing
Analytics
"Where do we lose visitors along the way?" Funnel (sessions→cart→checkout→purchase), acquisition channels, monthly evolution.
Who: Management, agency, leadership, marketing
Reports
"Where are the one-off reports?" Report directory (Member Days, Checkout US, etc.).
Who: Admin and manager
Admin
"Who has access and to what?" User management, roles, permissions, email subscriptions, activity tracking.
Who: Admin only
🎙️
The Manuel chat (it is not a data tab) answers any question about the dashboard figures in natural language, reading the same JSON snapshots. It has voice (microphone + read-aloud).
05
Automation

The automatic cadence

Everything runs on its own thanks to around 20 scheduled jobs. This is the course of a normal day.

continuous
Order capture
Picks up new orders, returns and tracking from Shopify continuously
every minute
Snapshot refresh
Regenerates the published data snapshot the whole dashboard reads
10 min
UK sync
Syncs UK shop orders and applies the GBP→EUR exchange rate
15 min
Inventory
Captures current stock (and keeps the per-product history)
15 min
Analytics
Captures traffic, funnel and sessions by country
30 min
Email marketing sync
Incremental sync of newsletter, SMS and history
hourly
Sessions
Sessions for both shops, with the correct market bucket
every 2 h
UK stock & funnel
Refreshes UK stock and the UK funnel of the day
03:30
Backup
Daily database backup, kept for two weeks
04:00
Fiscal-year buyers
Rebuilds the list of buyers of the fiscal year
04:30
Campaigns & flows
Email marketing campaigns and flows of the last 12 months
04:45
Back-in-Stock
Back-in-Stock requests over the last 90 days
05:15
Returns
Downloads the full fiscal year of returns from REVENI
07:30
Physical stores
Rebuilds physical store sales by store and day
07:45
🛡️ Daily audit
Consistency audit of the KPIs; alert email ONLY if there is a real problem
08:00
✉️ Daily email
Daily email (briefing written by the writer agent)
Mon 08:05
✉️ Weekly email
Weekly email (more detailed summary), Mondays
Mon 09:30
Off-site backup
A second copy of the database is kept off the main server
hourly
Live report
Regenerates the hourly report for the Checkout US test
on demand
GA4 channels
Acquisition channels from GA4, refreshed once a day when enabled
🧭
Intentional morning order. First the overnight snapshots (CRM, email marketing, returns, store sales) → then the auditor (07:45) validates that everything matches → and only then does the daily email (08:00) go out, already on verified data.

The communication calendar

The insights emails take into account the brand's communication calendar (campaigns, Early Access and Sales by market). It serves to put the comparisons vs last year in context: often a drop vs last year is not an alarm but a calendar shift.

📅
Real example. One day the web showed a sharp drop versus last year. The writer explained it: that same date last year was the first day of the sales (a peak), whereas this year demand had been pulled forward to an earlier Early Access window. Some markets looked even worse, but it was not a conversion problem: they simply hadn't opened their Early Access yet.

Manual maintenance: when a new calendar arrives, that month's plan is added to the calendar the insights rely on. Brand detail: Castañer does NOT do Black Friday ("NO Black Friday" positioning).

06
Architecture

Key decisions and the why

Architecture decision record. Format: Decision → Context → Why.

🗂️A published snapshot instead of querying live
Context
The dashboard pages, the emails and the chat all need data.
Why
A single source of truth (figures cannot diverge), much faster reads, no extra load on the systems that are already ingesting data, and everyone sees the same snapshot of the same instant. It is the central principle of the whole system.
Realtime conversion = orders ÷ visitors
Context
The Real Time conversion rate.
Why
Shopify's own conversion figure mixed visitors and orders from different sources (giving nonsensical results for UK) and lagged behind by a couple of hours. Computing it as orders ÷ visitors × 100 uses the very same numbers shown on the card → it checks out by eye and is verifiable.
🔑Multi-user access with proper login and roles
Context
The dashboard needed to serve several people with different responsibilities.
Why
A real login plus per-user roles were introduced, so each person sees only what their role allows. The experience was designed to feel branded and elegant, in keeping with a fashion brand.
🤖Emails written with the Claude Code subscription (zero API)
Context
Relying on paid API usage for the daily email was fragile and costly.
Why
The emails are written using the Claude Code subscription rather than paid API usage → no per-message cost. The facts are computed first, the writer agent drafts the text, the translators translate it, and the email is sent.
🇬🇧Separate UK shop, with its funnel captured directly
Context
UK runs on its own separate shop.
Why
The main shop's location-based funnel gave almost nothing for the United Kingdom, so the real UK funnel is taken directly from the UK shop. The same criterion applies to UK sales (a manual reference for older history) and traffic (sessions from the UK shop).
📅Communication calendar in the insights
Context
Drops vs LY that looked like alarms.
Why
Many are calendar shifts (Early Access pulls demand forward). Giving the writer the calendar lets it explain this per market instead of triggering false alarms.
🌐Trilingual i18n CA/EN/ES
Context
The dashboard is used by the internal team + agency, in different languages.
Why
All text goes through a dictionary → the language is assigned per user and the dashboard opens directly in their language. Manuel (the chat) stays in Catalan by design.
🛡️Proactive data auditor
Context
Over one day, several miscalculated numbers appeared that the team had to hunt down by hand.
Why
A set of deterministic rules audits the data every morning before the daily email goes out; if there are findings, the AI verifies them and discards false positives, and it only raises an alert if a real problem remains. "Verify before asserting", automated.
07
Intelligence

The Claude Code agents

Four specialized AI subagents that assist with writing, translation and data checking.

✍️
redactor-mails
Writes the text of the daily/weekly briefing in Catalan, with the house tone and anti-invention rules (it doesn't recalculate numbers, only interprets them). Runs on the subscription, not paid API usage.
When: automatically every day (08:00) and every Monday (08:05). Manually, to generate any summary/email based on dashboard data.
🇬🇧
traductor-angles
Keeps the English version of the dashboard in sync with Catalan and translates any text into English with the canonical e-commerce glossary.
When: new Catalan text is added, or an English version of any text is needed.
🇪🇸
traductor-castella
Same as the previous one but for Spanish (neutral Spanish, avoiding Catalanisms).
When: new text is added, or a Spanish version is needed.
🛡️
auditor-dades
Read-only. Verifies a number, card, KPI or claim against the underlying data and the published snapshot; rules ✅/⚠️/❌ with evidence, diagnoses the cause and proposes a fix (without applying it).
When: a value raises doubt, or to validate a block/page before trusting it. It also runs on its own every morning.
08
Reference

Glossary and conventions

Channels

TermDefinition
WEBOnline store sales (website and shopping app). All markets, including UK.
MARKETPLACESSales through marketplaces. Small amounts; the real signal is that most don't take off (only a couple sell consistently).
STORES / POSPhysical store sales, by store. Outside the online KPIs.

Markets

ESFRIT UK (UK shop) USGR EU_REST (the rest)

The main market groupings include UK.

Metrics

TermMeaning
Net sales (excl. VAT)Sales after discounts, excluding VAT and shipping. The reference metric.
Gross vs NetThe big "Sales today" KPI and market cards are GROSS (do not subtract returns). The detail tables and Targets/Monthly are NET (they do subtract). The daily email uses GROSS.
LY (Last Year)The same day of the previous year, read from the published snapshot.
MTDMonth to date — current month cumulative.
FY (Fiscal Year)Castañer's fiscal year: August → July.
Same-storeGrowth of stores open in both years (excludes newly opened and closed ones). The gross store % is inflated by the new ones.
Visitors vs SessionsVisitors are unique people (a bit fewer than sessions); sessions use the correct market bucket. For UK, visitors are derived from sessions.
Conversion (realtime)orders ÷ visitors × 100 (never Shopify's own conversion figure, which mixes sources).

Other terms

  • Funnel: Sessions → Cart → Checkout → Purchase (the "product page" step only comes from GA4).
  • BIS / Back-in-Stock: "notify me when it's back" requests. "Lost money" estimates the sales missed when those requests don't convert.
  • RMA: the return process (status, method, carrier, timestamps). Around half of returns are due to size.
  • PUDO / pickup point: a package left at a pickup point; detected after the fact from the carrier updates (a virtual "Awaiting pickup" status).
  • PUDO ≠ checkout: Castañer does not offer third-party pickup points at checkout.