Pick a look, order via LINE
A catalog + lookbook site for a premium linen clothing brand that turns selling through an IG feed into an easy-to-browse storefront: pick a color and size, and one tap opens LINE with the order message. No cart, no checkout, everything managed by the brand in a headless CMS. Built with Next.js 16 + Payload CMS 3.

A catalog + lookbook site for a premium linen clothing brand — moving it from selling through an Instagram feed to a storefront that is easy to browse. Customers pick a color and size, tap "Order", and land in LINE with the order message already filled in. The brand team edits products, prices and stock status themselves in a headless CMS.
The problem
A linen clothing brand that grew on Instagram wanted a storefront that felt premium and was easier to browse than a feed — without committing to full e-commerce.
Customers spot a look on IG, but to order they have to scroll back through the feed and ask again: which item, what sizes, what colors, how much, is it still in stock — the brand answers the same questions every day. Meanwhile a cart and card payments are heavy and unnecessary for sales that already end with "let's talk on LINE".
Selling only through the IG feed — no structured way to find products
Customers scroll the feed to find a look they saw. There are no categories and no proper product pages, and older collections sink under new posts.
The same chat questions every day
Which size, what color, what is the fabric like, how much, is it sold out — the same questions come back because the information isn't in one place, and the admin answers them all by hand.
A cart and card payments are heavy and unnecessary
Real sales already end in a LINE conversation — checkout, a payment gateway and member accounts would be unused overhead and add more places for customers to drop off.
The brand can't update products without a developer
Adding a product, changing a price or marking something "sold out" would each mean paying someone to edit code — the brand team wanted to manage content without touching code.
The ready-made template looks good but is tied to its own commerce engine
The fashion template they liked comes with a fixed cart and product system — it can't be connected directly to real data or a LINE channel.
The solution
Give the catalog real structure, turn the "order" button into a deep link into chat, drop checkout entirely, and let the brand control everything from the back office.
A structured catalog, easier to browse than a feed
Products are grouped into categories, with collection pages filtered by category, a status (in stock / pre-order / sold out) and badges — customers find the look they saw in 2–3 clicks.
Chat-to-Order: tap order → LINE opens with the message
Pick a color and size, and the site builds an order message (product name + selected options + link), then deep-links into the brand's LINE OA with it pre-filled — the customer only taps send.
No checkout — just "inquire"
Cart, payment and member accounts are all removed, leaving a single inquiry flow — light, fast, and matching how sales actually close: in chat.
Headless CMS — the brand owns its content
Payload CMS built in at /admin — add or edit products, prices, statuses, categories, images, and even the LINE channel and default message, without touching code.
Rewire the template to be data-driven
Split the fashion template into HTML/CSS/JS, then "inject" real product cards from the CMS in place of the demo ones — keeping the design and animations, discarding the original commerce engine.
How it works — 4 steps
From opening the site to the order message landing in chat
Explore
Open the site, browse a collection, filter by category, and see each item's status
Consider
Open a product page to see photos from several angles, price, fabric and details
Pick color / size
Select a variant and the order message is built automatically in real time
Inquire via LINE
Tap order → LINE opens with a pre-filled message, ready to send
Tech Stack & Architecture
An RSC-first storefront + headless CMS + deep links out to chat — no payment layer
The original brief asked for a WordPress-style CMS — I chose Next.js 16 + Payload CMS 3 instead, because Payload comes with a built-in admin UI (labels can be translated to Thai), automatic REST/GraphQL, and runs on the same serverless deployment as the storefront · React Server Components read straight from the database with no API layer in between · PostgreSQL keeps the schema tidy (auto-push in dev) · and most importantly — there is no payment layer at all. The sale closes through a deep link into LINE, which keeps the whole system light and easy to maintain
What I built — 8 core capabilities
The full loop, from the back-office catalog to the order message in chat
Chat-to-Order Deep Link
Builds the message from a template ({product}/{url}), then creates line.me/R/oaMessage and Telegram links with safe encoding
Variant Picker → Message
Color/size picker (client component) → appends "Product name (Color: …, Size: …)" to the order message in real time
Template Rewire Engine
Reads the fashion template pages, splits out inline styles / body / scripts in order, and caches the result — parsed once, reused on every request
Balanced-Tag DOM Transforms
Functions that replace an element's inner HTML by class/tab by counting the depth of opening and closing tags — so real data lands precisely in deeply nested markup
Commerce Stripper
Removes the cart/add-to-cart nodes (data-node-type) from the template entirely and puts mount points for the LINE/Telegram buttons in their place
CMS Catalog
Products/Categories/Media — status, badge, featured, original price, multiple images, slug auto-generated from the name (beforeValidate hook)
Brand Settings Global
LINE OA / Telegram / Instagram / default order message / banner images — all editable from the back office, nothing hardcoded
Runtime Re-init
Loads the template's libraries once per session, re-fires the reveal animation on every page change, plus a safety net so no element stays hidden
The product page + buy panel
Pick color/size → the order message is built automatically → one tap opens the chat

Audrey Linen Midi Dress (Color: Sand, Size: M)
…/products/audrey-linen-midi-dress
Sample photo: Reistor / Unsplash
UI design & design system
From a product designer's side — a sharp, high-contrast lime-on-dark design system, and a flow that takes customers from "that's the look" to "message to order" with as little friction as possible.
--ln-*) — a dark fashion look with a very bright accent so products and the order button stand out most
Pre-order
SALE
SALE
Sold out

Audrey Linen Midi Dress (Color: Sand, Size: M)
…/products/audrey-linen-midi-dress
Sample product photos from Unsplash — Reistor · engin akyurt · Kawê Rodrigues · Junior REIS · Sincerely Media
- Mobile-first — designed at 393 first, then expanded to 768 / 1440 Fashion customers mostly browse on their phones, so the base layout is a 2-column product grid with 3/4 images and a full-width order button. Larger screens expand to 3–4 columns, rather than shrinking a desktop layout down.
- UX writing — the order message is written in advance The "Add to cart" button is replaced by "Order via LINE", which opens a real conversation with a pre-filled message (I'd like to order… + product name + color/size + link). The customer just taps send, cutting "I want this" down to one click.
- Component states — color/size buttons have clear default / active / sold-out states The selected option gets a lime fill and bold text (active); the others have a faint outline (default), so the difference is the fill, not just the border. A "sold out" item can still open the chat to ask about the next batch instead of being a dead end.
- Accessibility — high-contrast lime-on-dark + touch targets ≥ 44px Cream text and the lime accent on a #0d0d0d black background exceed 4.5:1 contrast (WCAG AA). CTA buttons deliberately use black text on lime, not white, and the order button is about 44px tall, easy to hit with a thumb.
Problems and hacks
6 problems I had to solve myself while connecting a ready-made template to real data and chat channels
Before: original template
After: rewiredThe template is tied to its commerce engine — it can't use real data
The template's markup is deeply nested with cart nodes embedded in it — replacing product cards with a plain regex matches the wrong closing tag as soon as there is a nested <div>.
<div> +1, </div> −1) to find the correct inner HTML before replacing it — so it can inject real cards, strip commerce nodes and swap the hero banner precisely, even in deeply nested markup.The template's animations don't play after hydration
The reveal animation sets elements to opacity:0 and waits for the load event — but the script is injected after React hydrates (after load has fired), so on SPA navigation whole pages stayed hidden.
load/readystatechange manually — plus a safety net that reveals any element still hidden after 1 second.Emoji / spaces / line breaks in the message → broken deep links
The order message contains an emoji 🛍️, spaces and \n — appended to the URL as is, the LINE/Telegram links break immediately.
encodeURIComponent() before building the deep link, and normalize the prefix (add @ for LINE, strip @ for Telegram) so it works however the brand types it.The template's commerce code calls /api/cart and collides with the CMS
The template's original runtime tries to fetch /api/... (the cart), which collides with the CMS's /api endpoint → CSRF errors and a "site unsecured" alert popping up in front of customers.
window.alert to drop cart/checkout/unsecured messages, and silence unhandledrejection/error noise from the commerce code (CSRF, Failed to fetch) — leaving only the flow I control.Dynamic pages re-parse a large file on every visit
Pages are force-dynamic (live data), but each navigation had to read and regex-parse template files of a few hundred KB — wasteful and slow.
Map — the template files are static design that never changes, so they are parsed once and reused, while product data is still fetched fresh from the CMS on every request. The two are kept clearly separate.The brief asked for WordPress and assumed e-commerce
The initial expectation was a WordPress-style CMS with a cart — but real sales end in chat, so a checkout system would be dead weight.
Deliberate design decisions
What I deliberately left out matters as much as what I built
The site has one job: a catalog that gets customers into a LINE conversation as quickly and smoothly as possible. It has no cart, no payment and stores no orders — the sale closes in the brand's chat. A tight scope from the start meant a direct, lightweight build the brand can genuinely maintain on its own.
- Chat-to-order, no checkout — the sale closes in chat; the site just gets you there fast
- Rewire, don't rebuild — keep the template's design, drop only the commerce engine
- CMS-first, nothing hardcoded — products, channels and messages are all editable from the back office
- Deep links straight to the brand — into the brand's own LINE OA, no middleman
Knowledge I built up
5 areas where this project genuinely moved my skills forward
Understanding the non-e-commerce pattern of closing sales in chat — building pre-filled messages, deep-linking into LINE OA / Telegram, and UX that cuts the path from "I want this" to "message the shop" to one click. Lesson: for some businesses a cart isn't the answer — the conversation is what closes the sale.
Designing collections/globals, using field hooks (beforeValidate to generate slugs), access control, and localizing admin labels/descriptions into Thai for the brand team — seeing how a headless CMS gives you both the data model and the back office in one. Lesson: what's good for the client = editing content without calling a developer.
Splitting head styles / body / scripts out of template pages and writing a transform that counts opening/closing tag depth to find the correct inner HTML, without a DOM library — and understanding why a plain regex breaks on nested markup. Lesson: parsing HTML correctly is about balancing, not pattern matching.
Understanding RSC + force-dynamic, injecting external runtimes (jQuery/an animation engine) into the React lifecycle so they run in the right order after hydration and client-side navigation, and catching errors from code I didn't write. Lesson: bringing a legacy runtime into React means keeping tight control of the lifecycle.
Taking a "WordPress + sales system" brief and distilling what the client actually needed (a catalog + self-editing + closing sales in chat), choosing the stack and cutting unnecessary features. Lesson: my job isn't to follow every word of the request, but to deliver the result it's really asking for with the least complexity.
