Conversation
|
@T4RuN05 is attempting to deploy a commit to the shreevathsa05's projects team on Vercel, but is not a member of this team. To resolve this issue, you can:
To read more about collaboration on Vercel, click here. |
There was a problem hiding this comment.
Pull request overview
This PR migrates OTP-based survey participant verification away from Firebase to Twilio Verify, and refreshes the citizen UI (including pre-generated question audio playback with a visual “glow” indicator).
Changes:
- Replace Firebase phone auth with Twilio Verify (backend) and update the citizen auth flow accordingly.
- Add pre-generated audio playback for survey questions (via
/speech/audio/...) and new UI styling for survey/home pages. - Update citizen theme colors and add CSS for an audio visualizer glow effect.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/citizen/vite.config.js | Adds dev server port and proxy for /speech audio endpoints. |
| frontend/citizen/src/pages/SurveyPage.jsx | Implements pre-generated audio playback and survey UI refinements. |
| frontend/citizen/src/pages/Home.jsx | Updates active survey filtering and card UI. |
| frontend/citizen/src/index.css | Switches to a light theme and adds audio glow CSS/animation. |
| frontend/citizen/src/config/firebase.js | Removes Firebase client auth config. |
| frontend/citizen/src/components/survey/DynamicField.jsx | Updates form control styling to match new UI. |
| frontend/citizen/src/components/survey/AuthModal.jsx | Updates OTP flow to use backend/Twilio and adds dev-only bypass UI. |
| frontend/citizen/src/components/navigation/Navbar.jsx | Adjusts navbar styling for new theme. |
| frontend/citizen/package.json | Removes Firebase dependency and adds lucide-react. |
| frontend/citizen/package-lock.json | Updates lockfile for dependency changes. |
| backend/main2/src/controllers/authController.js | Migrates OTP send/verify from Firebase to Twilio Verify. |
| backend/main2/src/config/twilio.js | Adds Twilio client initialization from env vars. |
| backend/main2/src/config/firebase.js | Removes Firebase Admin initialization. |
| backend/main2/package.json | Removes firebase-admin and adds twilio. |
Files not reviewed (1)
- frontend/citizen/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
frontend/citizen/src/pages/SurveyPage.jsx:7
AuthModalnow uses pre-generated audio playback, butspeakis still imported and unused in this file, which can fail lint/builds that treat unused imports as errors.
import { useEffect, useState, useRef } from "react";
import { useNavigate, useParams } from "react-router-dom";
import { Volume2 } from "lucide-react";
import DynamicField from "../components/survey/DynamicField";
import { shouldShowField } from "../utils/ConditionEvaluator";
import { BASE_URL, START_TIME } from "../constants";
import { speak } from "../utils/textToSpeech";
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+88
to
+93
| const cleanupAudio = () => { | ||
| if (reqAnimRef.current) cancelAnimationFrame(reqAnimRef.current); | ||
| if (activeQuestionRef.current) { | ||
| activeQuestionRef.current.style.setProperty('--audio-intensity', '0'); | ||
| } | ||
| }; |
Comment on lines
1
to
4
| import { useNavigate } from "react-router-dom"; | ||
| import { useEffect, useState } from "react"; | ||
| import { Globe, Volume2 } from "lucide-react"; | ||
| import { BASE_URL } from "../constants"; |
Comment on lines
+28
to
29
| const activeSurveys = surveys.filter((s) => s.status === "active"); | ||
| console.log(activeSurveys); |
Comment on lines
+194
to
+199
| // Trigger Twilio OTP | ||
| const twilioServiceSid = process.env.TWILIO_VERIFY_SERVICE_SID; | ||
| if (twilioClient && twilioServiceSid) { | ||
| try { | ||
| await twilioClient.verify.v2.services(twilioServiceSid) | ||
| .verifications.create({ to: `+91${phoneToVerify}`, channel: 'sms' }); |
Comment on lines
+235
to
+249
| // Verify OTP with Twilio | ||
| const twilioServiceSid = process.env.TWILIO_VERIFY_SERVICE_SID; | ||
| if (twilioClient && twilioServiceSid) { | ||
| try { | ||
| const verificationCheck = await twilioClient.verify.v2.services(twilioServiceSid) | ||
| .verificationChecks.create({ to: `+91${phoneToVerify}`, code: otp }); | ||
|
|
||
| if (verificationCheck.status !== 'approved') { | ||
| throw new ApiError(401, "Invalid OTP code"); | ||
| } | ||
| } catch (err) { | ||
| console.error("Twilio Check Error:", err); | ||
| throw new ApiError(401, "OTP Verification Failed"); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.