Skip to content

fix: clean up deployment artifacts and update deployment docs#12

Merged
support371 merged 4 commits intomainfrom
devin/1774041748-fix-deployment-issues
Mar 21, 2026
Merged

fix: clean up deployment artifacts and update deployment docs#12
support371 merged 4 commits intomainfrom
devin/1774041748-fix-deployment-issues

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented Mar 20, 2026

Summary

Cleans up deployment-related issues left over from a previous Next.js-based setup that no longer applies to this Vite SPA.

Three changes:

  1. Remove stale root-level lib/ and components/ directories — These contained Next.js server-side code (next/headers, next/server, process.env.NEXT_PUBLIC_*) that is completely unused by the Vite app. The actual app imports from src/lib/ and src/components/ via the @ alias. Verified with grep that nothing under src/ imports from these root paths.

  2. Remove .env from git tracking — The .env file (containing Supabase anon key and URL) was committed before .gitignore was set up. Removed from tracking with git rm --cached; the local file is preserved. Environment variables should be configured in Vercel project settings, not checked into the repo.

  3. Rewrite DEPLOYMENT.md — The previous version referenced the wrong project name ("Gem-Assist"), a non-existent TOOLHOUSE_API_KEY, non-existent API routes (/api/health, /api/gem-assist), Next.js conventions, and GitHub OAuth. Updated to accurately document the Vite + React SPA with correct env vars, setup steps, SPA routing notes, and a verification checklist matching the real app routes.

Updates since last revision

Addressed review feedback on DEPLOYMENT.md:

  • Corrected backend dependency claim — Removed the incorrect statement "there are no serverless functions or API routes." The app relies on two Supabase Edge Functions (contact-form and gem-assist). Added a dedicated "Supabase Edge Functions" section documenting each function's trigger, purpose, and required secrets.
  • Fixed env var inconsistency with .env.example — Added VITE_SUPABASE_PROJECT_ID to the env var table and Vercel setup steps (it was in .env.example but missing from the docs). Split env var documentation into Client-side and Server-side subsections, with the server-side section covering Supabase Dashboard secrets (SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY, LOVABLE_API_KEY).
  • Added /settings to post-deploy checklist — Was missing from the Portal (authenticated) verification section.
  • Added Backend verification section — New checklist items for verifying contact-form and gem-assist Edge Functions work post-deploy.

Review & Testing Checklist for Human

  • Verify Supabase Edge Functions documentation is accurate — Confirm contact-form saves to contact_submissions table and gem-assist uses LOVABLE_API_KEY to call ai.gateway.lovable.dev. These were inferred from reading supabase/functions/*/index.ts but not tested end-to-end.
  • Confirm VITE_SUPABASE_PROJECT_ID is actually required — It's in .env.example and supabase/config.toml, but verify it's used at runtime by the frontend. If not needed, it should be removed from .env.example instead.
  • Verify CI/CD doesn't depend on .env being in the repo — Confirm env vars are set in Vercel project settings, not read from the committed file.
  • Confirm nothing references root lib/ or components/ — Grep found no imports from src/ into these paths, but verify no external tooling (e.g., Vercel build plugin, shadcn CLI config) depends on them. Note: components.json aliases point to @/components and @/lib which resolve to src/ via Vite, not the deleted root dirs.
  • Review new DEPLOYMENT.md against actual Vercel project config — Confirm the repo name, framework preset, and env var names match the Vercel dashboard.

Recommended test plan: Run a fresh clone → npm install && npm run build → deploy to a preview environment → walk through the post-deploy verification checklist in DEPLOYMENT.md, paying special attention to the contact form submission and GEM AI Assistant chat widget (Edge Function calls).

Notes

  • The Supabase anon key remains in git history. Anon keys are designed to be publicly exposed, so this is not a credential leak, but if you want to be cautious you could rotate it.
  • The deleted lib/supabase/server.ts and lib/supabase/proxy.ts imported from next/headers and next/server — these would have caused build failures if ever accidentally imported into the Vite app.
  • The LOVABLE_API_KEY is a server-side secret managed in the Supabase Dashboard, not in Vercel or the repo. It is only referenced in supabase/functions/gem-assist/index.ts via Deno.env.get().

Link to Devin session: https://app.devin.ai/sessions/ab7713f2cda24e52b2ec959cd95758d7
Requested by: @support371


Open with Devin

devin-ai-integration Bot and others added 3 commits March 20, 2026 21:23
These root-level directories contained Next.js-specific code (process.env.NEXT_PUBLIC_*,
next/headers imports, Next.js middleware patterns) that are not used by this Vite SPA.
The actual app uses src/components/ and src/lib/ via the @ alias.

Co-Authored-By: GEM CYBERSECURITY-MONITORING ASSIST <Analyzer@gemcybersecurityassist.com>
The .env file was committed before the .gitignore rule was in place.
It is already listed in .gitignore but was still tracked.
This removes it from version control while keeping the local file.
Environment variables should be configured in Vercel project settings,
not committed to the repository.

Co-Authored-By: GEM CYBERSECURITY-MONITORING ASSIST <Analyzer@gemcybersecurityassist.com>
The previous DEPLOYMENT.md was a leftover from an earlier Next.js-based setup
and contained incorrect references:
- Wrong project name (Gem-Assist vs gem-enterprise)
- Non-existent TOOLHOUSE_API_KEY env var
- Non-existent /api/health and /api/gem-assist endpoints
- NEXT_PUBLIC_ prefix warnings (irrelevant for Vite)
- GitHub OAuth references (app uses email/password via Supabase)
- Stale post-deploy checklist routes

Updated to reflect the actual Vite + React SPA with correct:
- Environment variables (VITE_SUPABASE_URL, VITE_SUPABASE_PUBLISHABLE_KEY)
- Vercel dashboard and local setup instructions
- SPA routing documentation
- Post-deploy verification checklist matching real app routes
- Security guidance appropriate for Vite client-side builds

Co-Authored-By: GEM CYBERSECURITY-MONITORING ASSIST <Analyzer@gemcybersecurityassist.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

Original prompt from GEM

Check repo and fix any issues with the repository deployment process

You only need to look in the following repo: support371/gem-enterprise

@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@support371 support371 marked this pull request as ready for review March 20, 2026 21:49
Copy link
Copy Markdown
Contributor Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 3 additional findings in Devin Review.

Open in Devin Review

Comment thread DEPLOYMENT.md Outdated
### Portal (authenticated)
- [ ] `/portal/dashboard` loads after login.
- [ ] `/portal/services`, `/portal/community`, `/portal/workspace` are accessible.
- [ ] `/profile`, `/support` pages load correctly.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 DEPLOYMENT.md post-deploy checklist omits /settings route required by CLAUDE.md

CLAUDE.md explicitly lists /settings as part of the portal scope ("Portal scope to keep") and its testing checklist requires verifying "profile/settings/support routes load correctly". The updated DEPLOYMENT.md Post-Deploy Verification Checklist at line 95 only checks /profile and /support but omits /settings (which exists in the app at src/App.tsx:213 as a redirect to /portal/settings). This means the required route verification will be skipped during post-deploy checks.

Suggested change
- [ ] `/profile`, `/support` pages load correctly.
- [ ] `/profile`, `/settings`, `/support` pages load correctly.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0775ebb20f

ℹ️ 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".

Comment thread DEPLOYMENT.md Outdated
## Overview

This guide provides instructions for deploying and managing the Gem-Assist project on Vercel.
This guide provides instructions for deploying and managing the GEM Enterprise authenticated portal on Vercel. This is a **Vite + React SPA** (Single Page Application) — there are no serverless functions or API routes.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Document Supabase edge-function runtime requirements

The new overview states there are "no serverless functions or API routes," but the frontend still depends on Supabase Edge Functions (src/pages/Contact.tsx calls supabase.functions.invoke("contact-form") and src/components/GemAssist.tsx calls /functions/v1/gem-assist). With this wording, operators following this guide can skip provisioning/checking function runtime secrets (for example LOVABLE_API_KEY in supabase/functions/gem-assist/index.ts), which leads to contact/chat features failing after an otherwise successful Vercel deploy.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner

@support371 support371 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup here — removing the stale Next.js-era root lib/ / components/ artifacts and untracking .env both look directionally right.

I do see one blocking documentation inconsistency before merge: DEPLOYMENT.md now says the required Vercel vars are VITE_SUPABASE_URL and VITE_SUPABASE_PUBLISHABLE_KEY, and it also says .env.example documents the required variables. But .env.example still includes VITE_SUPABASE_PROJECT_ID.

Please either remove VITE_SUPABASE_PROJECT_ID from .env.example if it is no longer used, or update the deployment docs to explain why it is still needed. Right now the docs and example env file are out of sync, which creates setup ambiguity.

@support371
Copy link
Copy Markdown
Owner

Thanks for the cleanup work here — the removal of the stale root-level Next.js artifacts and the .env untracking both make sense.

I re-checked the final PR state, and there are still blocking documentation gaps before merge:
1. .env.example is still out of sync with DEPLOYMENT.md. The deployment guide says the required Vercel vars are VITE_SUPABASE_URL and VITE_SUPABASE_PUBLISHABLE_KEY, but .env.example still includes VITE_SUPABASE_PROJECT_ID. Please either remove that variable from .env.example or document why it is still required.
2. DEPLOYMENT.md says this app has “no serverless functions or API routes,” but the frontend still depends on Supabase Edge Functions. src/pages/Contact.tsx invokes contact-form, and src/components/GemAssist.tsx calls the gem-assist function endpoint. As written, the deployment guide can mislead operators into validating only the Vercel deploy while missing required Supabase function/runtime configuration.
3. Minor but worth tightening while you are in the doc: the post-deploy checklist should also cover /settings, since that route exists and redirects into the portal settings flow.

Please align the docs and env example with the actual runtime dependencies, then this should be in much better shape.

…SUPABASE_PROJECT_ID, add /settings to checklist

- Corrected Overview: the app relies on Supabase Edge Functions (contact-form,
  gem-assist), not 'no serverless functions'
- Added 'Supabase Edge Functions' section documenting both functions, their
  triggers, and required secrets (LOVABLE_API_KEY, auto-injected Supabase vars)
- Added VITE_SUPABASE_PROJECT_ID to env var table and Vercel setup steps to
  match .env.example
- Split env var docs into Client-side and Server-side subsections
- Added /settings to Portal post-deploy checklist
- Added Backend (Supabase Edge Functions) verification section to checklist

Co-Authored-By: GEM CYBERSECURITY-MONITORING ASSIST <Analyzer@gemcybersecurityassist.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Mar 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gem-enterprise Ready Ready Preview, Comment, Open in v0 Mar 21, 2026 10:37am
gem-enterprise-kxcy Ready Ready Preview, Comment Mar 21, 2026 10:37am
gem-enterprise-yy99 Ready Ready Preview, Comment Mar 21, 2026 10:37am
support371-gem-enterprise Ready Ready Preview, Comment, Open in v0 Mar 21, 2026 10:37am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant