mirror of
https://github.com/drlshx/web-art.git
synced 2026-10-11 00:49:44 +08:00
No description
- JavaScript 75.7%
- CSS 21.7%
- HTML 2.6%
| functions/api | ||
| public | ||
| scratch | ||
| scripts | ||
| src | ||
| web-art | ||
| .env.example | ||
| .gitignore | ||
| package-lock.json | ||
| package.json | ||
| pages-worker.js | ||
| preview-server.js | ||
| README.md | ||
| traffic_by_country.json | ||
| traffic_totals.json | ||
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)
- Create a Firebase project on the Spark (free) plan.
- Enable Firestore Database in production or test mode.
- In Firebase project settings, copy your web app config values.
- Add the values to
.env(see.env.example).
Required env vars:
REACT_APP_FIREBASE_API_KEYREACT_APP_FIREBASE_AUTH_DOMAINREACT_APP_FIREBASE_PROJECT_IDREACT_APP_FIREBASE_STORAGE_BUCKETREACT_APP_FIREBASE_MESSAGING_SENDER_IDREACT_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 servernpm run build- create production build (configured to output todist)npm test- run tests