Production ready foodflow redesign 598c3#2192
Conversation
Key features implemented: - Removed entire enatega-multivendor-admin directory including all source files, configurations, and assets - Deleted environment configuration files (.env.dev, .env.example, .env.prod, .env.stage) - Removed development tool configurations (.eslintrc.json, .prettierrc, .npmrc, .nvmrc) - Cleaned up documentation files (README.md, LICENSE, CHANGELOG.md) - Removed all Next.js application routes and pages from the admin section - Eliminated Cypress test configurations and fixture files - Removed Firebase integration files and TypeScript configurations The changes completely remove the non-publishable admin dashboard project to resolve the publishability issue, leaving only the root configuration files.
👷 Deploy request for web-loyalty-referral pending review.Visit the deploys page to approve it
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a8c97981a2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| SERVER_URL: 'https://aws-server-v2.enatega.com/graphql', | ||
| SERVER_REST_URL: 'https://aws-server-v2.enatega.com/', | ||
| GRAPHQL_URL: `${BACKEND_URL}/graphql`, | ||
| WS_GRAPHQL_URL: `wss://${BACKEND_URL}/graphql`, |
There was a problem hiding this comment.
Build websocket URL without double protocol
BACKEND_URL already includes https://, so constructing WS_GRAPHQL_URL as wss://${BACKEND_URL}/graphql produces an invalid URL like wss://https://.... This breaks GraphQL websocket connections (subscriptions/live updates) anywhere this env config is used, in both prod and dev branches of this function.
Useful? React with 👍 / 👎.
| api.interceptors.request.use( | ||
| (config) => { | ||
| // Add auth token if available | ||
| const token = localStorage.getItem('token') |
There was a problem hiding this comment.
Use React Native storage API for auth token access
This app is an Expo/React Native client, where localStorage is not available. The request interceptor reads localStorage before every request, so any consumer of authAPI will throw at runtime before the HTTP call is sent. Use @react-native-async-storage/async-storage (already in dependencies) or another platform-safe storage abstraction.
Useful? React with 👍 / 👎.
| }; | ||
| case "PROD": | ||
| return { | ||
| SERVER_URL: process.env.NEXT_PUBLIC_SERVER_URL || "http://localhost:8001/", |
There was a problem hiding this comment.
Keep non-localhost fallback for production API URLs
In the PROD branch, missing NEXT_PUBLIC_SERVER_URL now falls back to http://localhost:8001/. If env vars are absent or misconfigured in deployment, production clients will point at their own machine and all API-dependent flows fail. A production-safe remote fallback (as in the previous config) is needed to avoid hard outage from a single env misconfiguration.
Useful? React with 👍 / 👎.
| }); | ||
| } | ||
|
|
||
| const emailRegex = /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/; |
There was a problem hiding this comment.
Relax email validation to allow modern TLDs
This pattern limits domain suffixes to 2–3 characters (\w{2,3}), which rejects valid addresses such as .info, .online, or many country/brand TLDs. That causes legitimate users to be blocked at OTP request time even though these emails are valid. Prefer relying on isEmail() validation or a less restrictive regex.
Useful? React with 👍 / 👎.
No description provided.