Projet

Pot'Coz - a community garden app, paid in seeds

A Facebook post, a zip generated by ChatGPT, a garden that harvests for the food bank. Cloudflare, D1, PWA - twelve days from prototype to the garden's own tool.

The original app was generated with ChatGPT by the association. Everything I added to it, from 11 to 23 November 2026, was done with Claude Code. Code review, updates, deployment, new features: the AI wrote the code. But what we keep, what we refuse, what we ask the association before touching its data, that was me. The rest of the time, they garden.

A post on Facebook: a community garden in Bégard, Brittany, is looking for a volunteer developer. It already has an app, generated with ChatGPT, and no idea how to get it onto the volunteers' phones. Twelve days later, it is live, on the association's own account, with 200 kg of harvests in it. The fee? Seeds.

The context: a post and a vegetable garden

Pot'Coz is a community garden in Bégard. Nothing it grows is sold: everything goes to the food bank. The garden even got its own radio feature in "Le héros de la commune" on ici (formerly France Bleu): "In Bégard, this community garden harvests only for the food bank".

The association had posted on Facebook. It was looking for someone to get a garden tracking app running, built with ChatGPT: plots, tasks, seeds, harvests, recipes for beneficiaries. The tool existed. The last step was missing: installing it on phones, with no App Store, no Play Store, no server to pay for.

I answered. The association wanted to pay me. I asked for seeds. A project that feeds people is not something you invoice in euros.

The starting point: a zip generated by ChatGPT

On 11 November, I receive PotCoz-application-autonome-3.zip: 613 KB, 55 files. A real app, not a mockup:

  • A PWA - a web app you install on the home screen, no store involved.
  • Next.js and React - served by vinext, on Cloudflare Workers.
  • A D1 database - a single generic records table, a single /api/records route.
  • Three profiles - Manager (password), volunteer, beneficiary (who only sees recipes).

ChatGPT had done good work. But a zip from a stranger on Facebook is not something you run blindfolded. Even when it talks about radishes.

First things first: checking the zip

First hour, nothing executed. Read-only:

  • Contents - source code only (TypeScript, CSS, SQL, JSON), 3 PNG images and 4 SVGs. No executables.
  • Dangerous or hidden code - no eval, no command execution, no obfuscation, no invisible characters.
  • External addresses - the Open-Meteo weather API and a link to a gardening site. Nothing else.
  • Dependencies - all from the official npm registry, no install scripts.

Verdict: no sign of malware. However, npm audit reports 34 alerts, 2 of them critical, in next 16.3.4 and react-server-dom-webpack 19.2.6. Pinned updates: next 16.4.6, React 19.2.9. Two criticals, zero left. The four original files I changed are kept aside, in _origine/.

Installing without a store

The app already had an "Install on my phone" button. On Android, it worked. On iPhone, it showed a vague sentence. Apple offers no direct install: you go through Safari's Share button, then "Add to Home Screen".

  • Android - the button triggers the direct install. If the browser does not offer it, a sentence suggests opening the page in Chrome.
  • iPhone and iPad - a link opens a three-step window: Share, Add to Home Screen, Add. Recent iPads, which identify as Macs, are detected.
  • Facebook and Messenger - their in-app browser does not offer installation. The message says so, and points to Safari or Chrome.

That last point is no detail. The app's link was going to circulate... on Facebook. The very place the post came from. 31 checks in emulation (iPhone, iPhone SE, iPad, Android, desktop), on the dev server and on the production build.

Cloudflare: 110,000 iterations too many

Hosting: Cloudflare, free tier. Not out of preference, out of consistency: the app is written for Workers and D1. Moving it elsewhere meant rewriting the data layer.

First test deployment, 12 November. Everything works except the Manager login. Locally, no problem. Online: error. Why? Answer: Cloudflare caps PBKDF2 at 100,000 iterations, the code asked for 210,000.

// lib/admin-auth.ts
crypto.subtle.deriveBits(
  { name:'PBKDF2', salt, iterations:100000, hash:'SHA-256' },
  key, 256
);

The kind of limit no language model sees, because it only exists in production. The risk was noted on day one, with a plan B. Fix, password re-hashed, redeploy: sorted the same morning.

The association's account, not mine

The test ran on my Cloudflare account. A bad idea in the long run: if I disappear, the association loses its tool. On 15 November, the association creates its own account and invites me.

  1. Full backup of the test database (19 plots, 2 log entries).
  2. The association's account ID written into wrangler.jsonc: no accidental deploy to another account.
  3. New D1 database, backup imported as is, same figures as before.
  4. Deployment, checked while logged in as Manager.

The app now lives with the people who use it. I am a guest.

It was not a bug

First feedback: "we can't add tasks, seeds or crops to the plan". Diagnosis: the app, as ChatGPT designed it, reserves those actions for the Manager. The association was testing as a volunteer. The buttons were there, one profile up.

Not one line of code. A message. Half of debugging is knowing who is looking at the screen.

Harvests: 105 entries, four ways to write a weight

After a first trial in the garden, the request is simple: entering data should take ten seconds, hands full of soil. On 19 November:

  • Tasks - the plot becomes optional, "Whole garden" by default.
  • Harvests - a dedicated tab replaces the log: vegetable, weight, date. The running total updates as you type.
  • Home - the main button shows "Harvests: X kg" and opens the form.

Then the surprise: 105 harvests already entered on 17 November, as free text. "1,870kg". "0,725g". "5, 410kg". "4 piĂšces". Four syntaxes for one field. I could have enforced a format and rewritten the existing data. I did the opposite: read what people typed, without touching what they typed.

function normalizeWeight(value) {
  const piecesMatch = /^\s*(\d{1,4})\s*pi[eĂš]ces?\s*$/i.exec(value || '');
  if (piecesMatch) {
    const n = Number(piecesMatch[1]);
    return n > 0 ? `${n} piĂšce${n > 1 ? 's' : ''}` : null;
  }
  const normalized = (value || '').trim().replace(',', '.');
  if (!/^\d{1,4}(\.\d{1,3})?$/.test(normalized) || Number(normalized) <= 0) return null;
  return String(Number(normalized));
}

const PIECE_KG = [
  [/salade|laitue/, 0.4], [/poivron/, 0.15], [/radis noir/, 0.3],
  [/artichaut/, 0.3], [/chou rouge/, 0.6]
];

Lettuces, peppers and black radishes are never weighed. Rather than guess, I asked in the tracking document. The association answered: lettuce 400 g, pepper 150 g, black radish 300 g, then artichoke 300 g and red cabbage 600 g. The weight is computed at display time, storage does not change: old entries are recounted on their own.

StepTotal shownWhat changed
19 November130.455 kg + 180 piecesTolerant reading of free text
20 November196.155 kgAverage weights for lettuce, pepper, black radish
22 November200.955 kgArtichoke and red cabbage, no unweighted piece left

The same 105 harvests, from start to finish. Only the reading changed.

Areas: plots, fruit trees, greenhouses

On 20 November, three requests arrive: add, delete and rename plots; track fruit trees; manage a greenhouse with its own planting plan. Three requests, three screens to build? No. A single notion: the area.

  • Two kinds of areas - "Growing plots" or "Fruit trees". A greenhouse is just another plot area.
  • Sections per area - 0 to 4 free names. The vegetable garden keeps its own: PĂąture, Milieu, Route.
  • One tree per card - name, variety, planting year, notes. Follow-up goes through the tasks attached to the tree.
  • No schema change - the records table takes two new types, area and tree.

Migrating without losing anything

Existing data goes through a migration, areas-v1: 9 statements run once, on first load. It creates the vegetable garden area, attaches the 19 plots to it, converts old locations (P01-PAT becomes plot-01/1) and sets a marker so it never runs again.

Before going live, a full acceptance run on a fresh copy of production: 105 harvests before, 105 after, identical list row by row. Then, on 23 November, a production backup, the deploy, and the same check online.

The defect the review caught

Crops are linked to a section's position, not its name. Deleting "Milieu" and keeping "PĂąture, Route" would have silently moved the middle crops to the road side. No test caught it: you had to reread thinking like a gardener in a hurry. The server now refuses that change (HTTP 409) while the section is in use. Renaming is still allowed.

In total: 14 unit tests, 29 API tests, a full run in a browser at 1,280 and 390 pixels wide.

Working remotely with a volunteer

Bégard is far away. The garden keeps its hours, I keep mine. Three tools were enough:

  • A shared Google Doc - at the top, a box I keep up to date: what is done, what is live, the questions to settle. Below, the association writes its feedback, dated.
  • A dated log - JOURNAL.md records every intervention, its reason and its result. Anyone can pick up after me.
  • Backups before every switch - a database export before every migration, and a rollback procedure written before it was needed.

One rule held from start to finish: no association data is changed without its written answer. Two log notes waited for a second answer before being deleted: one of the two notes named was the wrong one.

Project structure

PotCoz/
├── app/
│   ├── garden-app.tsx       ← the app (Manager, volunteer)
│   ├── garden-plan.tsx      ← "Garden plan" tab (added)
│   ├── install-app.tsx      ← Android button, iPhone help (rewritten)
│   └── api/records/route.ts ← single API, validation, migrations
├── lib/
│   ├── garden-structure.mjs ← pure rules: sections, locations
│   └── areas-migration.mjs  ← areas-v1 migration (9 statements)
├── tests/unit/  tests/api/  ← 14 + 29 tests
├── _origine/                ← zip files before any change
├── _sauvegardes/            ← database exports before each switch
├── JOURNAL.md               ← every intervention, dated
└── DEPLOIEMENT.md           ← deployment and rollback

Tech stack

LayerChoiceWhy
InterfaceNext.js 16.4.6 (via vinext, Vite 8), React 19Inherited from the zip, updated
HostingCloudflare WorkersPlanned by the original code
DataCloudflare D1, a single records tableNo schema change in twelve days
InstallPWA, home screenNo App Store, no Play Store
AccessManager by password (PBKDF2), volunteer, beneficiaryPermissions checked server side
Cost0 euros a month, paid in seedsCloudflare free tier

What I learned

  • A generated app is not a delivered app. ChatGPT had covered most of the way. What was left (security, hosting, real data) decides whether the tool is ever used.
  • Production has its own rules. Cloudflare's PBKDF2 limit shows up nowhere locally. A plan B written in advance is cheaper than an evening of panic.
  • You read people's data, you don't correct it. 105 free-text harvests stayed as they were; the code adapted.
  • One notion beats three screens. Plots, trees and greenhouses all fit in the single word "area".
  • It's not magic. The AI wrote fast. The defect caught in review, the question about average weights, the account in the association's name: someone had to think of those.

See the app

The garden's app, live on the association's account. Installable on Android and iPhone.

potcoz-autonome.potcoz.workers.dev

Listen to the feature

"Le héros de la commune" on ici: the Bégard community garden that harvests only for the food bank.

Listen on radiofrance.fr