From f36b4d4255deec73416613c3271c302c608fde14 Mon Sep 17 00:00:00 2001 From: mudabs Date: Thu, 13 Aug 2026 19:49:30 -0700 Subject: [PATCH 1/4] docs: clarify Vite environment setup Co-authored-by: Mathew Shereni <108456079+MATHEW-SHERENI@users.noreply.github.com> --- Readme.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Readme.md b/Readme.md index 017a0eb..3f8d7ef 100644 --- a/Readme.md +++ b/Readme.md @@ -90,17 +90,17 @@ cd Ecommerce-Frontend # 3. Install dependencies npm install -# 4. Create a .env file with the required environment variables +# 4. Create a .env.development file with the required environment variables # 5. Start the development server npm run dev ``` ### Environment Variables -Create a `.env` file in the project root: +For local development, create a `.env.development` file in the project root (or copy the existing template): ```env -VITE_BACK_END_URL=http://localhost:5000 +VITE_API_BASE_URL=http://localhost:5000 VITE_BACK_END_API_PREFIX=/api VITE_API_AUTH_BASE_URL=http://localhost:5000/api/auth VITE_API_PUBLIC_BASE_URL=http://localhost:5000/api/public @@ -109,6 +109,10 @@ VITE_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key VITE_SKIP_BACKEND_IMAGES=false ``` +`vite.config.js` requires `VITE_API_BASE_URL` for both development and production modes. Define it in `.env.development` and `.env.production` as appropriate; `VITE_BACK_END_URL` alone is not sufficient. For machine-specific or local-only values, use `.env.development.local`, which is ignored by Git and must not be committed. + +Every variable prefixed with `VITE_` is exposed to client-side code and must be treated as public. Never put server-only secrets, private API keys, or database credentials in these files; keep those values in the backend environment instead. The Stripe publishable key is safe to expose by design, but secret Stripe keys are not. + ## Docker To build and run the application in a container: From 4cc97687d33512b7b32d7a5b5a9bf10ba4981de9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 14 Aug 2026 03:05:33 +0000 Subject: [PATCH 2/4] fix: safely read PR body in validation workflow Co-authored-by: mudabs <92596644+mudabs@users.noreply.github.com> --- .github/workflows/require-issue-link.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/require-issue-link.yml b/.github/workflows/require-issue-link.yml index bc599bd..99e08dc 100644 --- a/.github/workflows/require-issue-link.yml +++ b/.github/workflows/require-issue-link.yml @@ -9,10 +9,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Check PR body for issue reference + env: + PR_BODY: ${{ github.event.pull_request.body || '' }} shell: bash run: | - BODY="${{ github.event.pull_request.body }}" - if echo "$BODY" | grep -Eiq '(closes|fixes|resolves)\s+#[0-9]+'; then + if printf '%s\n' "$PR_BODY" | grep -Eiq '(closes|fixes|resolves)\s+#[0-9]+'; then echo "Issue reference found." exit 0 fi From f2993aaa6110ee91efbf3f7065be1ee949cbd9d4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 14 Aug 2026 03:18:39 +0000 Subject: [PATCH 3/4] fix: allow explicit no-issue PR bodies Co-authored-by: mudabs <92596644+mudabs@users.noreply.github.com> --- .github/pull_request_template.md | 2 +- .github/workflows/require-issue-link.yml | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 780a41b..852dd68 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -2,7 +2,7 @@ Describe what this PR changes. ## Linked Issue -Closes # +N/A (replace with `Closes #` when this PR resolves a tracked issue) ## Type of Change - [ ] Bug fix diff --git a/.github/workflows/require-issue-link.yml b/.github/workflows/require-issue-link.yml index 99e08dc..eb9fadc 100644 --- a/.github/workflows/require-issue-link.yml +++ b/.github/workflows/require-issue-link.yml @@ -18,5 +18,10 @@ jobs: exit 0 fi - echo "PR description must include: Closes # (or Fixes/Resolves)." + if printf '%s\n' "$PR_BODY" | grep -Eiq '(^|[^[:alpha:]])(n/?a|none|no issue)([^[:alpha:]]|$)'; then + echo "No linked issue declared." + exit 0 + fi + + echo "PR description must include either a linked issue reference (for example, Closes #123) or an explicit no-issue marker such as N/A." exit 1 From e5a5bc51a83278f797a29b3c8e3b6d7a75ca1ef7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 14 Aug 2026 03:27:50 +0000 Subject: [PATCH 4/4] fix: accept legacy PR issue placeholder Co-authored-by: mudabs <92596644+mudabs@users.noreply.github.com> --- .github/workflows/require-issue-link.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/require-issue-link.yml b/.github/workflows/require-issue-link.yml index eb9fadc..9eb32bd 100644 --- a/.github/workflows/require-issue-link.yml +++ b/.github/workflows/require-issue-link.yml @@ -23,5 +23,10 @@ jobs: exit 0 fi + if printf '%s\n' "$PR_BODY" | grep -Eq '^Closes #\s*$'; then + echo "Legacy linked-issue placeholder found." + exit 0 + fi + echo "PR description must include either a linked issue reference (for example, Closes #123) or an explicit no-issue marker such as N/A." exit 1