Skip to content

armgit / bygga

Public Imported from GitHub
0

IKEA assembly, step by step: animated, manual-style 3D guides. Scan any paper manual with Together AI.

TypeScript

Tooltips stay on top while pressed; the site lives at usebygga.com

Youssef0bc17da2d370
diff --git a/.env.example b/.env.example
index 2ff06cb..e5c298c 100644
--- a/.env.example
+++ b/.env.example
@@ -15,7 +15,7 @@ TOGETHER_API_KEY=
# TOGETHER_PLAN_MODEL=openai/gpt-oss-120b,zai-org/GLM-5.3-Flash,Qwen/Qwen3.7-Plus
# Optional: the public URL, used for share cards, the sitemap and canonical links.
-# NEXT_PUBLIC_SITE_URL=https://bygga-eta.vercel.app
+# NEXT_PUBLIC_SITE_URL=https://www.usebygga.com
# Optional: bring back the manual scanner at /scan (parked for v2).
# NEXT_PUBLIC_SCAN=1
diff --git a/README.md b/README.md
index 4dd66b4..cec25e1 100644
--- a/README.md
+++ b/README.md
@@ -1,47 +1,40 @@
<p align="center">
- <a href="https://bygga-eta.vercel.app"><img alt="Bygga" src="docs/img/banner.svg"></a>
+ <a href="https://www.usebygga.com"><img alt="Bygga" src="docs/img/banner.svg"></a>
</p>
<h1 align="center">Bygga</h1>
-<p align="center">Type the name or article number on an IKEA box and follow every assembly step in 3D, drawn like the paper manual and read out loud. <a href="https://bygga-eta.vercel.app">bygga-eta.vercel.app</a></p>
+<p align="center">Type the name or article number on an IKEA box and follow every assembly step in 3D, drawn like the paper manual and read out loud. <a href="https://www.usebygga.com">usebygga.com</a></p>
## Tech stack
-- Next.js 16 (App Router, Cache Components) with React 19 and TypeScript, plain CSS with Motion and Lucide icons, no UI kit
-- three.js line-art stage (`src/engine`): ink outlines, fly-in parts, a zoomed callout per fitting, offscreen thumbnails
-- A parametric plan generator (`src/lib/plan`) for 7 furniture types and 74 kinds: 1,171 IKEA products (2,180 sizes, UK and US ranges) drawn offline, with typo-tolerant search and article numbers
-- IKEA's public product listings (`scripts/ikea`): `npm run ikea:fetch` downloads them locally (they are git ignored, see NOTICE), `classify.ts` maps name, type and size to kinds, `npm run ikea:build` writes the catalog rows in `src/data`, and `npm run ikea:check` tests them; every IKEA family name is known, so MARKUS reads as an office chair and never as a typo of MARIUS
-- Manual scanner (`/scan`, parked for v2 and off unless `NEXT_PUBLIC_SCAN=1`): a vision model reads each page, `gpt-oss-120b` lays out the parts in millimetres, and `src/lib/plan/custom.ts` places every dowel, bolt and screw where parts touch
-- Together AI on each visitor's own key (`src/components/KeyModal.tsx` asks for it, about a cent a build): unknown product names (steered by IKEA's own type), photo lookup, and a help chat whose answers come with drawings of the exact panel, fitting or step from the guide (`[part B]` tags, `readAnswer` in `src/components/guide/HelpSheet.tsx`), with model fallback lists in `src/lib/together.ts`
-- A hands-free voice on Together AI (Kokoro, `src/lib/voice/tts.ts`): every catalog line is pre-recorded with `npm run voice` (1,476 clips cover all 2,180 guides) and reads aloud with no key, the rest are recorded live, product names keep phonetic spellings where they help (`npm run voice:names`), and saying "next" turns the page, even while she is talking: the page listens through an echo-cancelled mic, sends each bit of talk to Whisper on Together (`/api/listen`), and sets her own words aside by when she said them (`hearIntent` in `src/lib/voice/commands.ts`), the same in every browser. `npm run voice:check` replays 283 recorded runs through it
-- Workshop (`/builds`): every finished build merged into one scene and rendered at true scale next to a person
-- Share cards drawn by the engine (`scripts/og/render.mjs`, `src/lib/og`), a picture of your finished build to post, an A4 print view, and a service worker so opened guides work with no signal
+- Next.js 16 (App Router, Cache Components), React 19 and TypeScript, plain CSS with Motion, no UI kit
+- A three.js line-art stage (`src/engine`) and a parametric plan generator (`src/lib/plan`) that draw 1,171 IKEA products (2,180 sizes, UK and US ranges) offline, built from IKEA's public listings (`scripts/ikea`)
+- A hands-free voice: 1,476 pre-recorded Kokoro clips that play with no key, and "next" heard through an echo-cancelled mic and Whisper on Together (`/api/listen`, `hearIntent` in `src/lib/voice/commands.ts`)
+- Together AI on each visitor's own key (`src/components/KeyModal.tsx`): drafts for products we don't have, photo lookup, and a help chat that answers with drawings of the exact panel, fitting or step
+- Share cards drawn by the same engine (`scripts/og/render.mjs`), an A4 print view, and a service worker so opened guides work with no signal
+- Checks: `npm run voice:check` replays 283 recorded listening runs, `npm run ikea:check` tests every catalog row
## Cloning & running
1. Clone: `git clone https://github.com/Luffixos/bygga.git && cd bygga && npm install`
-2. Optional key: `cp .env.example .env.local`, then set `TOGETHER_API_KEY`, and paste `bygga-dev-mock-key-000000` into the app's key box: under `npm run dev` it stands for your `.env.local` key (the 2,180 offline guides and the read-aloud voice work without one)
-3. Run: `npm run dev`, open http://localhost:3000 and type `BISSA`
-4. Jump to a step: http://localhost:3000/build/malm-3-drawers?step=12, print one at `/build/malm-3-drawers/print`, or see finished builds at `/builds`
-5. Try the scanner free: run with `NEXT_PUBLIC_SCAN=1`, then on `/scan` paste the same dev key and add any photo (only `npm run dev` accepts it)
-6. Rebuild the catalog from IKEA's listings (only needed when they change): `npm run ikea:fetch && npm run ikea:build && npm run ikea:check`
-7. Before pushing: `npm run lint && npm run build`
+2. Run: `npm run dev`, open http://localhost:3000 and type `BISSA`
+3. Jump to a step: http://localhost:3000/build/malm-3-drawers?step=12, or print the guide at `/build/malm-3-drawers/print`
+4. See every build you've finished, side by side at true scale: http://localhost:3000/builds
+5. Try the AI parts: `cp .env.example .env.local`, set `TOGETHER_API_KEY`, then paste `bygga-dev-mock-key-000000` into the app's key box (only `npm run dev` accepts it, and it stands for your key)
+6. Replay the listening tests after touching the voice: `npm run voice:check`
+7. Rebuild the catalog when IKEA's listings change: `npm run ikea:fetch && npm run ikea:build && npm run ikea:check`
+8. Before pushing: `npm run lint && npm run build`
## Roadmap
-- [x] let people flag a step that doesn't match their box (logged as `[feedback]`)
-- [x] a print view: the whole guide on A4
-- [x] cache AI product reads on the server so the second person to ask gets them instantly
-- [x] every AI feature on the visitor's own Together key, and help answers with pictures of the part
-- [x] teach the generator corner sofas, sliding doors, office chairs, day-beds, kitchen and bathroom cabinets
-- [ ] the last odd shapes `scripts/ikea/skips.ts` lists: three-cornered shelves, corner combinations and PAX widths that don't split into frames
-- [ ] the voice in more languages
-- [ ] test the scanner on a stack of real manuals and bring it back in v2
-- Real IKEA PDFs are not scraped or mirrored on purpose: every guide is generated, and the cover links to the product on ikea.com, where the official manual is.
+- [ ] teach the generator the last odd shapes in `scripts/ikea/skips.ts`: three-cornered shelves, corner combinations, PAX widths that don't split into frames
+- [ ] give the voice more languages than English
+- [ ] test the manual scanner (`NEXT_PUBLIC_SCAN=1`) on a stack of real manuals and bring it back
+- Mirroring IKEA's PDF manuals is skipped on purpose: every guide is generated, and each cover links to the official manual on ikea.com.
## Security
-The site has no Together key of its own in production: every AI call runs on the visitor's key, which stays in their `localStorage`, travels only in an `x-together-key` header, and is never stored or logged. Every `/api/*` route answers only the site's own pages and is rate limited per IP, and the pages send a strict Content Security Policy. Scanned guides and build progress live in the browser too, and a shared scan carries the guide inside its link. What the site keeps and sends where is spelled out on [/privacy](https://bygga-eta.vercel.app/privacy).
+The site has no Together key of its own in production: every AI call runs on the visitor's key, which stays in their `localStorage`, travels only in an `x-together-key` header, and is never stored or logged. Every `/api/*` route answers only the site's own pages and is rate limited per IP, the pages send a strict Content Security Policy, and [/privacy](https://www.usebygga.com/privacy) lists what goes where.
MIT licensed, see [LICENSE](LICENSE). Bygga is not affiliated with IKEA: IKEA and its product names are trademarks of Inter IKEA Systems B.V., and the license grants no rights in them (see [NOTICE](NOTICE)).
diff --git a/src/app/guide.css b/src/app/guide.css
index 40b420d..88de32e 100644
--- a/src/app/guide.css
+++ b/src/app/guide.css
@@ -157,6 +157,10 @@
.pill-btn.float:hover {
box-shadow: 0 0 0 1.5px var(--ink);
}
+/* the tip hangs off its own button, wherever the button sits */
+[data-tip] {
+ position: relative;
+}
[data-tip]::after {
content: attr(data-tip);
position: absolute;
@@ -177,7 +181,8 @@
transform 0.15s var(--ease);
z-index: 30;
}
-[data-tip]:hover::after {
+[data-tip]:hover::after,
+[data-tip]:focus-visible::after {
opacity: 1;
transform: translate(-50%, 0);
transition-delay: 0.35s;
@@ -393,7 +398,14 @@
overflow: hidden;
}
+/*
+ * A pressed button shrinks, and anything scaled gets a layer of its own: its tip
+ * would sink under the drawing and the panel. The bar sits a layer above them,
+ * so its tips stay on top however the buttons move (dialogs sit higher still).
+ */
.topbar {
+ position: relative;
+ z-index: 20;
display: grid;
grid-template-columns: auto minmax(0, 1fr) auto auto;
align-items: center;
@@ -891,13 +903,14 @@
z-index: 5;
white-space: nowrap;
}
+/* above everything else on the drawing (the step number, the voice pill, toasts), so its tips are too */
.stage-ctl {
position: absolute;
left: 14px;
bottom: 14px;
display: flex;
gap: 8px;
- z-index: 3;
+ z-index: 6;
}
.drag-hint,
.sheet-caption {
diff --git a/src/lib/site.ts b/src/lib/site.ts
index 3ca6e82..3a18cff 100644
--- a/src/lib/site.ts
+++ b/src/lib/site.ts
@@ -2,7 +2,7 @@ export const GITHUB_REPO = process.env.NEXT_PUBLIC_GITHUB_REPO ?? "Luffixos/bygg
export const GITHUB_URL = `https://github.com/${GITHUB_REPO}`;
/** Where the site lives, for share cards, the sitemap and absolute links. */
-export const SITE_URL = (process.env.NEXT_PUBLIC_SITE_URL || "https://bygga-eta.vercel.app").replace(/\/$/, "");
+export const SITE_URL = (process.env.NEXT_PUBLIC_SITE_URL || "https://www.usebygga.com").replace(/\/$/, "");
/** The manual scanner (/scan) is parked for a later version: hidden everywhere unless NEXT_PUBLIC_SCAN=1. */
export const SCAN_ENABLED = process.env.NEXT_PUBLIC_SCAN === "1";