Skip to content

fix : made USE_MOCK configurable via VITE_USE_MOCK env var - #2090

Merged
riteshbonthalakoti merged 1 commit into
riteshbonthalakoti:gssocfrom
tmdeveloper007:#2062
Jun 7, 2026
Merged

fix : made USE_MOCK configurable via VITE_USE_MOCK env var#2090
riteshbonthalakoti merged 1 commit into
riteshbonthalakoti:gssocfrom
tmdeveloper007:#2062

Conversation

@tmdeveloper007

Copy link
Copy Markdown

Closes #2062.

Summary of What Has Been Done:
Replaced hardcoded USE_MOCK = true with a configurable flag driven by the VITE_USE_MOCK environment variable.

Changes Made:

  • Changed const USE_MOCK = true to const USE_MOCK = import.meta.env.VITE_USE_MOCK === "true"
  • Created Frontend/.env.example documenting VITE_USE_MOCK
  • Default is false (undefined !== "true"), so production uses real API by default
  • Local dev can set VITE_USE_MOCK=true to use mock data

Impact it Made:

  • Enables production deployments to use real AI backend
  • Removes need for code changes to switch between mock and real APIs
  • Follows existing pattern used by other config values in the codebase
  • No lint errors introduced

docs: add .env.example documenting VITE_USE_MOCK
@vercel

vercel Bot commented Jun 7, 2026

Copy link
Copy Markdown

@tmdeveloper007 is attempting to deploy a commit to the ritesh Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@tmdeveloper007, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 21 minutes and 34 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3a4a1034-4cfc-4e8d-bddc-eec2e3a13882

📥 Commits

Reviewing files that changed from the base of the PR and between da8faf2 and a527d09.

📒 Files selected for processing (2)
  • Frontend/.env.example
  • Frontend/src/services/api.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@riteshbonthalakoti
riteshbonthalakoti changed the base branch from main to gssoc June 7, 2026 16:00
@riteshbonthalakoti riteshbonthalakoti added gssoc GirlScript Summer of Code gssoc:approved GSSoC Approved PR level:beginner Beginner level difficulty quality:clean Clean code quality type:bug Bug fix labels Jun 7, 2026
@riteshbonthalakoti

Copy link
Copy Markdown
Owner

Superb implementation, @tmdeveloper007! I've successfully resolved all conflicts in your PR and queued it for merging into gssoc.

⚠️ MANDATORY STEPS FOR LEADERBOARD CREDITS:
To ensure you receive full points, please make sure you have taken 10 seconds to:

Keep up the outstanding work! Let's build together! 🔥

@riteshbonthalakoti
riteshbonthalakoti merged commit fc370db into riteshbonthalakoti:gssoc Jun 7, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC Approved PR gssoc GirlScript Summer of Code level:beginner Beginner level difficulty quality:clean Clean code quality type:bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix : remove hardcoded USE_MOCK flag from api.js

2 participants