No description
  • JavaScript 75.7%
  • CSS 21.7%
  • HTML 2.6%
Find a file
2026-09-20 22:50:47 +08:00
functions/api add /grocery, /grocery/add-items, and /grocery/stats routes and pages 2026-05-12 20:49:50 +08:00
public build 2026-09-20 22:03:54 +08:00
scratch added light mode still not scrollable 2026-09-20 21:24:55 +08:00
scripts fixed admin 2026-09-19 23:02:24 +08:00
src fixed ui 2026-09-20 22:50:47 +08:00
web-art fixed message area 2026-03-09 20:57:01 +08:00
.env.example add /grocery, /grocery/add-items, and /grocery/stats routes and pages 2026-05-12 20:49:50 +08:00
.gitignore fixed hidden 2026-09-20 22:02:28 +08:00
package-lock.json fixed payment alignment 2026-09-20 22:25:13 +08:00
package.json fixed payment alignment 2026-09-20 22:25:13 +08:00
pages-worker.js add /grocery, /grocery/add-items, and /grocery/stats routes and pages 2026-05-12 20:49:50 +08:00
preview-server.js fix building 2026-03-10 00:01:06 +08:00
README.md added grocery 2026-07-05 11:19:45 +08:00
traffic_by_country.json added dev vars and total site visits 30 days 2026-03-08 14:18:08 +08:00
traffic_totals.json added dev vars and total site visits 30 days 2026-03-08 14:18:08 +08:00

web-art

Grocery Feature

This project now includes:

  • /grocery: searchable grocery list with fuzzy live search and cart
  • /grocery/add-items: form to add item name, quantity, price, and image URL

Search updates as you type with lightweight fuzzy matching (exact, prefix, contains, and near-complete subsequence matching).

Storage Mode

The grocery feature supports two storage modes:

  • Firebase Firestore (recommended)
  • Local storage fallback (automatic when Firebase env vars are missing)

Firebase Setup (Free Tier)

  1. Create a Firebase project on the Spark (free) plan.
  2. Enable Firestore Database in production or test mode.
  3. In Firebase project settings, copy your web app config values.
  4. Add the values to .env (see .env.example).

Required env vars:

  • REACT_APP_FIREBASE_API_KEY
  • REACT_APP_FIREBASE_AUTH_DOMAIN
  • REACT_APP_FIREBASE_PROJECT_ID
  • REACT_APP_FIREBASE_STORAGE_BUCKET
  • REACT_APP_FIREBASE_MESSAGING_SENDER_ID
  • REACT_APP_FIREBASE_APP_ID

If these are not set, the app still works and saves items in browser local storage.

Firestore Rules (Simple Starter)

Use stricter rules for production, but this rule works for quick setup:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /groceryItems/{docId} {
      allow read, write: if request.auth != null
        && request.auth.token.email in [
          "k.lavarias.psa@gmail.com",
          "israeldarrel01@gmail.com"
        ];
    }
    match /userCarts/{userId} {
      allow read, write: if request.auth.uid == userId;
    }
    match /groceryUsageHourly/{document=**} {
      allow read, write: if request.auth != null;
    }
    match /budgetProfiles/{docId} {
      allow read, write: if request.auth != null
        && request.auth.token.email in [
          "k.lavarias.psa@gmail.com",
          "israeldarrel01@gmail.com"
        ];
    }
  }
}

Commands

  • npm start - start dev server
  • npm run build - create production build (configured to output to dist)
  • npm test - run tests