zitertarwein.nl
TypeScript, React · Cloudflare Worker · live at zitertarwein.nl · MIT, data ODbL · mattijsf/zitertarwein.nl
Type a product and see whether it contains wheat, with a source link. The site is in Dutch. Wheat-free is not the same as gluten-free: rye and barley contain gluten too.
git clone https://github.com/mattijsf/zitertarwein.nl.gitcd zitertarwein.nlpnpm installpnpm dev
Result for sojasaus (soy sauce).
Lookup
Section titled “Lookup”A search tries these in order:
- curated list, ~310 products
- Open Food Facts import, ~4,000 products
- live Open Food Facts search
- Google link
The curated list is src/data/products.ts. Each entry has a status (yes, no or check), an
explanation in Dutch and a source: Voedingscentrum, the Dutch coeliac society or Open Food
Facts. The import, src/data/off-products.json, is generated from Open Food Facts: the most
popular Dutch products with an ingredient list, plus extra products in sauces, soups, biscuits
and sweets. It’s loaded lazily as a separate chunk.
Names are normalized (case, accents, punctuation, spaces) before matching, so “coca cola” finds “Coca-Cola”. Typos match through a bounded edit distance. If nothing matches, the site queries the Open Food Facts API and uses the first result with ingredients. Otherwise it shows a Google link with a prefilled query.
Wheat rules
Section titled “Wheat rules”src/lib/rules.json has the regexes that decide whether an ingredient list contains wheat.
The live search and the Python import both use it.
{ "wheatText": "[\\w-]*(?:tarv?we|wheat|weizen|\\bbl[eé](?![\\wÀ-ÿ])|froment|durum|semol|spelt|khorasan|kamut|seitan|bulgur|couscous)[\\w-]*", "notWheat": "buc[kh]w(?:heat|eizen)[\\w-]*|bl[eé]\\s+noir|sans\\s+bl[eé]|(?:wheat|weizen|tarwe)[ -]?(?:free|frei|vrij)\\b"}Labels in Dutch supermarkets can be in Dutch, English, German or French, hence the four
languages. notWheat is applied first and strips buckwheat, blé noir and “wheat-free”. A
wheat word left in the ingredients or the allergen tags means wheat.
Product data
Section titled “Product data”generate.py builds the import from one or more modules in sources/, each with a
read(path) function. There are two: the Open Food Facts Parquet dump (about 8 GB, queried
with DuckDB) and CSV exports from a supermarket. On duplicate names the first source wins.
python3 generate.py off=food.parquetrefresh-data.sh downloads, imports and commits. It runs monthly from cron, and every commit
on main deploys.
Scanner and product pages
Section titled “Scanner and product pages”The camera button scans a barcode and looks it up on Open Food Facts. The site is a PWA and works offline.
scripts/build-seo.ts generates a static page per product under /p/, an A–Z index and a
sitemap, so a search like “zit er tarwe in hummus” can hit a product page directly.
Checks
Section titled “Checks”pnpm check runs ESLint, Prettier, tsc, the tests and knip (unused files, exports and
dependencies). scripts/check-escape-hatches.ts fails when the number of any types, as
casts or eslint-disable comments goes up. lefthook runs the same checks on pre-push.
No trackers or cookies. Older designs of this site.