Skip to content

feat(frontend): add environment-based API configuration (fixes #156) - #349

Open
Diwakar-odds wants to merge 1 commit into
Muskankr:mainfrom
Diwakar-odds:feat/issue-156-env-config
Open

feat(frontend): add environment-based API configuration (fixes #156)#349
Diwakar-odds wants to merge 1 commit into
Muskankr:mainfrom
Diwakar-odds:feat/issue-156-env-config

Conversation

@Diwakar-odds

Copy link
Copy Markdown
Contributor

📝 Description

This PR implements environment-based API configuration (dev/staging/prod) for the frontend application.

Specifically, this PR:

  • Creates a central config.ts file that maps development, staging, and production environments to their respective backend URLs.
  • Updates all frontend components and hooks (useAuth.ts, useCompareVersions.ts, App.tsx, AccountSettingsModal.tsx) to import and use the central BACKEND_URL instead of hardcoding http://127.0.0.1:8000.
  • Allows overriding the configuration using the explicit VITE_BACKEND_URL environment variable if defined.

🔗 Related Issue

Closes #156

✅ Type of Change

  • 🐞 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 📚 Documentation update
  • 💅 UI/UX improvement
  • ♻️ Refactor (no functional change)
  • ⚡ Performance improvement

🧪 How Has This Been Tested?

  • Frontend builds (npm run build) and lints (npm run lint) clean
  • Backend tests pass (python manage.py test analyzer)
  • Manually tested in the browser / API client

📸 Screenshots (if applicable)

📋 Checklist

  • My code follows the project's style and conventions
  • I have linked the related issue above
  • I have read the Code of Conduct

@Diwakar-odds
Diwakar-odds requested a review from Muskankr as a code owner July 23, 2026 17:21
@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

@Diwakar-odds is attempting to deploy a commit to the a2521729-9889's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Diwakar-odds

Copy link
Copy Markdown
Contributor Author

I have completed this task. This PR introduces environment-based API configuration (dev/staging/prod) for the frontend application.

@Muskankr

Copy link
Copy Markdown
Owner

@Diwakar-odds , Please resolve merge conflicts

@Muskankr

Copy link
Copy Markdown
Owner

@Diwakar-odds , Thanks for your contribution! 🎉 If you enjoyed contributing to this project, consider giving the repository a ⭐. It really helps the project grow and motivates future development.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add environment-based API configuration (dev/staging/prod)

2 participants