Skip to content

Fix: Add Google Maps API key to deployment workflow#13

Merged
unforced merged 1 commit into
mainfrom
fix/google-maps-deployment
Sep 24, 2025
Merged

Fix: Add Google Maps API key to deployment workflow#13
unforced merged 1 commit into
mainfrom
fix/google-maps-deployment

Conversation

@unforced

Copy link
Copy Markdown
Member

Overview

Fixes the Google Maps location autocomplete not working in production.

Problem

  • Google Maps API key was added to GitHub Secrets
  • But the deployment workflow wasn't configured to use it
  • This caused the location autocomplete to show "API key not found" error

Solution

  • Added VITE_GOOGLE_MAPS_API_KEY to the build environment variables in GitHub Actions workflow
  • Now the API key from GitHub Secrets will be included during the build process

Testing

After merging and deployment:

  1. Go to the Events Management page
  2. Try adding a new event
  3. The location field should now have working autocomplete

Prerequisites

Make sure VITE_GOOGLE_MAPS_API_KEY is set in your GitHub repository secrets:

  1. Go to Settings → Secrets and variables → Actions
  2. Verify VITE_GOOGLE_MAPS_API_KEY exists with your new API key

This should fix the location autocomplete in production.

- Include VITE_GOOGLE_MAPS_API_KEY in build environment
- Fixes location autocomplete not working in production
- API key must be set in GitHub Secrets for deployment
@unforced unforced self-assigned this Sep 24, 2025
@claude

claude Bot commented Sep 24, 2025

Copy link
Copy Markdown

Claude finished @unforced's task —— View job


Code Review Complete ✅

I've thoroughly reviewed this PR and the changes look good overall. Here's my detailed feedback:

Todo List:

  • Read the changed deployment workflow file
  • Review repo guidelines in CLAUDE.md
  • Analyze code for security concerns
  • Check for best practices and potential issues
  • Provide comprehensive review feedback

Review Feedback

What's Good

  1. Problem Correctly Identified: The issue is well-documented - the Google Maps API key exists in GitHub Secrets but wasn't being passed to the build process.

  2. Clean Implementation: The solution is minimal and targeted - adding just line 37 in .github/workflows/deploy.yml:

    VITE_GOOGLE_MAPS_API_KEY: ${{ secrets.VITE_GOOGLE_MAPS_API_KEY }}
  3. Consistent Pattern: This follows the same pattern already established for Supabase environment variables (lines 35-36).

  4. Proper Documentation: The .env.example file already documents this variable with helpful comments about enabling Places API.

  5. Graceful Degradation: The LocationAutocomplete.tsx component handles missing API keys gracefully with console warnings and fallback behavior.

🔍 Security Analysis

  • ✅ No Security Issues: The change properly uses GitHub Secrets instead of hardcoding values
  • ✅ Follows Best Practices: Aligns with the repo's security guidelines in CLAUDE.md (lines 142-148)
  • ✅ No Exposure Risk: Environment variables are handled securely through GitHub Actions

📋 Code Quality & Best Practices

  • ✅ Follows Established Patterns: Consistent with existing environment variable handling
  • ✅ Minimal Change: Only adds what's necessary without unnecessary modifications
  • ✅ Clear Intent: The change directly addresses the stated problem

🧪 Testing Considerations

Note: This change doesn't include automated tests, but that's appropriate since:

  • It's a deployment configuration change, not application logic
  • The existing LocationAutocomplete.tsx component already has proper error handling
  • Manual testing steps are clearly documented in the PR description

💡 Minor Suggestions

  1. Documentation Update: Consider updating CLAUDE.md lines 175-177 to mention the Google Maps API key requirement alongside Supabase keys:

    2. **Required Setup**: Configure GitHub Secrets for `VITE_SUPABASE_URL`, `VITE_SUPABASE_ANON_KEY`, and `VITE_GOOGLE_MAPS_API_KEY`
  2. Deployment Verification: After merging, verify the secret is correctly set in the repository settings as mentioned in the prerequisites.

Overall Assessment

✅ APPROVED - This is a well-executed fix that:

  • Solves the specific problem with minimal, targeted changes
  • Follows security best practices and established patterns
  • Includes proper documentation and prerequisites
  • Has appropriate error handling in the consuming code

The change is production-ready and should resolve the Google Maps location autocomplete issue in production.


@unforced unforced merged commit bf0de03 into main Sep 24, 2025
1 check passed
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