diff --git a/.claude/skills/nearlexpress-docs/SKILL.md b/.claude/skills/nearlexpress-docs/SKILL.md index d1abb00..e17855c 100644 --- a/.claude/skills/nearlexpress-docs/SKILL.md +++ b/.claude/skills/nearlexpress-docs/SKILL.md @@ -146,7 +146,7 @@ flowchart TD direction LR Store["Redux: fcm · login · menu · snackbar · toast · auth"]:::state QC["TanStack Query (cache + infinite scroll)"]:::state - Env["REACT_APP_URL · REACT_APP_URL2 · REACT_APP_GOOGLE_MAPS_API_KEY"]:::state + Env["REACT_APP_URL · REACT_APP_URL2"]:::state LS["localStorage: authname · userid · roleid · userfcmtoken · applocations"]:::state end diff --git a/CLAUDE.md b/CLAUDE.md index 021bcad..bf471b2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -24,7 +24,7 @@ For the per-page API map and architectural flow chart, see the project skill **` - **Routing**: `react-router-dom 6.10`, lazy-loaded via `components/Loadable`. - **Forms**: `formik 2.2` + `yup 1.1` where present; new simple forms can use plain `useState`. - **Dates**: `dayjs 1.11` with `utc` plugin (already extended at the top of `deliveries.js`). Use `dayjs(...).utc()` for backend timestamps and bare `dayjs(...)` for local-time bucketing — see the batch-bucketing comment in `deliveries.js` for the rationale. -- **Maps**: `leaflet` + `react-leaflet`, plus `@react-google-maps/api` for Google. Geocoding via `react-geocode`. Maps API key is `process.env.REACT_APP_GOOGLE_MAPS_API_KEY`. +- **Maps**: `leaflet` + `react-leaflet` only. Geocoding/address search via free OSM Nominatim (`src/components/nearle_components/AddressAutocomplete.js`) and routing via OSRM — no API key required. Google Maps (`@react-google-maps/api`, `react-geocode`, `react-google-autocomplete`) has been fully removed; do not reintroduce it. - **Notifications**: `firebase 10.14` (FCM) — see `src/firebase_notification/`. Toasts via `notistack 3`. - **Drag-and-drop**: `react-dnd` (used on the Dispatch Preview page). @@ -53,7 +53,7 @@ npm run lint ``` - **Env files at repo root**: `env.staging` is committed; `.env.development` / `.env.production` are typically gitignored. Pull from a teammate when missing. -- **Required env vars**: `REACT_APP_URL` (primary API base), `REACT_APP_URL2` (secondary API base — used for `/users/update`, `/tenants/update`, `/partners/getriderlogs`, archival `/orders/getorders`), `REACT_APP_GOOGLE_MAPS_API_KEY`. The optimiser URLs (`routes.workolik.com`, `routemate.workolik.com`) and the Jupiter auth URL (`jupiter.nearle.app`) are hardcoded — see the `nearlexpress-docs` skill. +- **Required env vars**: `REACT_APP_URL` (primary API base), `REACT_APP_URL2` (secondary API base — used for `/users/update`, `/tenants/update`, `/partners/getriderlogs`, archival `/orders/getorders`). No Maps API key is needed — maps and address search run on free Leaflet/OSM services. The optimiser URLs (`routes.workolik.com`, `routemate.workolik.com`) and the Jupiter auth URL (`jupiter.nearle.app`) are hardcoded — see the `nearlexpress-docs` skill. - **Dev server runs on `http://localhost:3000`**. The user usually has it running already — assume it is up when reporting "reload to see it". --- @@ -282,7 +282,7 @@ These colour-code lifecycle states. Do **not** swap them for brand purple — op - **The `applocationid` query param**: every list endpoint expects this — `0` means "All Zones". Pages default `appId = 0` and update it from `LocationAutocomplete`. - **`role` gating** uses `localStorage.getItem('roleid')`. Some buttons are conditionally rendered based on it. Do not hide UI based on string equality alone — check existing patterns. - **Skeleton vs Loader vs LoaderWithImage** — these are different. Skeleton = per-row placeholder, Loader = full-screen backdrop blocking interaction, LoaderWithImage = inline branded spinner. Don't swap them. -- **Maps API key** is read from env on every render in some places — wrapping it in a `useMemo` is fine but unnecessary. Don't add new direct `process.env.REACT_APP_GOOGLE_MAPS_API_KEY` reads outside map-related files. +- **No Maps API key exists in this project anymore.** Address search/geocoding goes through `AddressAutocomplete.js` (Nominatim) and routing through OSRM — both free, no key. Do not add `process.env.REACT_APP_GOOGLE_MAPS_API_KEY` or any Google Maps script/dependency back in. - **`Tenants.js` has known dangling references** (`setClientstatus`, `setState`, `setSuburb`, `setTenanatPricing`, ``) inherited from legacy code. They are tolerated. Do **not** "fix" them as a drive-by — they are out of scope and removing them risks breaking the row collapse contents. --- diff --git a/FLOW.md b/FLOW.md index b52ba66..9c4ad5f 100644 --- a/FLOW.md +++ b/FLOW.md @@ -162,7 +162,7 @@ flowchart TD Store["Redux Toolkit store
fcmSlice · loginUserSlice
menu · snackbar · toastSlice · auth"]:::state QC["@tanstack/react-query
QueryClient (cache + infinite scroll)"]:::state AxiosBase["axios (raw) +
utils/axios.js (401 → /login)"]:::state - Env["env vars: REACT_APP_URL ·
REACT_APP_URL2 · REACT_APP_GOOGLE_MAPS_API_KEY"]:::state + Env["env vars: REACT_APP_URL ·
REACT_APP_URL2"]:::state LS["localStorage:
authname · userid · roleid ·
userfcmtoken · applocations"]:::state Toasts["Notistack · OpenToast wrapper"]:::state end diff --git a/README.md b/README.md index 9d5a350..1f25540 100644 --- a/README.md +++ b/README.md @@ -54,11 +54,10 @@ REACT_APP_API_URL=https://mock-data-api-nextjs.vercel.app/ REACT_APP_URL=https://jupiter.nearle.app/live/api/v1 REACT_APP_URL2=https://jupiter.nearle.app/live/api/v2 REACT_APP_URL3=https://jupiter.nearle.app/live/api/v3 - -# API Credentials -REACT_APP_GOOGLE_MAPS_API_KEY=AIzaSyCF... ``` +No Maps API key is required — maps and address search run on free Leaflet/OpenStreetMap (Nominatim + OSRM), not Google Maps. + --- ## 🏃 Getting Started & Local Development diff --git a/package-lock.json b/package-lock.json index d74d137..58ef6bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,12 +18,10 @@ "@mui/lab": "^5.0.0-alpha.127", "@mui/material": "^5.12.1", "@mui/x-date-pickers": "^6.18.2", - "@react-google-maps/api": "^2.20.7", "@reduxjs/toolkit": "^1.9.5", "@svgr/webpack": "^7.0.0", "@tanstack/react-query": "^5.17.9", "antd": "^5.11.5", - "autosuggest-highlight": "^3.3.4", "axios": "^1.3.5", "buffer": "^6.0.3", "chance": "^1.1.11", @@ -50,8 +48,6 @@ "react-dnd": "^16.0.1", "react-dnd-html5-backend": "^16.0.1", "react-dom": "^18.2.0", - "react-geocode": "^0.2.3", - "react-google-autocomplete": "^2.7.3", "react-icons": "^4.12.0", "react-intl": "^6.4.1", "react-leaflet": "^4.2.1", @@ -3556,22 +3552,6 @@ "tslib": "2" } }, - "node_modules/@googlemaps/js-api-loader": { - "version": "1.16.8", - "resolved": "https://registry.npmjs.org/@googlemaps/js-api-loader/-/js-api-loader-1.16.8.tgz", - "integrity": "sha512-CROqqwfKotdO6EBjZO/gQGVTbeDps5V7Mt9+8+5Q+jTg5CRMi3Ii/L9PmV3USROrt2uWxtGzJHORmByxyo9pSQ==", - "license": "Apache-2.0" - }, - "node_modules/@googlemaps/markerclusterer": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/@googlemaps/markerclusterer/-/markerclusterer-2.5.3.tgz", - "integrity": "sha512-x7lX0R5yYOoiNectr10wLgCBasNcXFHiADIBdmn7jQllF2B5ENQw5XtZK+hIw4xnV0Df0xhN4LN98XqA5jaiOw==", - "license": "Apache-2.0", - "dependencies": { - "fast-deep-equal": "^3.1.3", - "supercluster": "^8.0.1" - } - }, "node_modules/@grpc/grpc-js": { "version": "1.9.14", "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.14.tgz", @@ -5102,36 +5082,6 @@ "integrity": "sha512-/RVXdLvJxLg4QKvMoM5WlwNR9ViO9z8B/qPcc+C0Sa/teJY7QG7kJ441DwzOjMYEY7GmU4dj5EcGHIkKZiQZCA==", "license": "MIT" }, - "node_modules/@react-google-maps/api": { - "version": "2.20.7", - "resolved": "https://registry.npmjs.org/@react-google-maps/api/-/api-2.20.7.tgz", - "integrity": "sha512-ys7uri3V6gjhYZUI43srHzSKDC6/jiKTwHNlwXFTvjeaJE3M3OaYBt9FZKvJs8qnOhL6i6nD1BKJoi1KrnkCkg==", - "license": "MIT", - "dependencies": { - "@googlemaps/js-api-loader": "1.16.8", - "@googlemaps/markerclusterer": "2.5.3", - "@react-google-maps/infobox": "2.20.0", - "@react-google-maps/marker-clusterer": "2.20.0", - "@types/google.maps": "3.58.1", - "invariant": "2.2.4" - }, - "peerDependencies": { - "react": "^16.8 || ^17 || ^18 || ^19", - "react-dom": "^16.8 || ^17 || ^18 || ^19" - } - }, - "node_modules/@react-google-maps/infobox": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/@react-google-maps/infobox/-/infobox-2.20.0.tgz", - "integrity": "sha512-03PJHjohhaVLkX6+NHhlr8CIlvUxWaXhryqDjyaZ8iIqqix/nV8GFdz9O3m5OsjtxtNho09F/15j14yV0nuyLQ==", - "license": "MIT" - }, - "node_modules/@react-google-maps/marker-clusterer": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/@react-google-maps/marker-clusterer/-/marker-clusterer-2.20.0.tgz", - "integrity": "sha512-tieX9Va5w1yP88vMgfH1pHTacDQ9TgDTjox3tLlisKDXRQWdjw+QeVVghhf5XqqIxXHgPdcGwBvKY6UP+SIvLw==", - "license": "MIT" - }, "node_modules/@react-leaflet/core": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/@react-leaflet/core/-/core-2.1.0.tgz", @@ -5728,12 +5678,6 @@ "@types/range-parser": "*" } }, - "node_modules/@types/google.maps": { - "version": "3.58.1", - "resolved": "https://registry.npmjs.org/@types/google.maps/-/google.maps-3.58.1.tgz", - "integrity": "sha512-X9QTSvGJ0nCfMzYOnaVs/k6/4L+7F5uCS+4iUmkLEls6J9S/Phv+m/i3mDeyc49ZBgwab3EFO1HEoBY7k98EGQ==", - "license": "MIT" - }, "node_modules/@types/graceful-fs": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", @@ -7035,15 +6979,6 @@ "postcss": "^8.1.0" } }, - "node_modules/autosuggest-highlight": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/autosuggest-highlight/-/autosuggest-highlight-3.3.4.tgz", - "integrity": "sha512-j6RETBD2xYnrVcoV1S5R4t3WxOlWZKyDQjkwnggDPSjF5L4jV98ZltBpvPvbkM1HtoSe5o+bNrTHyjPbieGeYA==", - "license": "MIT", - "dependencies": { - "remove-accents": "^0.4.2" - } - }, "node_modules/available-typed-arrays": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", @@ -12209,15 +12144,6 @@ "tslib": "2" } }, - "node_modules/invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", - "license": "MIT", - "dependencies": { - "loose-envify": "^1.0.0" - } - }, "node_modules/ipaddr.js": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz", @@ -14120,12 +14046,6 @@ "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==", "license": "MIT" }, - "node_modules/kdbush": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-4.0.2.tgz", - "integrity": "sha512-WbCVYJ27Sz8zi9Q7Q0xHC+05iwkm3Znipc2XTlrnJbsHMYktW4hPhXUE8Ys1engBrvffoSCqbil1JQAa7clRpA==", - "license": "ISC" - }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -18108,34 +18028,6 @@ "integrity": "sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw==", "license": "MIT" }, - "node_modules/react-geocode": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/react-geocode/-/react-geocode-0.2.3.tgz", - "integrity": "sha512-sIpbgmn1IUzAxO4haOZ6jeeFnMD8ya9PC38yiNrmJ9vPWbvAO2D/2yfCBzZjGZVUm4PRzKAc0KghXfaEnug0TQ==", - "license": "MIT", - "dependencies": { - "regenerator-runtime": "^0.13.3" - } - }, - "node_modules/react-geocode/node_modules/regenerator-runtime": { - "version": "0.13.11", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", - "license": "MIT" - }, - "node_modules/react-google-autocomplete": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/react-google-autocomplete/-/react-google-autocomplete-2.7.4.tgz", - "integrity": "sha512-BeEk2mjzgJcfiCueuKBofm5+RxHUIr0+POn9Yw8merK4Yd0jcOp9Lk/IGJySbz1GTi2Jqvi7V4dbw/DPLD1HMA==", - "license": "ISC", - "dependencies": { - "lodash.debounce": "^4.0.8", - "prop-types": "^15.5.0" - }, - "peerDependencies": { - "react": ">=16.8.0" - } - }, "node_modules/react-icons": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.12.0.tgz", @@ -19102,12 +18994,6 @@ "node": ">= 0.10" } }, - "node_modules/remove-accents": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/remove-accents/-/remove-accents-0.4.4.tgz", - "integrity": "sha512-EpFcOa/ISetVHEXqu+VwI96KZBmq+a8LJnGkaeFw45epGlxIZz5dhEEnNZMsQXgORu3qaMoLX4qJCzOik6ytAg==", - "license": "MIT" - }, "node_modules/renderkid": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/renderkid/-/renderkid-3.0.0.tgz", @@ -20692,15 +20578,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/supercluster": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-8.0.1.tgz", - "integrity": "sha512-IiOea5kJ9iqzD2t7QJq/cREyLHTtSmUT6gQsweojg9WH2sYJqZK9SswTu6jrscO6D1G5v5vYZ9ru/eq85lXeZQ==", - "license": "ISC", - "dependencies": { - "kdbush": "^4.0.2" - } - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -21417,20 +21294,6 @@ "is-typedarray": "^1.0.0" } }, - "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", - "license": "Apache-2.0", - "peer": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, "node_modules/ua-parser-js": { "version": "1.0.40", "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.40.tgz", diff --git a/public/index.html b/public/index.html index d30ef4c..a9e26c2 100644 --- a/public/index.html +++ b/public/index.html @@ -30,19 +30,9 @@ --> Nearle Console - - - - - - -