Halden is a small storefront where every category carries its own attributes. Sneakers have a size and a material, laptops have RAM and a screen size, coffee has an origin and a roast. All of them live in one DocumentsDB collection, and the owner adds a new category by typing new attribute keys into a form.
The app is the companion to the Appwrite blog post on building a product catalog with DocumentsDB.
src/routes: the storefront (/,/c/$category,/p/$slug), the owner sign-in, and the/adminpages.src/lib/catalog.ts: every DocumentsDB call the app makes, plus facet discovery.src/components/ProductForm.tsx: the owner form with the attribute editor.seed/: 30 products across three categories and the script that inserts them.
-
Create an Appwrite project with a DocumentsDB database and a
productscollection. The blog post walks through the indexes, permissions, and the owner label. -
Copy
.env.exampleto.envand fill in the endpoint, project ID, database ID, and an API key with thedatabases.read,collections.read,documents.read, anddocuments.writescopes. The key is used only by the seed script. -
Install and seed:
pnpm install pnpm seed pnpm dev
-
Open http://localhost:4300. Sign in at
/sign-inwith a user that carries theownerlabel to add or edit products.
MIT