← back to Interiordesignershowroom
scripts/seed-guides-2.js
162 lines
// Seeds a second batch of editorial buying guides — the SEO + helpful-content layer
// that gets the site approved by affiliate networks and ranked by Google. Modeled on
// scripts/seed.js: uses lib/db.js and upserts into `guides` with ON CONFLICT (slug) DO UPDATE.
//
// product_ids are resolved from real existing products by external_id (exactly like
// seed.js builds idByExt) — any ref that doesn't resolve is skipped, never a null id.
const db = require('../lib/db');
const HERO = (n) => `https://picsum.photos/seed/ids-g${n}/1200/675`;
const GUIDES = [
{
slug: 'best-sectionals-small-spaces',
title: 'The Best Sectionals for Small Spaces',
dek: 'Apartment-scale sectionals that seat the whole room without swallowing it — how to read the dimensions, why the reversible chaise matters, and the fabric that survives real life.',
hero_image: HERO(1),
room: 'living-room',
style: 'modern',
published: true,
external_refs: ['bur-6018', 'art-6010', 'wf-1001'],
body_md: `## The one number that decides everything
Before you fall for a photo, find the sectional's overall width and depth in the spec sheet. For a small living room — say 11 by 13 feet — a footprint under about 96 inches on the long arm and 60 inches on the return keeps a walkway on every side. The designer rule of thumb: leave at least 30 to 36 inches of clear path between the sofa and any wall, media console, or coffee table so the room reads open rather than crammed.
Depth is the quieter trap. A luxe 44-inch-deep sectional looks incredible in a loft and eats a small room alive. Aim for a seat depth around 22 to 24 inches (39 to 42 inches overall). That is deep enough to lounge, shallow enough to sit up and eat dinner, and it buys back a foot of floor you did not know you had.
## Why a reversible chaise is worth holding out for
In a small space you rarely get to choose your layout once and never move — you rent, you rearrange, you inherit a weird window wall. A **reversible chaise** (the long leg can mount on either the left or right) means one sofa fits three different rooms across three different apartments. Skip the models that lock the chaise to one side; you are paying for a decision you have to make correctly on day one and can never undo.
Modular "sectionals-in-pieces" go one better: they ship as chair-width units you clip together, so you can run them as an L, a straight three-seater, or split them across a room. That flexibility is why we keep coming back to piece-built systems for first apartments.
## Leg height is a visual trick, not a detail
The fastest way to make a big piece of furniture feel light is to get it off the floor. A sectional on **exposed legs of about 5 to 7 inches** lets the eye — and a robot vacuum — travel underneath, so the sofa reads as an object sitting *in* the room instead of a wall built *across* it. Skirted, floor-hugging bases do the opposite: they visually pour concrete. In a small room, that sliver of shadow under the frame is the difference between cozy and cramped.
## Buy the performance fabric — this is not the place to save
A small-space sectional is almost always the *only* seating, which means it absorbs every meal, nap, and spill. Spend here. Look for a **performance weave** — solution-dyed acrylic or a polyester blend rated to 50,000+ double rubs (the abrasion test); anything above 30,000 is contract-grade and will outlast the apartment. Woven performance fabrics clean with water and mild soap and resist fading in a sunny window, where a natural linen would pill and gray within a year.
## How to shop the tiers
**Entry, roughly $1,300 to $1,800:** a compact leather or performance-weave two-piece. Leather is a genuinely smart small-space move — it wipes clean and only looks better as it wears.
**Mid, roughly $1,800 to $2,500:** a modular velvet or boucle system with a reversible chaise and a kiln-dried hardwood frame. This is the sweet spot for most small living rooms.
Measure the doorways and the elevator before you order — the most beautiful sectional in the world is useless on the landing. Below are the pieces our editors would actually live with.`,
},
{
slug: 'how-to-layer-lighting',
title: 'How to Layer Lighting in Any Room',
dek: 'Overhead light alone flattens a room. The ambient-task-accent framework, the three-source rule, and why 2700K on a dimmer is the whole game.',
hero_image: HERO(2),
room: 'lighting',
style: 'modern',
published: true,
external_refs: ['lp-2003', 'B0LAMP003', 'am-5030', 'we-5015'],
body_md: `## The mistake almost every room makes
One ceiling fixture, switched on full, lighting the entire room from a single point overhead. It is the lighting equivalent of a fluorescent office, and it is why so many rooms feel flat no matter how nice the furniture is. A single overhead source casts hard downward shadows, drains color, and gives your eye nothing to travel toward. The fix is not a brighter bulb — it is **more sources, each doing a different job**.
## The three-layer framework designers actually use
Every well-lit room is built from three layers stacked together:
**Ambient** is the general wash that lets you move through the room safely — recessed cans, a flush mount, a central pendant. Think of it as the room's baseline, and keep it low.
**Task** is bright, focused light where you actually do things — a floor lamp reading over a chair, a table lamp beside the bed, an arc lamp arcing over the sofa, under-cabinet strips over a counter. Task light is what makes a room *usable*.
**Accent** is the drama — a picture light, a pair of sconces, a lamp glowing on a console. Accent light has no practical job; it exists to create depth, highlight what you love, and give the eye somewhere to rest.
## The three-source rule
Here is the shortcut that instantly upgrades a room: **put at least three separate light sources in it, and never turn the overhead on by itself.** Three points of light at different heights — floor, table, ceiling — triangulate the space and wrap it in soft, overlapping pools instead of one harsh cone. A living room might be a floor lamp behind the sofa, a table lamp on a side table, and a pair of pendants over the console. That is three sources, three heights, one calm room.
## Color temperature: live at 2700K
Color temperature is measured in Kelvin, and it decides whether a room feels like a boutique hotel or a hospital hallway. For every living space — living room, bedroom, dining — buy bulbs at **2700K**, the warm, slightly golden tone that flatters skin, wood, and paint. Push up to 3000K in a kitchen or bath if you want a crisper feel; never go above 3500K in a room you relax in. And buy every bulb in a room at the *same* temperature — one 4000K bulb in a lamp full of 2700K reads instantly, jarringly wrong.
Also check the **CRI (color rendering index)**: 90+ means colors look true. A cheap bulb with a CRI in the 80s will make your terracotta throw look muddy and your greens look gray.
## Put everything on dimmers
This is the single highest-return move in lighting, and it costs about $20 a switch. **Dimmers** turn one fixture into a full range of moods — bright to cook and clean, dim to eat and unwind. Dimmed to around 30 percent, a warm 2700K bulb glows almost candle-amber, which is exactly the light that makes a room feel expensive at night. Confirm your bulbs are dimmable (most LEDs are, but not all) and pair them with a compatible LED dimmer to avoid flicker or buzz.
## Shop it in order
Start with task lighting — a floor lamp and a pair of table lamps solve 80 percent of a dark room before you touch the ceiling. Add accent last. Below are the fixtures our editors reach for to build each layer.`,
},
{
slug: 'coastal-living-room-budget',
title: "A Coastal Living Room That Doesn't Look Cheap",
dek: 'The line between "elevated coastal" and "beach-house gift shop" is palette discipline and real natural texture. Where to spend, where to save.',
hero_image: HERO(3),
room: 'living-room',
style: 'coastal',
published: true,
external_refs: ['sl-5001', 'lg-6025', 'rg-6001', 'B0RUG0002'],
body_md: `## Coastal goes wrong when it gets literal
The fastest way to make a coastal room look cheap is to say the word "beach" out loud with your decor — anchor pillows, rope-wrapped everything, a sign that reads *Gone Fishin'*. Elevated coastal never announces itself. It suggests the ocean through **light, air, and natural material**, and it earns its calm from restraint, not from souvenirs.
## Palette discipline is the whole trick
Pick a tight, disciplined palette and refuse to break it. The classic elevated-coastal formula is **warm white plus soft greige plus one water tone** — a muted seafoam, a grayed navy, or a pale slate blue — used sparingly as the accent, not the whole room. Roughly a 70/20/10 split: seventy percent neutrals on the big surfaces (walls, sofa, rug), twenty percent a secondary natural tone, ten percent the water accent in pillows and art.
What kills the look is saturation. Bright primary "nautical" red-white-and-blue reads as a theme; a chalky, sun-washed version of the same blue reads as a $10,000 room. When in doubt, desaturate and lighten.
## Natural texture is where the money looks like it went
Coastal is a *texture* style before it is a color style. The richness comes from layering natural materials so the eye has something to read even in an all-neutral room:
**Rattan and cane** on a side chair or a headboard bring the woven, hand-made warmth that defines the look. A single rattan accent chair does more for a coastal room than any amount of blue paint.
**Jute and sisal** underfoot. A natural jute rug is the coastal floor — organic, textural, and cheap for the visual weight it carries. Layer a smaller patterned rug on top if you want softness where you sit.
**Linen** everywhere it touches skin — slipcovered sofas, loose pillow covers, gauzy curtains that move in the window. Linen's slight wrinkle *is* the point; it reads relaxed and lived-in, the opposite of a stiff formal room.
Three natural textures in one room — say rattan, jute, and linen — is what separates "designed" from "matched a set from a catalog."
## Where to spend and where to save
**Spend on the anchor chair and the sofa's fabric.** A well-made rattan or cane accent chair is the piece guests notice and touch; a cheap one shows its glue and its plastic weave immediately. And a real linen or performance-linen slipcover on the sofa is what makes the whole room read soft and expensive — a stiff, shiny upholstery undoes everything.
**Save on the jute rug, the pillow covers, and the vases.** Jute is jute — a budget natural rug looks nearly identical to a premium one because the material does the work. Swap pillow covers seasonally instead of buying new pillows, and use inexpensive matte ceramic vases in oatmeal and sand tones to carry the palette for almost nothing.
**Spend a little on lighting warmth.** Coastal lives on light. Warm 2700K bulbs on dimmers, plus sheer linen curtains that let daylight flood in, do more for the mood than any single furniture purchase.
## The final gut check
Before you buy anything, ask: *does this suggest the coast, or does it announce it?* Keep the palette chalky, layer three real natural textures, spend on the pieces you touch and save on the pieces you don't. Below are the coastal pieces our editors would build the room around.`,
},
];
async function main() {
await db.query('SELECT 1'); // fail fast if DB unreachable
// Resolve real product DB ids by external_id — mirrors seed.js's idByExt approach.
const allRefs = [...new Set(GUIDES.flatMap((g) => g.external_refs || []))];
const idByExt = {};
const { rows } = await db.query('SELECT id, external_id FROM products WHERE external_id = ANY($1)', [allRefs]);
for (const r of rows) idByExt[r.external_id] = r.id;
for (const g of GUIDES) {
const product_ids = (g.external_refs || []).map((e) => idByExt[e]).filter(Boolean);
const missing = (g.external_refs || []).filter((e) => !idByExt[e]);
if (missing.length) console.warn(` ${g.slug}: skipped unresolved refs -> ${missing.join(', ')}`);
await db.query(
`INSERT INTO guides (slug,title,dek,hero_image,body_md,product_ids,room,style,published)
VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9)
ON CONFLICT (slug) DO UPDATE SET title=EXCLUDED.title,dek=EXCLUDED.dek,hero_image=EXCLUDED.hero_image,
body_md=EXCLUDED.body_md,product_ids=EXCLUDED.product_ids,room=EXCLUDED.room,style=EXCLUDED.style,
published=EXCLUDED.published,updated_at=now()`,
[g.slug, g.title, g.dek, g.hero_image, g.body_md, product_ids, g.room, g.style, g.published]);
console.log(` upserted guide ${g.slug} (${product_ids.length} products)`);
}
console.log(`seeded ${GUIDES.length} guides`);
await db.pool.end();
}
main().catch((e) => { console.error(e); process.exit(1); });