Plant data lives in a live database now โ no code editing needed to add or update it.
Add or update data
Use + Plant on the dashboard to add a new plant.
Use the round + button (bottom right) to log watering, spraying, harvests, pests, or checks.
Use + Task to add a reminder, and tap the โ on a task chip to mark it done โ this removes it from the list for good, there's no undo.
On a plant's page, use Take photo or Upload photo to add pictures โ tap a photo to view it full-size or delete it.
On a plant's page, use + Add under Fertilizer schedule to add or remove products.
On a plant's page, scroll to the bottom and use Delete this plant to remove it entirely โ this also deletes its logs, fertilizers, tasks, and photos, and can't be undone.
The first change you make will ask for the edit PIN โ it's then remembered in this browser, so you won't be asked again unless you clear site data or enter the wrong PIN.
There's currently no way to edit a plant's existing details (name, stage, location, etc.) from the app โ logging a watering/spray does update its "last watered/sprayed" dates automatically, but fields like name or location are set once when you add the plant. To fix a typo, delete the plant and re-add it, or edit the row directly with wrangler d1 execute garden-tracker-db --remote --command="UPDATE plants SET ... WHERE id=...".
Changing the site's design or code
Edit index.html or the files in functions/.
Deploy with wrangler pages deploy . from the project folder.
Cloudflare / wrangler access
The site runs on Cloudflare Pages, D1 (database), and R2 (photo storage). The wrangler CLI is how you deploy and manage those from this PC.
First-time setup on a new machine
Install: npm install -g wrangler
Run wrangler login โ it opens a Cloudflare page in your browser.
Log in and click Allow to authorize wrangler.
Check who's logged in
wrangler whoami โ shows the account email and account name if you're authenticated.
Re-authenticating (token expired)
Cloudflare's OAuth login tokens expire periodically โ if a deploy fails with Authentication error [code: 10000] or Invalid access token [code: 9109], this is why.
Just run wrangler login again, then click Allow on the consent screen. No data is lost โ this only refreshes the CLI's access.
Revoking access
In the Cloudflare dashboard, go to your profile icon (top right) โ API Tokens.
Find the wrangler / Workers CLI entry under active authorizations and revoke it.
This immediately breaks any local wrangler session โ the next command will fail with an auth error.
Re-allowing after a revoke
Same as re-authenticating: run wrangler login and click Allow on the new consent screen.
Changing the edit PIN
wrangler pages secret put SITE_PIN --project-name garden-tracker
Enter the new PIN when prompted. It takes effect on the next deploy.