From 258c2c9ae1d9a3f6bf636f307c40325d831b60ea Mon Sep 17 00:00:00 2001 From: Jaya Siddartha Date: Sun, 24 Aug 2025 04:48:54 +0530 Subject: [PATCH 1/2] improved ui --- core/bot/__pycache__/__init__.cpython-313.pyc | Bin 162 -> 172 bytes core/bot/__pycache__/admin.cpython-313.pyc | Bin 206 -> 216 bytes core/bot/__pycache__/apps.cpython-313.pyc | Bin 520 -> 530 bytes core/bot/__pycache__/models.cpython-313.pyc | Bin 3049 -> 3059 bytes .../__pycache__/0001_initial.cpython-313.pyc | Bin 2803 -> 2813 bytes .../__pycache__/__init__.cpython-313.pyc | Bin 173 -> 183 bytes .../core/__pycache__/__init__.cpython-313.pyc | Bin 163 -> 173 bytes .../core/__pycache__/settings.cpython-313.pyc | Bin 4213 -> 4223 bytes core/core/__pycache__/urls.cpython-313.pyc | Bin 1272 -> 1282 bytes core/core/__pycache__/wsgi.cpython-313.pyc | Bin 644 -> 654 bytes .../__pycache__/__init__.cpython-313.pyc | Bin 168 -> 178 bytes .../__pycache__/admin.cpython-313.pyc | Bin 1138 -> 1148 bytes .../__pycache__/apps.cpython-313.pyc | Bin 538 -> 548 bytes .../__pycache__/models.cpython-313.pyc | Bin 12755 -> 12765 bytes .../__pycache__/permissions.cpython-313.pyc | Bin 1305 -> 1315 bytes .../__pycache__/serializers.cpython-313.pyc | Bin 13803 -> 13817 bytes .../__pycache__/urls.cpython-313.pyc | Bin 2393 -> 2403 bytes .../__pycache__/views.cpython-313.pyc | Bin 29648 -> 29660 bytes .../__pycache__/0001_initial.cpython-313.pyc | Bin 6764 -> 6774 bytes .../0002_customquestion.cpython-313.pyc | Bin 1303 -> 1313 bytes ...ication_attempted_and_more.cpython-313.pyc | Bin 3256 -> 3266 bytes ...ion_current_question_index.cpython-313.pyc | Bin 870 -> 880 bytes ...andardized_resume_and_more.cpython-313.pyc | Bin 1611 -> 1621 bytes ...re_alter_interaction_score.cpython-313.pyc | Bin 1064 -> 1074 bytes .../0007_interaction_feedback.cpython-313.pyc | Bin 843 -> 853 bytes ...08_alter_interaction_score.cpython-313.pyc | Bin 818 -> 828 bytes ...viewsession_score_and_more.cpython-313.pyc | Bin 1109 -> 1119 bytes ...viewsession_final_feedback.cpython-313.pyc | Bin 785 -> 795 bytes ...uestion_interview_and_more.cpython-313.pyc | Bin 1337 -> 1347 bytes ...lter_application_interview.cpython-313.pyc | Bin 1086 -> 1096 bytes ..._interviewsession_end_time.cpython-313.pyc | Bin 844 -> 854 bytes ...er_interviewsession_status.cpython-313.pyc | Bin 1217 -> 1227 bytes ..._alter_customquestion_type.cpython-313.pyc | Bin 928 -> 938 bytes ...lication_feedback_and_more.cpython-313.pyc | Bin 1066 -> 1076 bytes ...tion_shortlisting_decision.cpython-313.pyc | Bin 853 -> 863 bytes ...er_leaderboard_application.cpython-313.pyc | Bin 1090 -> 1100 bytes ...on_leaderboard_application.cpython-313.pyc | Bin 780 -> 790 bytes ...tions_interaction_and_more.cpython-313.pyc | Bin 1368 -> 1378 bytes .../0021_dsainteractions.cpython-313.pyc | Bin 1703 -> 1713 bytes ...r_dsainteractions_question.cpython-313.pyc | Bin 1254 -> 1264 bytes ...tions_interaction_and_more.cpython-313.pyc | Bin 1239 -> 1249 bytes .../__pycache__/__init__.cpython-313.pyc | Bin 179 -> 189 bytes .../__pycache__/__init__.cpython-313.pyc | Bin 171 -> 181 bytes .../__pycache__/admin.cpython-313.pyc | Bin 352 -> 362 bytes .../__pycache__/apps.cpython-313.pyc | Bin 547 -> 557 bytes .../__pycache__/models.cpython-313.pyc | Bin 1274 -> 1284 bytes .../__pycache__/serializers.cpython-313.pyc | Bin 1869 -> 1879 bytes .../__pycache__/urls.cpython-313.pyc | Bin 1106 -> 1116 bytes .../__pycache__/views.cpython-313.pyc | Bin 7643 -> 7653 bytes .../__pycache__/0001_initial.cpython-313.pyc | Bin 6587 -> 6597 bytes .../0002_organization_photo.cpython-313.pyc | Bin 816 -> 826 bytes .../0003_organization_email.cpython-313.pyc | Bin 841 -> 851 bytes ..._application_user_and_more.cpython-313.pyc | Bin 1742 -> 1752 bytes ...005_alter_organization_org.cpython-313.pyc | Bin 1252 -> 1262 bytes .../__pycache__/__init__.cpython-313.pyc | Bin 182 -> 192 bytes .../__pycache__/__init__.cpython-313.pyc | Bin 164 -> 174 bytes core/users/__pycache__/admin.cpython-313.pyc | Bin 344 -> 354 bytes core/users/__pycache__/apps.cpython-313.pyc | Bin 526 -> 536 bytes core/users/__pycache__/models.cpython-313.pyc | Bin 3097 -> 3107 bytes .../__pycache__/serializers.cpython-313.pyc | Bin 3218 -> 3228 bytes core/users/__pycache__/urls.cpython-313.pyc | Bin 2071 -> 2081 bytes core/users/__pycache__/views.cpython-313.pyc | Bin 24052 -> 24062 bytes .../__pycache__/0001_initial.cpython-313.pyc | Bin 1706 -> 1716 bytes .../0002_verificationcode.cpython-313.pyc | Bin 1764 -> 1774 bytes .../__pycache__/__init__.cpython-313.pyc | Bin 175 -> 185 bytes .../__pycache__/BaseAgent.cpython-313.pyc | Bin 2047 -> 2057 bytes .../__pycache__/Evaluator.cpython-313.pyc | Bin 5083 -> 5093 bytes .../FinalEvaluator.cpython-313.pyc | Bin 2356 -> 2366 bytes .../FollowUpdecider.cpython-313.pyc | Bin 9693 -> 9703 bytes .../ResumeExtractor.cpython-313.pyc | Bin 2201 -> 2211 bytes core/utils/__pycache__/config.cpython-313.pyc | Bin 1011 -> 1021 bytes .../utils/__pycache__/prompts.cpython-313.pyc | Bin 18895 -> 18905 bytes .../request_models.cpython-313.pyc | Bin 5208 -> 5218 bytes core/utils/__pycache__/utils.cpython-313.pyc | Bin 1319 -> 1329 bytes src/pages/Login.jsx | 1105 ++++++++++++++-- src/pages/SignUp.jsx | 1123 +++++++++++++++-- 76 files changed, 2027 insertions(+), 201 deletions(-) diff --git a/core/bot/__pycache__/__init__.cpython-313.pyc b/core/bot/__pycache__/__init__.cpython-313.pyc index b80c7da2e15d0acbbd123127fbacddcc8cc90477..68417c8549c1805f6cb47c2936a45e0f3946824e 100644 GIT binary patch delta 88 zcmZ3)xQ3DYGcPX}0}u#1uA0bg?C9-m6%$&VT2vfUoS3OloS2uMnp%>P7~`Lp>QayUl5a+lA4>D7!zEOUy_+t8Izn}lp2$iUlKF1R2Kl_1s@6k delta 78 zcmZ3(xQLPaGcPX}0}v=QuAIniZ0@KZmY-9an_8?Nnpcupl9QUEUkYU?q~+(Nq!uX{ b8tMlZC+8QX>L=xw=ucd&3ji1r8+QNz diff --git a/core/bot/__pycache__/apps.cpython-313.pyc b/core/bot/__pycache__/apps.cpython-313.pyc index 77c992f784dbf98a9fbcb7a565d7e75eb375fde4..83d8d31c92c7cc0bf276158faecce21bfcc36435 100644 GIT binary patch delta 92 zcmeBRnZ&~TnU|M~0SJU0S7l7t$ZN^y=?~6Iz^FR2);Bn5j^ln3tZKT9T0%#cN g7AY7S>IWC(mt>|@>L=$HrRpc;m*{UUVXEf@0BwXE1poj5 diff --git a/core/bot/migrations/__pycache__/0001_initial.cpython-313.pyc b/core/bot/migrations/__pycache__/0001_initial.cpython-313.pyc index 34271880f352a8e288c5c1fd4641f8a8f5114c73..02494c85f389fb57708f9d2637bf1ed3d986ff4a 100644 GIT binary patch delta 104 zcmew?`d5_qGcPX}0}u#1uFCkfk#`2WPn5G&OlWaxQE^OhVx~fIVqSV`YDq?7jDKFL zOHpQ7YK%*2adt_5K}=#wYHns?OmIPdNoHDQOmcovYD`joNlb2LdQoCYW`16A%;x9p GJj?*8!6xzm delta 94 zcmew>`dO6sGcPX}0}v=QuFN>Jk#`2WQ-FS0eokp_YO#K3UP)$2PHKvNDU_j*mYAwl9``ZtiSmqI}bAe8^a-} diff --git a/core/bot/migrations/__pycache__/__init__.cpython-313.pyc b/core/bot/migrations/__pycache__/__init__.cpython-313.pyc index 07023940e7f5ece795f96ba8279db8d027577655..275ed3d938a0746efa912cbdc073a2f2211cf83d 100644 GIT binary patch delta 99 zcmZ3>xSf&vGcPX}0}u#1uA0bg>=Wi}6%$&VT2vfUoS3OloS2uMnp%>P7~`Lp>QayUl5a+lA4>D7!zEOUy_+t8Izn}lp2$iUlNm>nO>Awl9``Z95b;&7XV}~ BBiaA} delta 89 zcmdnaxR#OoGcPX}0}v=QuAIni?Bt^#mY-9an_8?Nnpcupl9QUEUkYU?q~+(Nq!uX{ m8tMlZ$Fc diff --git a/core/core/__pycache__/__init__.cpython-313.pyc b/core/core/__pycache__/__init__.cpython-313.pyc index f6079b87d232a41a20ce586ef6e9a5e4a0389a2c..1ec1f698ab7f9fc4dd569df0c505b831112cc444 100644 GIT binary patch delta 89 zcmZ3?xR#OoGcPX}0}u#1uA0bg?BwHY6%$&VT2vfUoS3OloS2uMnp%>P7~`Lp>QayUl5a+lA4>D7!zEOUy_+t8Izn}lnNmxmgxcj1Hm72 delta 79 zcmZ3>xR{aqGcPX}0}v=QuAIniY~iFImY-9an_8?Nnpcupl9QUEUkYU?q~+(Nq!uX{ X8tMlZP7~`Lp t>QayUl5a+lA4>D7!zEOUy_+t8Izn}lnNm>=kjqd0Ra61A$$M; delta 85 zcmeyb@Ku5DGcPX}0}v=QuFN$lG_NGHBqudRzZA+)NXySj dNi9+^G}I3+$S=uEtJF`BnU|M~0SJU0S7q$o$ZN>r#cN b7AY7S>IWC(mt>|@>L=$Hr9z0w4J=InWQH70 diff --git a/core/core/__pycache__/wsgi.cpython-313.pyc b/core/core/__pycache__/wsgi.cpython-313.pyc index 43e388d7dc68a3c29a8231dee3fb87f915654feb..8bac121de91814b59aeea2cf07a38057c787b388 100644 GIT binary patch delta 93 zcmZo+?PKNr%*)Hg00hF0t1>2TE85^1flTu+tCA&neAKE!GdsE6FU$Nlno&g)$V<@^eyB bixdnE^@9uYOES|c^^^09QX#}-Yo=fTWFH&+ diff --git a/core/interview/__pycache__/__init__.cpython-313.pyc b/core/interview/__pycache__/__init__.cpython-313.pyc index d369bd1ed1b758a3b1fa06bb8ed8d3a1d6e7026f..e41c973fb821abb186e80ad037da6996dc861cbc 100644 GIT binary patch delta 94 zcmZ3%xQUVbGcPX}0}u#1uA0bg>>lWB6%$&VT2vfUoS3OloS2uMnp%>P7~`Lp>QayUl5a+lA4>D7!zEOUy_+t8Izn}lp2$nSCU#(mYG@}GqGA10Iy#mzyJUM delta 84 zcmdnQxPp=UGcPX}0}v=QuAIniZ0oKcmY-9an_8?Nnpcupl9QUEUkYU?q~+(Nq!uX{ h8tMlZrZUe1psgo9M=E< diff --git a/core/interview/__pycache__/admin.cpython-313.pyc b/core/interview/__pycache__/admin.cpython-313.pyc index 3f2f973163013ced7bad75e948dfa4e793483ec7..583411e7e405b313ea065dc8fc53baa46e94a16f 100644 GIT binary patch delta 98 zcmeyw@rQ%=GcPX}0}u#1uF5#Hk=KFQ-Ot%7CbT%Us5quLF;k&9F)uwewIm}k#y>CB zr6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-H6}B!B(c-PhSFCbT%Us5quLF;k&9F)uwewIm}k#y>CB zr6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-H6}B!B(ut ARsaA1 delta 88 zcmZ3&GK+=xGcPX}0}v=QuFROWk=K>c)>%I+Kc_S|wOBtiuOzc1CpAUC6v|LY%g;$k lEmANv)DJGmFUd@+)KAVYO4ZNID@iRX%S#84?pHrHfTC5+MSCUzhlbWJm3S}sy<>#cN m7AY7S>IWC(mt>|@>L=$HrRrzqm82GxWu}(vZ$7{(s{;U1WFJ8Q diff --git a/core/interview/__pycache__/permissions.cpython-313.pyc b/core/interview/__pycache__/permissions.cpython-313.pyc index 9f0e4de420d768d9d3888b543ee3e7c0e44f5105..50955757186ac3c525b36083fe3aa12678a020ff 100644 GIT binary patch delta 99 zcmbQqwU~?dGcPX}0}u#1uFBBb$a{~;J;d26CbT%Us5quLF;k&9F)uwewIm}k#y>CB zr6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-H6}B!B($lG_NGHBqudRzZA+)NXySj zNi9+^G}I3+$S=uEtJF`v7yw5Y2EOENRaUMOG#(jfk4hsg_s9Z@t+cHmRrtSX`c((EPS P%*ZV2CcSxrWTp%N0dzK! diff --git a/core/interview/__pycache__/urls.cpython-313.pyc b/core/interview/__pycache__/urls.cpython-313.pyc index e3cf45534e0fff6ef85a04f1088409408b5a858e..70ff500dae589fcf71b67c29378affca4513d392 100644 GIT binary patch delta 99 zcmca9^jL`ZGcPX}0}u#1uFANvk=KUZ-PhSFCbT%Us5quLF;k&9F)uwewIm}k#y>CB zr6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-H6}B!B(Pk=KUZ)>%I+Kc_S|wOBtiuOzc1CpAUC6v|LY%g;$k mEmANv)DJGmFUd@+)KAVYO4ZNID@iRX%S2OlDq5YEfBcYI)4&Ev%eI zOs|+HH>O%{{$c)MA6$@Ml9^VipPXNms-Kxxl3G-jnOd&Dc^@mM5z`Ci$p^wMH#1p0Wn%L% zWMIf+nLN=#e6m)W@Z{YVx|`js(^(ilPF`nUW5mmFklmHlotNPlkGVSs&v9lJAp1B6 gNaQ##m%AbJadCck9p>X|j3BlStGnUm7>5R905FR@TL1t6 diff --git a/core/interview/migrations/__pycache__/0001_initial.cpython-313.pyc b/core/interview/migrations/__pycache__/0001_initial.cpython-313.pyc index f314aeb0c04a021630312a3461cefe1ff8af7e7d..c1d6ef75d5ffc115069c15f57158e941d5620cda 100644 GIT binary patch delta 111 zcmaE3^38wI{=BGD8~Q* delta 101 zcmexn^2UVkGcPX}0}v=QuFO~~v5{}5kVlw)Sbk1vZfdc9XkJNXNlt2tekqipkd~j5 yl3Ju-Xs91tkYAFSR;izyUzDn!nOBlpRF;`quAiHkUX)mpnV(mzzgbc^mK^{cizGGx diff --git a/core/interview/migrations/__pycache__/0002_customquestion.cpython-313.pyc b/core/interview/migrations/__pycache__/0002_customquestion.cpython-313.pyc index 97a73dbf832fafd79a85437cda0de672055db90d..1e263b99786f3889eb7fad2d6adaec9d0d4ebc7d 100644 GIT binary patch delta 110 zcmbQvwUCSVGcPX}0}u#1uFCknkvESyDBamACbT%Us5quLF;k&9F)uwewIm}k#y>CB zr6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-H6}B!B(H#5B`u_QA; MuQ+D&VdfA<06*I(zyJUM delta 100 zcmZ3;HJyw1GcPX}0}v=QuFQC_kvEUoBUV2wKc_S|wOBtiuOzc1CpAUC6v|LY%g;$k xEmANv)DJGmFUd@+)KAVYO4ZNID@iRX%SkxkHloGcPX}0}v=QuFSCC$Sc6#cN x7AY7S>IWC(mt>|@>L=$HrRrzqm82GxWu}(v=VqoCC6;97=N0R3&gTqf1^|IKBDw$o diff --git a/core/interview/migrations/__pycache__/0004_interviewsession_current_question_index.cpython-313.pyc b/core/interview/migrations/__pycache__/0004_interviewsession_current_question_index.cpython-313.pyc index 344f352fc75d035285781a0853abbcb8615133d6..5ede72635633ef9eff946040a391224efeac3619 100644 GIT binary patch delta 109 zcmaFH_JNJ}GcPX}0}u#1uF5#Dkyni=sKMDPCbT%Us5quLF;k&9F)uwewIm}k#y>CB zr6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-H6}B!B(H#5B`u_QA; LuQ+CMHPdSVFzP8B delta 99 zcmeys_Kc19GcPX}0}v=QuFP1skynk$qf9?6Kc_S|wOBtiuOzc1CpAUC6v|LY%g;$k wEmANv)DJGmFUd@+)KAVYO4ZNID@iRX%SCB zr6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-H6}B!B(H#5B`u_QA; MuQ+CNAIn}w07oY%_W%F@ delta 100 zcmcc0bDD?uGcPX}0}v=QuFNRf$ZN^sQKui4pHrHfTC5+MSCUzhlbWJm3S}sy<>#cN x7AY7S>IWC(mt>|@>L=$HrRrzqm82GxWu}(v=VqoCC6;97=N0R3p24!05dfwvBeMVi diff --git a/core/interview/migrations/__pycache__/0006_alter_application_score_alter_interaction_score.cpython-313.pyc b/core/interview/migrations/__pycache__/0006_alter_application_score_alter_interaction_score.cpython-313.pyc index 410279a3ca2259b7be758ceacf847e52f6fed024..527b8606f1da5230b4b7fdb32aec6c89fb1052a4 100644 GIT binary patch delta 110 zcmZ3%v5ABCGcPX}0}u#1uF6=vk#{3gP=~WsOlWaxQE^OhVx~fIVqSV`YDq?7jDKFL zOHpQ7YK%*2adt_5K}=#wYHns?OmIPdNoHDQOmcovYD{KcNorA9W@>p%Zf1H>Vo7Fx MUUAH3HfAM808KR~{r~^~ delta 100 zcmdnQv4Vs5GcPX}0}v=QuFUA!$h(orqfS38Kc_S|wOBtiuOzc1CpAUC6v|LY%g;$k xEmANv)DJGmFUd@+)KAVYO4ZNID@iRX%SCB zr6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-H6}B!B(H#5B`u_QA; LuQ+CMA=51Y5Em$} delta 99 zcmcc0cAAa%GcPX}0}v=QuFP1skynPvBUwKzKc_S|wOBtiuOzc1CpAUC6v|LY%g;$k wEmANv)DJGmFUd@+)KAVYO4ZNID@iRX%SCB zr6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-H6}B!B(H#5B`u_QA; LuQ+CM7}Fg9=!_^Z delta 99 zcmdnPwuz1RGcPX}0}v=QuFROck(ZIlBTYXnKc_S|wOBtiuOzc1CpAUC6v|LY%g;$k wEmANv)DJGmFUd@+)KAVYO4ZNID@iRX%S)RK(E82`Lf zm!izF)EJl4;_QLk#`4^M~{A3eokp_YO#K3UP)$2PHKvNDU_j*mYp%Zf1H>Vo7Fx LUUAH1E2irJ8?-30 delta 99 zcmbQuHj$0@GcPX}0}v=QuFPoP$orJhqf|dEKc_S|wOBtiuOzc1CpAUC6v|LY%g;$k wEmANv)DJGmFUd@+)KAVYO4ZNID@iRX%S#cN x7AY7S>IWC(mt>|@>L=$HrRrzqm82GxWu}(v=VqoCC6;97=N0R3KEqtj2mpsvBS`=N diff --git a/core/interview/migrations/__pycache__/0012_alter_application_interview.cpython-313.pyc b/core/interview/migrations/__pycache__/0012_alter_application_interview.cpython-313.pyc index 99b63b90ecaf8758133c7d6fc971af091efeca01..b0df1cea545c57c74f0d1fffc9d91e9cbf1146f1 100644 GIT binary patch delta 110 zcmdnTae{;QGcPX}0}u#1uF5dl$a|D2sKnVSCbT%Us5quLF;k&9F)uwewIm}k#y>CB zr6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-H6}B!B(H#5B`u_QA; MuQ+D26tfB=05^0e&j0`b delta 100 zcmX@Xv5$lIGcPX}0}v=QuFR0%$a|E@BTGLlKc_S|wOBtiuOzc1CpAUC6v|LY%g;$k xEmANv)DJGmFUd@+)KAVYO4ZNID@iRX%SCB zr6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-H6}B!B(H#5B`u_QA; LuQ+CM2GbJ&4l^jK delta 99 zcmcb{c7~1jGcPX}0}v=QuFP1vkyn_>BTqjpKc_S|wOBtiuOzc1CpAUC6v|LY%g;$k wEmANv)DJGmFUd@+)KAVYO4ZNID@iRX%S#cN x7AY7S>IWC(mt>|@>L=$HrRrzqm82GxWu}(v=VqoCC6;97=N0R3?qYUi1OR|4BD(+p diff --git a/core/interview/migrations/__pycache__/0015_alter_customquestion_type.cpython-313.pyc b/core/interview/migrations/__pycache__/0015_alter_customquestion_type.cpython-313.pyc index e6ed9508c8a8913ab51c4bc0a8b272dd12243a01..0f46390affb351409b3920773c54343e00f956e4 100644 GIT binary patch delta 110 zcmZ3$zKWgiGcPX}0}u#1uFBwH+Q=8l6jbDF6%$&VT2vfUoS3OloS2uMnp%>P7~`Lp z>QayUl5a+lA4>D7!zEOUy_+t8Izn}lp2$nSCU#(mYG@}lbe}dlvt9P MpI00+c|Frd0LcX?K>z>% delta 100 zcmZ3*zJQ(YGcPX}0}v=QuFUwwxREcC$s$lG_NGHBqudRzZA+)NXySj xNi9+^G}I3+$S=uEtJF`p%Zf1H>Vo7Fx MUUAH3ab{sg08qRr2mk;8 delta 100 zcmdnOv5JHDGcPX}0}v=QuFROYk@pajM~;42eokp_YO#K3UP)$2PHKvNDU_j*mYCB zr6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-H6}B!B(H#5B`u_QA; LuQ+CMHq$Er8SyC5 delta 99 zcmcc5c9o6yGcPX}0}v=QuFP1rkynh#qf9?6Kc_S|wOBtiuOzc1CpAUC6v|LY%g;$k wEmANv)DJGmFUd@+)KAVYO4ZNID@iRX%S@~ diff --git a/core/interview/migrations/__pycache__/0018_alter_leaderboard_application.cpython-313.pyc b/core/interview/migrations/__pycache__/0018_alter_leaderboard_application.cpython-313.pyc index b6d77212bb127ff37f8009fdf0349bd83b0a4e3b..db90cf4412517cd023dd178e7c23f45687fa69e6 100644 GIT binary patch delta 110 zcmX@aafXBUGcPX}0}u#1uFBBc$a|bAsLa_aCbT%Us5quLF;k&9F)uwewIm}k#y>CB zr6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-H6}B!B(H#5B`u_QA; MuQ+D246_;|06Nwu+W-In delta 100 zcmX@ZafpNWGcPX}0}v=QuFR0$$a|d0BS$|hKc_S|wOBtiuOzc1CpAUC6v|LY%g;$k xEmANv)DJGmFUd@+)KAVYO4ZNID@iRX%SCB zr6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-H6}B!B(H#5B`u_QA; LuQ+D1KGR(Q6+$ST delta 99 zcmbQn*2Bj8nU|M~0SFWtS7x+t#cN w7AY7S>IWC(mt>|@>L=$HrRrzqm82GxWu}(v=VqoCC6;97=N0Quwq&{s0D?0kbpQYW diff --git a/core/interview/migrations/__pycache__/0020_alter_followupquestions_interaction_and_more.cpython-313.pyc b/core/interview/migrations/__pycache__/0020_alter_followupquestions_interaction_and_more.cpython-313.pyc index 0035f2ac5212c2b5e05460b3eab70e3ec39feab3..3c8f298ad2bd5888f58f774e54f6feb230a44f0c 100644 GIT binary patch delta 110 zcmcb?^@xl2GcPX}0}u#1uF5dp$lJ~w)aq;%6Iz^FR2);Bn5j^ln3tZKT9T0%#cN x7AY7S>IWC(mt>|@>L=$HrRrzqm82GxWu}(v=VqoCC6;97=N0R3e#TtG2mq>DBgg;% diff --git a/core/interview/migrations/__pycache__/0021_dsainteractions.cpython-313.pyc b/core/interview/migrations/__pycache__/0021_dsainteractions.cpython-313.pyc index bc40419dc974766bb18613fee5bed75a30072240..d93fa40879ab45907959012abaad17f930bd42b0 100644 GIT binary patch delta 111 zcmZ3^yOEdgGcPX}0}u#1uFBwN*~qt=B`Cw$DkiizwWv6zI5AV9I596hHMJxoF~&bH z)ukx2EH%a@wK%&ZzaSCB zr6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-H6}B!B(H#5B`u_QA; MuQ+CN4RaPF0BNl#>Hq)$ delta 100 zcmeys`HYkIGcPX}0}v=QuFTlKkyoABqgg*JKc_S|wOBtiuOzc1CpAUC6v|LY%g;$k xEmANv)DJGmFUd@+)KAVYO4ZNID@iRX%S62ms7lBfJ0r diff --git a/core/interview/migrations/__pycache__/0023_remove_dsainteractions_interaction_and_more.cpython-313.pyc b/core/interview/migrations/__pycache__/0023_remove_dsainteractions_interaction_and_more.cpython-313.pyc index 5d8690202039cf87cf16bfbcc53dd9307dfd3294..f648caa79d67a703d03077066ba8984a950ca348 100644 GIT binary patch delta 110 zcmcc4`H++MGcPX}0}u#1uF5#Sk=KAZsKwbTCbT%Us5quLF;k&9F)uwewIm}k#y>CB zr6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-H6}B!B(H#5B`u_QA; MuQ+CND{~Md09pP7~`Lp>QayUl5a+lA4>D7!zEOUy_+t8Izn}lp2$nSCU#(mYG@}lbe}dlvt9PpI00+ Hu}v2MPar0c delta 95 zcmdnXxS5grGcPX}0}v=QuAIni>=C3NmY-9an_8?Nnpcupl9QUEUkYU?q~+(Nq!uX{ s8tMlZ*r>s7bTWt=I0gbPn@6&0M_RrdH?_b diff --git a/core/organization/__pycache__/__init__.cpython-313.pyc b/core/organization/__pycache__/__init__.cpython-313.pyc index 741a500a0a2840791dc7c140867cd4b32a64d85c..e55fdca9958a5adcb12a5a4cbec3a1eebc7f7a56 100644 GIT binary patch delta 97 zcmZ3@xRsInGcPX}0}u#1uA0bg>=oi{6%$&VT2vfUoS3OloS2uMnp%>P7~`Lp>QayUl5a+lA4>D7!zEOUy_+t8Izn}lp2#?l%ANES(R9lnV%Oku}&8N8wMi> delta 87 zcmdnWxSEmsGcPX}0}v=QuAIni?BJyzmY-9an_8?Nnpcupl9QUEUkYU?q~+(Nq!uX{ k8tMlZ`v^ce>IHou;Q=vF9FFiH2BqK4#KQGm# zD6=dz#wE2lyClCLCNU*7H#0FNxFEkIGp#ZvIlm}1Cch{>F)y8r!+UUSU)tcB(o$ZHATM^%1}tl&q+xw nQZO{s4=%_r$xN%%PtGq&)z2?VPt41#N-W9D&(oi*!RQ14g*hL| diff --git a/core/organization/__pycache__/apps.cpython-313.pyc b/core/organization/__pycache__/apps.cpython-313.pyc index ddb837811be2fdec3f1b810e26345be25a4d4259..899ece90cf816c3d48dc8e718727dfa43c4da071 100644 GIT binary patch delta 101 zcmZ3?vX+JSGcPX}0}u#1uF6=nk=L8iE5O+*CbT%Us5quLF;k&9F)uwewIm}k#y>CB zr6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-H736(Juxq{DzPLpKQCtT490E% DuqGtC delta 91 zcmZ3>vY3VUGcPX}0}v=QuFROTk=L8i!A(CbKc_S|wOBtiuOzc1CpAUC6v|LY%g;$k oEmANv)DJGmFUd@+)KAVYO4ZLVN>9wotV%4&%+J%Gyoj+I08kVk%m4rY diff --git a/core/organization/__pycache__/models.cpython-313.pyc b/core/organization/__pycache__/models.cpython-313.pyc index 995b94d81701603d47f9ab1c0f4a4bed2efbad56..d9e76e671b3619d9007540c2ae3abd4e9205cc23 100644 GIT binary patch delta 102 zcmeyx*}}#9nU|M~0SJU0S7j({h)GOI&CN`V2`CB zr6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-H736(Juxq{DzPLpKQCr8AG19R E00)L7n*aa+ delta 92 zcmcc4cb1R$GcPX}0}v=QuFNpm$a|29wotV%4&%+J%`EWvEg0sxngADRFF diff --git a/core/organization/__pycache__/urls.cpython-313.pyc b/core/organization/__pycache__/urls.cpython-313.pyc index 5662888351b9226ecf546f7ef552c86b807e3115..7be9fc83ddd9218baace851f2530c73d68fa2db2 100644 GIT binary patch delta 101 zcmcb_afgHVGcPX}0}u#1uF445$g9Ha72s?Y6Iz^FR2);Bn5j^ln3tZKT9T0%#cN o7AY7S>IWC(mt>|@>L=$HrRwJwr6=ZPRwb5X=I7~8u4aA+08p$S=l}o! diff --git a/core/organization/__pycache__/views.cpython-313.pyc b/core/organization/__pycache__/views.cpython-313.pyc index aeb73a5592f78f44c85a122c419f1fdf0ec031a8..86d9a714f4bbf2353c1e09f076b4f5feb0aecad9 100644 GIT binary patch delta 102 zcmca@{nVQGGcPX}0}u#1uFA;S$Xm+n73gdg6Iz^FR2);Bn5j^ln3tZKT9T0%#cN p7AY7S>IWC(mt>|@>L=$HrRwJwr6=ZPRwb5X=I7~eKEo_21puBJATR&` diff --git a/core/organization/migrations/__pycache__/0001_initial.cpython-313.pyc b/core/organization/migrations/__pycache__/0001_initial.cpython-313.pyc index 1e5d565a1ff02fa6e3fd1f26434d1ce237b17b37..649d37feafafa05c132a0be61c2c1087fc561e69 100644 GIT binary patch delta 114 zcmdmOeAJllGcPX}0}u#1uFBw%*vO|O6q@X86%$&VT2vfUoS3OloS2uMnp%>P7~`Lp z>QayUl5a+lA4>D7!zEOUy_+t8Izn}lp2#?l%ANES(R9lnV%Pvo0(n& NW);V5t`>4&2LPTuDLeoG delta 104 zcmX?VyxW-XGcPX}0}v=QuFRM!zL8H!$U9O$EI+3-H?>$lG_NGHBqudRzZA+)NXySj yNi9+^G}I3+$S=uEtJF`CB zr6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-H736(Juxq{DzPLpKQAUXGrb7R LDvp_)%X9|-i5)55 delta 102 zcmcc2c9M9wotV%4&%+J%$%}g%>vx@a6mowb~0O^Dzw*UYD diff --git a/core/organization/migrations/__pycache__/0004_remove_application_interview_remove_application_user_and_more.cpython-313.pyc b/core/organization/migrations/__pycache__/0004_remove_application_interview_remove_application_user_and_more.cpython-313.pyc index ca85e796c3f3f904c6ac1f95e3566257f1c0bb92..2e0fef08ff88e44dbc8a7b3e6e93756973459da7 100644 GIT binary patch delta 114 zcmX@ddxMwnGcPX}0}u#1uF7Cy-^drr5<1h_DkiizwWv6zI5AV9I596hHMJxoF~&bH z)ukx2EH%a@wK%&ZzaS_&VDOLag delta 104 zcmcb?dybdyGcPX}0}v=QuFTlWwvjKC#k*fWEI+3-H?>$lG_NGHBqudRzZA+)NXySj yNi9+^G}I3+$S=uEtJF`CB zr6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-H736(Juxq{DzPLpKQAUXGrb7R MDvsGai8+W70MgGX=l}o! delta 103 zcmaFI`Gk}AGcPX}0}v=QuFROck=KgZJ3~J#Kc_S|wOBtiuOzc1CpAUC6v|LY%g;$k xEmANv)DJGmFUd@+)KAVYO4ZLVN>9wotV%4&%+J%$%}g%>vx@aM&tVQ?1OO@{B)tFt diff --git a/core/organization/migrations/__pycache__/__init__.cpython-313.pyc b/core/organization/migrations/__pycache__/__init__.cpython-313.pyc index 06a8fc2d30ef622358f3a556a0b183be0cee3dd4..7a42fd7cf126b4214086e146ae851126fda089f5 100644 GIT binary patch delta 108 zcmdnScz}`nGcPX}0}u#1uA0bg92)Oz6%$&VT2vfUoS3OloS2uMnp%>P7~`Lp>QayUl5a+lA4>D7!zEOUy_+t8Izn}lp2#?l%ANES(R9lnV%Pvo0(n&W);Uw H?9>GS$tWk+ delta 98 zcmX@WxQ&tfGcPX}0}v=QuAIni>>a8fmY-9an_8?Nnpcupl9QUEUkYU?q~+(Nq!uX{ s8tMlZzgGcPX}0}u#1uA0bg?Ck4o6%$&VT2vfUoS3OloS2uMnp%>P7~`Lp>QayUl5a+lA4>D7!zEOUy_+t8Izn}lp0eC);O_T7XT&MAOQdX delta 80 zcmZ3-xP+1WGcPX}0}v=QuAIniZ0W2YmY-9an_8?Nnpcupl9QUEUkYU?q~+(Nq!uX{ d8tMlZrZUd1pxXr8yElp diff --git a/core/users/__pycache__/admin.cpython-313.pyc b/core/users/__pycache__/admin.cpython-313.pyc index 93a1f83eac10bbe658e6a78c56d4c7188f8cf30d..1272e1f005a90f1bc3e87a584503883737f94571 100644 GIT binary patch delta 93 zcmcb?^oWV~GcPX}0}u#1uF7bf$a}%r%h@U>v^ce>IHou;Q=vF9FFiH2BqK4#KQGm# sD6=dz#wE2lyClCLCNU*7H#0FNxFEkIGp#ZvIlm}1rWCAkvKXTi0OWHasQ>@~ delta 83 zcmaFFbc2caGcPX}0}v=QuFR;L$a}%kK|d@%r!+UUSU)tcB(o$ZHATM^%1}tl&q+xw gQZO{s4=%_r$xN%%PtGq&)h{hhEh^TZtib350H9qQy#N3J diff --git a/core/users/__pycache__/apps.cpython-313.pyc b/core/users/__pycache__/apps.cpython-313.pyc index fd9df1b722c938fdd4bbaf2a44df9818aa8b1f54..b3dd8211eea63558b7026d7d3c155a532eb0d8df 100644 GIT binary patch delta 94 zcmeBUnZd&QnU|M~0SJU0S7l7u$ZN~!?CES36Iz^FR2);Bn5j^ln3tZKT9T0%rlGcPX}0}u#1uF5#Ok#`}Jv$wNVOlWaxQE^OhVx~fIVqSV`YDq?7jDKFL uOHpQ7YK%*2adt_5K}=#wYHns?OmIPdNoHDQOmcovYD_6uCB ur6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-HKr7-adQ_l2PXjNZy})o delta 85 zcmbOuIZ2ZDGcPX}0}v=QuFP1qk=KRU(oH`sKc_S|wOBtiuOzc1CpAUC6v|LY%g;$k iEmANv)DJGmFUd@+)KAVYO4TndPAw|d-#mqxgA)LmSR9Q2 diff --git a/core/users/__pycache__/urls.cpython-313.pyc b/core/users/__pycache__/urls.cpython-313.pyc index 2ce51ba0910de2d27c37de6c6c7844c2b405d6e6..672847e49af52954fe2efa6388315b992afde3c6 100644 GIT binary patch delta 95 zcmbO(uuy>aGcPX}0}u#1uF9CXk=KCD+0)r7CbT%Us5quLF;k&9F)uwewIm}k#y>CB ur6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-HKr7-adR2lLPh}1HX+3T delta 85 zcmZ1|FkOK6GcPX}0}v=QuFUAz$ZNo6X|ErapHrHfTC5+MSCUzhlbWJm3S}sy<>#cN i7AY7S>IWC(mt>|@>L=$HrRtX!rxq3KZ*E{)$Or(4pB&2o diff --git a/core/users/__pycache__/views.cpython-313.pyc b/core/users/__pycache__/views.cpython-313.pyc index a33240fbd64d22d41a6b4bc3a2349ad15ee1cf39..93ed0f3d824ee3b3dbe2cb8d8d22214f92462835 100644 GIT binary patch delta 98 zcmeyeoAKXnM!wIyyj%=GAndp*V@do*zVlqpUd~oAp~b01#WBT+nF_^;dFiRCB^ik^ y{&}e`MVV!(F)pda*(Lb}F^MUuxtWPE!3FsxnQ4_V$@xX8F{NOQo5i^A1pxr+k0lxa delta 88 zcmeyjoAJwTM!wIyyj%=GpwPH7!#Q>%-+3-e2mP@8oYLIXV*Sv(lFX8v)D-qcGcPX}0}u#1uFBBZ$UBF{FUHv_CbT%Us5quLF;k&9F)uwewIm}k#y>CB zr6{v3HO3{iIJ+djASN*-H8(RcCb%HKBr~ltCON+-HKr7-F*h^4D6u3nKd(4u^IMj^ Fi~w}UCnf*@ delta 96 zcmdnOyNZ|hGcPX}0}v=QuFT-x$UBF{B}hLkKc_S|wOBtiuOzc1CpAUC6v|LY%g;$k tEmANv)DJGmFUd@+)KAVYO4TndPAw|d&&^CPN-W9D&nwp7{GDYlBLMOZA@cwL diff --git a/core/users/migrations/__pycache__/0002_verificationcode.cpython-313.pyc b/core/users/migrations/__pycache__/0002_verificationcode.cpython-313.pyc index a990fbb0e615891c3dbdc389b69ec0f14a190724..1195a925c100b201b0010b81aedc2354063a36f2 100644 GIT binary patch delta 106 zcmaFD`;M3QGcPX}0}u#1uFCkfk@pshU#hcJOlWaxQE^OhVx~fIVqSV`YDq?7jDKFL zOHpQ7YK%*2adt_5K}=#wYHns?OmIPdNoHDQOmcovYD_6uV{T@8QDRAEeqM3RW^LA; Fi~s<-C+YwI delta 96 zcmaFI`-GSGGcPX}0}v=QuFSZ;k@pshOSFDieokp_YO#K3UP)$2PHKvNDU_j*mY=)r|6%$&VT2vfUoS3OloS2uMnp%>P7~`Lp>QayUl5a+lA4>D7!zEOUy_+t8Izn}lp0eC)|i`_UX)mpnV(l2GqFh*0I|{} A(EtDd delta 91 zcmdnVxSo;wGcPX}0}v=QuAIni?Bb^%mY-9an_8?Nnpcupl9QUEUkYU?q~+(Nq!uX{ o8tMlZ*r>s7bTWt=I0gbPwdeJ08L;Yy8r+H diff --git a/core/utils/__pycache__/BaseAgent.cpython-313.pyc b/core/utils/__pycache__/BaseAgent.cpython-313.pyc index 67e62b8a8a9ad0a0dab491141248d4f82b3631a1..359df91ca2b9c092a2f5b01f1a927fb514afdbce 100644 GIT binary patch delta 96 zcmey*-zmWNnU|M~0SJU0S7nH^Zsbd2arSeziU}=FEh>&FPRvv&PRvVBO)betjPcJ) ybt%d$OO0_!EzT~H^*}Rq|h#3IdaUr>u=u962uGu(;gkC diff --git a/core/utils/__pycache__/Evaluator.cpython-313.pyc b/core/utils/__pycache__/Evaluator.cpython-313.pyc index 40b251cc384a89fe6983e87306ae8bf05a2e2484..3d5e8e22433d5db061022915e50c9695ea16577c 100644 GIT binary patch delta 96 zcmcbu{#2dsGcPX}0}u#1uF6mo*vNN@$=T1@DkiizwWv6zI5AV9I596hHMJxoF~&bH y)ukx2EH%a@wK%&ZzaSazme|}lckG(Sbk1vZfdc9XkJNXNlt2tekqipkd~j5 jl3Ju-Xs91tkYAFSR;izyUzDm}T9TPltiM^A`H%nr2q_*$ diff --git a/core/utils/__pycache__/FinalEvaluator.cpython-313.pyc b/core/utils/__pycache__/FinalEvaluator.cpython-313.pyc index 7be2702581f00a38e5f3fba63c40eff4dfea988f..02b7b0e559f04999d3f7ec70371713fde411f6b8 100644 GIT binary patch delta 96 zcmdlYv`>idGcPX}0}u#1uFBA4+sOBy$vN2BDkiizwWv6zI5AV9I596hHMJxoF~&bH y)ukx2EH%a@wK%&ZzaScclclGASbk1vZfdc9XkJNXNlt2tekqipkd~j5 jl3Ju-Xs91tkYAFSR;izyUzDm}T9TPltiL&c`5h|&`D`9| diff --git a/core/utils/__pycache__/FollowUpdecider.cpython-313.pyc b/core/utils/__pycache__/FollowUpdecider.cpython-313.pyc index cdaa0fa2cc077a03b64309d28d846c1278cb5c4c..2a6ea8ad4da20c4dda857a584f1e9fc3291d33d2 100644 GIT binary patch delta 96 zcmccX{oI@HGcPX}0}u#1uF5!UzLBqy#W}>;DkiizwWv6zI5AV9I596hHMJxoF~&bH y)ukx2EH%a@wK%&ZzaS>u7^f*pHrHfTC5+MSCUzhlbWJm3S}sy<>#cN i7AY7S>IWC(mt>|@>L=$HrRtZKWabp>Z;oL0W(5FdxEs&_ diff --git a/core/utils/__pycache__/config.cpython-313.pyc b/core/utils/__pycache__/config.cpython-313.pyc index 85b0ac426b3a8e2abcb1536ece5a8bb66357ff3c..7806535a7d3c2d1a138245effa63e19a0022eb31 100644 GIT binary patch delta 94 zcmey&{+FHiGcPX}0}u#1uF9Cck#{STv$wNVOlWaxQE^OhVx~fIVqSV`YDq?7jDKFL wOHpQ7YK%*2adt_5K}=#wYHns?OmIPdNoHDQOmcovYD{TKW=?U;I%pUleq0|3FE9j*WX diff --git a/core/utils/__pycache__/prompts.cpython-313.pyc b/core/utils/__pycache__/prompts.cpython-313.pyc index 1556f350c99b3de1cae66547dd1b080c55e02925..cbfd57d454ee4ce59172aea288fb2038342f1fcf 100644 GIT binary patch delta 97 zcmX>$IVB6I%->kxHCkO!L-W^^5 diff --git a/core/utils/__pycache__/utils.cpython-313.pyc b/core/utils/__pycache__/utils.cpython-313.pyc index 3427ff324db1678c6e3511cff80db2ad126d0fda..7ca2d8b17374b49a08676a3286233771f83d9c82 100644 GIT binary patch delta 95 zcmZ3^wULYWGcPX}0}u#1uFA07$ZNys?B#3~6Iz^FR2);Bn5j^ln3tZKT9T0%7XB$pHrHfTC5+MSCUzhlbWJm3S}sy<>#cN i7AY7S>IWC(mt>|@>L=$HrRtZKWabp>Z|-4S$_xN@-W-nr diff --git a/src/pages/Login.jsx b/src/pages/Login.jsx index 4c0ed3cbf..18077790e 100644 --- a/src/pages/Login.jsx +++ b/src/pages/Login.jsx @@ -1,53 +1,277 @@ +// Login.jsx import React, { useState, useEffect } from 'react'; -import Header from '../components/ui/header'; -import Footer from '../components/ui/footer'; -import LoginForm from '../components/forms/LoginForm'; -import ForgotPasswordForm from '../components/forms/ForgotPasswordForm'; -import MessageNotification from '../components/ui/MessageNotification'; -import FormContainer from '../components/ui/FormContainer'; -import { useNavigate } from 'react-router-dom'; +import { Eye, EyeOff, ArrowRight, ArrowLeft, User, Mail, Lock, Check, Shield } from 'lucide-react'; +import { useNavigate, Link } from 'react-router-dom'; import { handleToken } from '../utils/handleToken'; +import MessageNotification from '../components/ui/MessageNotification'; + +const baseUrl = 'http://localhost:8000/api/users/'; + +const OwlMascot = ({ showPassword, isPasswordFocused }) => ( +
+ + + + + + + + + + + + + + + + + + + {!showPassword && isPasswordFocused && ( + <> + + + + )} + {showPassword ? ( + <> + + + + + + ) : isPasswordFocused ? ( + <> + + + + ) : ( + <> + + + + )} + + + + +
+); + + + +const ParticleField = () => { + const [particles, setParticles] = useState([]); + + useEffect(() => { + const newParticles = Array.from({ length: 30 }, (_, i) => ({ + id: i, + x: Math.random() * 100, + y: Math.random() * 100, + size: Math.random() * 3 + 1, + speedX: (Math.random() - 0.5) * 0.3, + speedY: (Math.random() - 0.5) * 0.3, + opacity: Math.random() * 0.3 + 0.1, + })); + setParticles(newParticles); + + const interval = setInterval(() => { + setParticles(prev => prev.map(particle => ({ + ...particle, + x: (particle.x + particle.speedX + 100) % 100, + y: (particle.y + particle.speedY + 100) % 100, + }))); + }, 100); + + return () => clearInterval(interval); + }, []); + return ( +
+ {particles.map(particle => ( +
+ ))} +
+ ); +}; -const baseUrl = import.meta.env.VITE_API_URL; -console.log(baseUrl); +const FloatingShape = ({ delay = 0, shape = 'circle', size = 'w-8 h-8', position = 'top-1/4 left-1/4' }) => { + const shapeStyles = { + circle: 'rounded-full', + triangle: 'triangle-shape', + square: 'rotate-45', + diamond: 'rotate-45 rounded-sm', + }; + + return ( +
+ ); +}; + +const GradientText = ({ children, className = '' }) => ( + + {children} + +); + +const AnimatedInput = ({ + icon: Icon, + type = 'text', + placeholder, + value, + onChange, + onFocus, + onBlur, + focused, + error, + showToggle = false, + showPassword = false, + onTogglePassword +}) => { + return ( +
+
+
+ +
+ + + {showToggle && ( + + )} + + {focused && ( +
+ )} +
+ + {error && ( +
+ + {error} +
+ )} +
+ ); +}; const Login = () => { + const navigate = useNavigate(); + const [isActive, setIsActive] = useState(false); + const [username, setUsername] = useState(''); + const [password, setPassword] = useState(''); + const [showPassword, setShowPassword] = useState(false); + const [isPasswordFocused, setIsPasswordFocused] = useState(false); + const [forgotUsername, setForgotUsername] = useState(''); + const [verificationCode, setVerificationCode] = useState(''); + const [newPassword, setNewPassword] = useState(''); + const [confirmPassword, setConfirmPassword] = useState(''); + const [showResetPassword, setShowResetPassword] = useState(false); + const [isResetFocused, setIsResetFocused] = useState(false); + const [errors, setErrors] = useState({}); const [message, setMessage] = useState(''); const [messageType, setMessageType] = useState(''); const [forgotMode, setForgotMode] = useState(false); const [step, setStep] = useState(1); const [resetToken, setResetToken] = useState(''); const [isLoading, setIsLoading] = useState(false); - const [isVisible, setIsVisible] = useState(false); - const navigate = useNavigate(); // ✅ INITIALIZE - + const [signupUsername, setSignupUsername] = useState(''); + const [signupEmail, setSignupEmail] = useState(''); + const [signupPassword, setSignupPassword] = useState(''); + const [signupConfirmPassword, setSignupConfirmPassword] = useState(''); + const [showSignupPassword, setShowSignupPassword] = useState(false); + const [showSignupConfirmPassword, setShowSignupConfirmPassword] = useState(false); + const [verificationMode, setVerificationMode] = useState(false); + const [signupVerificationCode, setSignupVerificationCode] = useState(''); + const [verificationId, setVerificationId] = useState(''); + const [focusedField, setFocusedField] = useState(null); - useEffect(() => { - setIsVisible(true); - }, []); - - const showMessage = (msg, type = 'info') => { + const showLoginMessage = (msg, type = 'info') => { setMessage(msg); setMessageType(type); }; - const clearMessage = () => { + const clearLoginMessage = () => { setMessage(''); setMessageType(''); }; - const handleLogin = async (username, password) => { + const validateLoginForm = () => { + const newErrors = {}; + if (!username) newErrors.username = 'Username is required'; + if (!password) newErrors.password = 'Password is required'; + setErrors(newErrors); + return Object.keys(newErrors).length === 0; + }; + + const handleLoginSubmit = async () => { + if (validateLoginForm()) await handleLogin(username, password); + }; + + const handleLogin = async (user, pass) => { setIsLoading(true); try { - const success = await handleToken(username, password, navigate); + const success = await handleToken(user, pass, navigate); if (success) { - showMessage('Login successful!', 'success'); + showLoginMessage('Login successful!', 'success'); } else { - showMessage('Login failed. Please check your credentials.', 'error'); + showLoginMessage('Login failed. Please check your credentials.', 'error'); } } catch (error) { - showMessage('Server error', 'error'); + showLoginMessage('Server error', 'error'); } finally { setIsLoading(false); } @@ -55,117 +279,123 @@ const Login = () => { const handleForgotPassword = () => { setForgotMode(true); + setStep(1); + setForgotUsername(''); + setVerificationCode(''); + setNewPassword(''); + setConfirmPassword(''); + setResetToken(''); + clearLoginMessage(); }; - const handleSendCode = async (username) => { + const handleSendCode = async (user) => { + if (!user) { + showLoginMessage('Username is required', 'error'); + return; + } setIsLoading(true); - try { - await new Promise(resolve => setTimeout(resolve, 1000)); - - const res = await fetch(`${baseUrl}/forgot-password/`, { + const res = await fetch(`${baseUrl}forgot-password/`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ username }), + body: JSON.stringify({ username: user }), }); - if (res.ok) { setStep(2); - showMessage('Verification code sent to your email.', 'success'); + showLoginMessage('Verification code sent to your email.', 'success'); } else { - showMessage('Failed to send verification code', 'error'); + showLoginMessage('Failed to send verification code', 'error'); } } catch (error) { - showMessage('Server error', 'error'); + showLoginMessage('Server error', 'error'); } finally { setIsLoading(false); } }; const handleVerifyCode = async (code) => { + if (!code) { + showLoginMessage('Verification code is required', 'error'); + return; + } setIsLoading(true); - try { - await new Promise(resolve => setTimeout(resolve, 1000)); - - const res = await fetch(`${baseUrl}/verify-reset-code/`, { + const res = await fetch(`${baseUrl}verify-reset-code/`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ verification_code: code }), }); - const data = await res.json(); if (res.ok) { setResetToken(data.reset_token || 'dummy-token'); setStep(3); - showMessage('Code verified successfully!', 'success'); + showLoginMessage('Code verified successfully!', 'success'); } else { - showMessage(data.detail || 'Code verification failed', 'error'); + showLoginMessage(data.detail || 'Code verification failed', 'error'); } } catch (error) { - showMessage('Server error', 'error'); + showLoginMessage('Server error', 'error'); } finally { setIsLoading(false); } }; - const handleResetPassword = async (newPassword, confirmPassword) => { - if (newPassword !== confirmPassword) { - showMessage('Passwords do not match', 'error'); + const handleResetPassword = async (newPass, confirmPass) => { + if (newPass !== confirmPass) { + showLoginMessage('Passwords do not match', 'error'); + return; + } + if (!newPass) { + showLoginMessage('Password is required', 'error'); return; } - setIsLoading(true); - try { - await new Promise(resolve => setTimeout(resolve, 1000)); - - const res = await fetch(`${baseUrl}/reset-password/`, { + const res = await fetch(`${baseUrl}reset-password/`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ reset_token: resetToken, - password1: newPassword, - password2: confirmPassword, + password1: newPass, + password2: confirmPass, }), }); - if (res.ok) { - showMessage('Password reset successful!', 'success'); + showLoginMessage('Password reset successful!', 'success'); setTimeout(() => { setForgotMode(false); setStep(1); }, 2000); } else { const data = await res.json(); - showMessage(data.detail || 'Reset failed', 'error'); + showLoginMessage(data.detail || 'Reset failed', 'error'); } } catch (error) { - showMessage('Server error', 'error'); + showLoginMessage('Server error', 'error'); } finally { setIsLoading(false); } }; - const handleResendCode = async (username) => { + const handleResendCode = async (user) => { + if (!user) { + showLoginMessage('Username is required for resend', 'error'); + return; + } setIsLoading(true); - try { - await new Promise(resolve => setTimeout(resolve, 800)); - - const res = await fetch(`${baseUrl}/resend-code/`, { + const res = await fetch(`${baseUrl}resend-code/`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ username }), + body: JSON.stringify({ username: user }), }); - if (res.ok) { - showMessage('Verification code resent!', 'success'); + showLoginMessage('Verification code resent!', 'success'); } else { - showMessage('Failed to resend code', 'error'); + showLoginMessage('Failed to resend code', 'error'); } } catch (error) { - showMessage('Server error', 'error'); + showLoginMessage('Server error', 'error'); } finally { setIsLoading(false); } @@ -174,46 +404,727 @@ const Login = () => { const handleBackToLogin = () => { setForgotMode(false); setStep(1); - clearMessage(); + clearLoginMessage(); }; - return ( -
- {/* Animated background elements */} + const handleSignUp = async () => { + if (signupPassword !== signupConfirmPassword) { + showLoginMessage('Passwords do not match', 'error'); + return; + } + + if (!signupUsername || !signupEmail || !signupPassword) { + showLoginMessage('Please fill in all fields', 'error'); + return; + } + + setIsLoading(true); + + try { + const response = await fetch(`${baseUrl}register/`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + username: signupUsername, + email: signupEmail, + password: signupPassword, + password_confirm: signupConfirmPassword, + }), + }); + + const data = await response.json(); + + if (response.ok) { + setVerificationId(data.verification_id); + setVerificationMode(true); + showLoginMessage('Verification code sent to your email!', 'success'); + } else { + showLoginMessage(data.error || JSON.stringify(data.errors) || 'Registration failed', 'error'); + } + } catch (error) { + showLoginMessage('Server error during signup', 'error'); + } finally { + setIsLoading(false); + } + }; + + const handleVerifyEmail = async () => { + if (!signupVerificationCode) { + showLoginMessage('Please enter verification code', 'error'); + return; + } + + setIsLoading(true); + + try { + const response = await fetch(`${baseUrl}verify-email/`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + verification_code: signupVerificationCode, + verification_id: verificationId, + }), + }); + + const data = await response.json(); + + if (response.ok) { + showLoginMessage('Account created successfully! Redirecting...', 'success'); + + localStorage.setItem("authToken", data.token); + sessionStorage.setItem("email", signupEmail); + sessionStorage.setItem("password", signupPassword); + + setTimeout(() => { + navigate('/profile-setup'); + }, 1500); + + setVerificationMode(false); + setSignupUsername(''); + setSignupEmail(''); + setSignupPassword(''); + setSignupConfirmPassword(''); + setSignupVerificationCode(''); + setVerificationId(''); + } else { + showLoginMessage(data.error || 'Verification failed', 'error'); + } + } catch (error) { + showLoginMessage('Server error during verification', 'error'); + } finally { + setIsLoading(false); + } + }; + + const handleSignupResendCode = async () => { + setIsLoading(true); + + try { + const response = await fetch(`${baseUrl}resend-code/`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + email: signupEmail, + type: 'registration', + }), + }); + + if (response.ok) { + showLoginMessage('Verification code resent!', 'success'); + } else { + showLoginMessage('Failed to resend code', 'error'); + } + } catch (error) { + showLoginMessage('Server error', 'error'); + } finally { + setIsLoading(false); + } + }; + + const toggle = () => { + setIsActive(!isActive); + setTimeout(() => { + navigate(isActive ? '/login' : '/signup'); + }, 600); + }; + + let headerText = 'Welcome Back'; + let subText = 'Our owl friend is keeping watch over your login'; + if (forgotMode) { + if (step === 1) { + headerText = 'Forgot Password'; + subText = 'Enter your username to receive a verification code'; + } else if (step === 2) { + headerText = 'Verify Code'; + subText = 'Enter the code sent to your email'; + } else if (step === 3) { + headerText = 'Reset Password'; + subText = 'Enter your new password'; + } + } + + const isMascotPasswordVisible = forgotMode && step === 3 ? showResetPassword : showPassword; + const isMascotPasswordFocused = forgotMode && step === 3 ? isResetFocused : isPasswordFocused; + + return ( +
+ + + + + + +
-
-
+
+
+
+
+ +
+
+
+
+
+
+

+ Join InterXAI +

+

+ Start your journey +

+
+
+ {verificationMode ? ( +
+
+ +
+

+ Verify Your Email +

+

+ Code sent to {signupEmail} +

+ setSignupVerificationCode(e.target.value)} + onFocus={() => setFocusedField('verification')} + onBlur={() => setFocusedField(null)} + focused={focusedField === 'verification'} + /> + + + +
+ ) : ( + <> + setSignupUsername(e.target.value)} + onFocus={() => setFocusedField('username')} + onBlur={() => setFocusedField(null)} + focused={focusedField === 'username'} + /> + setSignupEmail(e.target.value)} + onFocus={() => setFocusedField('email')} + onBlur={() => setFocusedField(null)} + focused={focusedField === 'email'} + /> + setSignupPassword(e.target.value)} + onFocus={() => setFocusedField('password')} + onBlur={() => setFocusedField(null)} + focused={focusedField === 'password'} + showToggle + showPassword={showSignupPassword} + onTogglePassword={() => setShowSignupPassword(!showSignupPassword)} + /> + setSignupConfirmPassword(e.target.value)} + onFocus={() => setFocusedField('confirmPassword')} + onBlur={() => setFocusedField(null)} + focused={focusedField === 'confirmPassword'} + showToggle + showPassword={showSignupConfirmPassword} + onTogglePassword={() => setShowSignupConfirmPassword(!showSignupConfirmPassword)} + /> + + + )} +
+
+
+
+
+
+ +
+
+

+ {headerText} +

+

+ {subText} +

+
+
+ {!forgotMode ? ( + <> +
+ + setUsername(e.target.value)} + className="input-field text-sm py-2" + placeholder="Enter your username" + /> + {errors.username &&

{errors.username}

} +
+
+ +
+ setPassword(e.target.value)} + onFocus={() => setIsPasswordFocused(true)} + onBlur={() => setIsPasswordFocused(false)} + className="input-field pr-10 text-sm py-2" + placeholder="Enter your password" + /> + +
+ {errors.password &&

{errors.password}

} +
+
+ +
+ + + ) : step === 1 ? ( + <> +
+ + setForgotUsername(e.target.value)} + className="input-field text-sm py-2" + placeholder="Enter your username" + /> +
+ + + + ) : step === 2 ? ( + <> +
+ + setVerificationCode(e.target.value)} + className="input-field text-sm py-2" + placeholder="Enter code" + /> +
+ + + + + ) : step === 3 ? ( + <> +
+ +
+ setNewPassword(e.target.value)} + onFocus={() => setIsResetFocused(true)} + onBlur={() => setIsResetFocused(false)} + className="input-field pr-10 text-sm py-2" + placeholder="New password" + /> + +
+
+
+ +
+ setConfirmPassword(e.target.value)} + onFocus={() => setIsResetFocused(true)} + onBlur={() => setIsResetFocused(false)} + className="input-field pr-10 text-sm py-2" + placeholder="Confirm password" + /> + +
+
+ + + + ) : null} +
+
+
+
+
+
+

Welcome to InterXAI!

+

Already have an account?

+ +
+
+

Hello, Welcome Back!

+

Don’t have an account?

+ +
+
+
+
- -
- - - {!forgotMode ? ( - - ) : ( - - )} - - -
- +
); }; diff --git a/src/pages/SignUp.jsx b/src/pages/SignUp.jsx index eebaf6b5b..84a548290 100644 --- a/src/pages/SignUp.jsx +++ b/src/pages/SignUp.jsx @@ -1,52 +1,419 @@ +// SignUp.jsx import React, { useState, useEffect } from 'react'; -import Header from '../components/ui/header'; -import Footer from '../components/ui/footer'; -import SignUpForm from '../components/forms/SignUpForm'; -import EmailVerification from '../components/forms/EmailVerification'; -import NotificationMessage from '../components/ui/NotificationMessage'; -import BackgroundEffects from '../components/ui/BackgroundEffects'; -import CustomStyles from '../components/ui/CustomStyles'; -import { useNavigate } from 'react-router-dom'; +import { Eye, EyeOff, ArrowRight, ArrowLeft, User, Mail, Lock, Check, Shield } from 'lucide-react'; +import { useNavigate, Link } from 'react-router-dom'; +import MessageNotification from '../components/ui/MessageNotification'; -const baseUrl = import.meta.env.VITE_API_URL; +const baseUrl = 'http://localhost:8000/api/users/'; + +const OwlMascot = ({ showPassword, isPasswordFocused }) => ( +
+ + + + + + + + + + + + + + + + + + + {!showPassword && isPasswordFocused && ( + <> + + + + )} + {showPassword ? ( + <> + + + + + + ) : isPasswordFocused ? ( + <> + + + + ) : ( + <> + + + + )} + + + + +
+); + + + +const ParticleField = () => { + const [particles, setParticles] = useState([]); + + useEffect(() => { + const newParticles = Array.from({ length: 30 }, (_, i) => ({ + id: i, + x: Math.random() * 100, + y: Math.random() * 100, + size: Math.random() * 3 + 1, + speedX: (Math.random() - 0.5) * 0.3, + speedY: (Math.random() - 0.5) * 0.3, + opacity: Math.random() * 0.3 + 0.1, + })); + setParticles(newParticles); + + const interval = setInterval(() => { + setParticles(prev => prev.map(particle => ({ + ...particle, + x: (particle.x + particle.speedX + 100) % 100, + y: (particle.y + particle.speedY + 100) % 100, + }))); + }, 100); + + return () => clearInterval(interval); + }, []); + + return ( +
+ {particles.map(particle => ( +
+ ))} +
+ ); +}; + +const FloatingShape = ({ delay = 0, shape = 'circle', size = 'w-8 h-8', position = 'top-1/4 left-1/4' }) => { + const shapeStyles = { + circle: 'rounded-full', + triangle: 'triangle-shape', + square: 'rotate-45', + diamond: 'rotate-45 rounded-sm', + }; + + return ( +
+ ); +}; + +const GradientText = ({ children, className = '' }) => ( + + {children} + +); + +const AnimatedInput = ({ + icon: Icon, + type = 'text', + placeholder, + value, + onChange, + onFocus, + onBlur, + focused, + error, + showToggle = false, + showPassword = false, + onTogglePassword +}) => { + return ( +
+
+
+ +
+ + + {showToggle && ( + + )} + + {focused && ( +
+ )} +
+ + {error && ( +
+ + {error} +
+ )} +
+ ); +}; const SignUp = () => { + const navigate = useNavigate(); + const [isActive, setIsActive] = useState(true); const [username, setUsername] = useState(''); - const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); - const [confirmPassword, setConfirmPassword] = useState(''); const [showPassword, setShowPassword] = useState(false); - const [showConfirmPassword, setShowConfirmPassword] = useState(false); + const [isPasswordFocused, setIsPasswordFocused] = useState(false); + const [forgotUsername, setForgotUsername] = useState(''); + const [verificationCode, setVerificationCode] = useState(''); + const [newPassword, setNewPassword] = useState(''); + const [confirmPassword, setConfirmPassword] = useState(''); + const [showResetPassword, setShowResetPassword] = useState(false); + const [isResetFocused, setIsResetFocused] = useState(false); + const [errors, setErrors] = useState({}); const [message, setMessage] = useState(''); const [messageType, setMessageType] = useState(''); + const [forgotMode, setForgotMode] = useState(false); + const [step, setStep] = useState(1); + const [resetToken, setResetToken] = useState(''); const [isLoading, setIsLoading] = useState(false); - const [isVisible, setIsVisible] = useState(false); + const [signupUsername, setSignupUsername] = useState(''); + const [signupEmail, setSignupEmail] = useState(''); + const [signupPassword, setSignupPassword] = useState(''); + const [signupConfirmPassword, setSignupConfirmPassword] = useState(''); + const [showSignupPassword, setShowSignupPassword] = useState(false); + const [showSignupConfirmPassword, setShowSignupConfirmPassword] = useState(false); const [verificationMode, setVerificationMode] = useState(false); - const [verificationCode, setVerificationCode] = useState(''); + const [signupVerificationCode, setSignupVerificationCode] = useState(''); const [verificationId, setVerificationId] = useState(''); - const navigate = useNavigate(); - - useEffect(() => { - setIsVisible(true); - }, []); + const [focusedField, setFocusedField] = useState(null); - const showMessage = (msg, type = 'info') => { + const showSignupMessage = (msg, type = 'info') => { setMessage(msg); setMessageType(type); - setTimeout(() => { - setMessage(''); - setMessageType(''); - }, 5000); + }; + + const clearSignupMessage = () => { + setMessage(''); + setMessageType(''); + }; + + const validateLoginForm = () => { + const newErrors = {}; + if (!username) newErrors.username = 'Username is required'; + if (!password) newErrors.password = 'Password is required'; + setErrors(newErrors); + return Object.keys(newErrors).length === 0; + }; + + const handleLoginSubmit = async () => { + if (validateLoginForm()) await handleLogin(username, password); + }; + + const handleLogin = async (user, pass) => { + setIsLoading(true); + try { + const success = await handleToken(user, pass, navigate); + if (success) { + showSignupMessage('Login successful!', 'success'); + } else { + showSignupMessage('Login failed. Please check your credentials.', 'error'); + } + } catch (error) { + showSignupMessage('Server error', 'error'); + } finally { + setIsLoading(false); + } + }; + + const handleForgotPassword = () => { + setForgotMode(true); + setStep(1); + setForgotUsername(''); + setVerificationCode(''); + setNewPassword(''); + setConfirmPassword(''); + setResetToken(''); + clearSignupMessage(); + }; + + const handleSendCode = async (user) => { + if (!user) { + showSignupMessage('Username is required', 'error'); + return; + } + setIsLoading(true); + try { + const res = await fetch(`${baseUrl}forgot-password/`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ username: user }), + }); + if (res.ok) { + setStep(2); + showSignupMessage('Verification code sent to your email.', 'success'); + } else { + showSignupMessage('Failed to send verification code', 'error'); + } + } catch (error) { + showSignupMessage('Server error', 'error'); + } finally { + setIsLoading(false); + } + }; + + const handleVerifyCode = async (code) => { + if (!code) { + showSignupMessage('Verification code is required', 'error'); + return; + } + setIsLoading(true); + try { + const res = await fetch(`${baseUrl}verify-reset-code/`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ verification_code: code }), + }); + const data = await res.json(); + if (res.ok) { + setResetToken(data.reset_token || 'dummy-token'); + setStep(3); + showSignupMessage('Code verified successfully!', 'success'); + } else { + showSignupMessage(data.detail || 'Code verification failed', 'error'); + } + } catch (error) { + showSignupMessage('Server error', 'error'); + } finally { + setIsLoading(false); + } + }; + + const handleResetPassword = async (newPass, confirmPass) => { + if (newPass !== confirmPass) { + showSignupMessage('Passwords do not match', 'error'); + return; + } + if (!newPass) { + showSignupMessage('Password is required', 'error'); + return; + } + setIsLoading(true); + try { + const res = await fetch(`${baseUrl}reset-password/`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + reset_token: resetToken, + password1: newPass, + password2: confirmPass, + }), + }); + if (res.ok) { + showSignupMessage('Password reset successful!', 'success'); + setTimeout(() => { + setForgotMode(false); + setStep(1); + }, 2000); + } else { + const data = await res.json(); + showSignupMessage(data.detail || 'Reset failed', 'error'); + } + } catch (error) { + showSignupMessage('Server error', 'error'); + } finally { + setIsLoading(false); + } + }; + + const handleResendCode = async (user) => { + if (!user) { + showSignupMessage('Username is required for resend', 'error'); + return; + } + setIsLoading(true); + try { + const res = await fetch(`${baseUrl}resend-code/`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ username: user }), + }); + if (res.ok) { + showSignupMessage('Verification code resent!', 'success'); + } else { + showSignupMessage('Failed to resend code', 'error'); + } + } catch (error) { + showSignupMessage('Server error', 'error'); + } finally { + setIsLoading(false); + } + }; + + const handleBackToLogin = () => { + setForgotMode(false); + setStep(1); + clearSignupMessage(); }; const handleSignUp = async () => { - if (password !== confirmPassword) { - showMessage('Passwords do not match', 'error'); + if (signupPassword !== signupConfirmPassword) { + showSignupMessage('Passwords do not match', 'error'); return; } - if (!username || !email || !password) { - showMessage('Please fill in all fields', 'error'); + if (!signupUsername || !signupEmail || !signupPassword) { + showSignupMessage('Please fill in all fields', 'error'); return; } @@ -59,10 +426,10 @@ const SignUp = () => { 'Content-Type': 'application/json', }, body: JSON.stringify({ - username, - email, - password, - password_confirm: confirmPassword, + username: signupUsername, + email: signupEmail, + password: signupPassword, + password_confirm: signupConfirmPassword, }), }); @@ -71,21 +438,20 @@ const SignUp = () => { if (response.ok) { setVerificationId(data.verification_id); setVerificationMode(true); - showMessage('Verification code sent to your email!', 'success'); + showSignupMessage('Verification code sent to your email!', 'success'); } else { - console.log('Registration error:', data); - showMessage(data.error || JSON.stringify(data.errors) || 'Registration failed', 'error'); + showSignupMessage(data.error || JSON.stringify(data.errors) || 'Registration failed', 'error'); } } catch (error) { - showMessage('Server error during signup', 'error'); + showSignupMessage('Server error during signup', 'error'); } finally { setIsLoading(false); } }; const handleVerifyEmail = async () => { - if (!verificationCode) { - showMessage('Please enter verification code', 'error'); + if (!signupVerificationCode) { + showSignupMessage('Please enter verification code', 'error'); return; } @@ -98,7 +464,7 @@ const SignUp = () => { 'Content-Type': 'application/json', }, body: JSON.stringify({ - verification_code: verificationCode, + verification_code: signupVerificationCode, verification_id: verificationId, }), }); @@ -106,38 +472,34 @@ const SignUp = () => { const data = await response.json(); if (response.ok) { - if (response.ok) { - showMessage('Account created successfully! Redirecting...', 'success'); - - // ✅ Save token for profile setup access - localStorage.setItem("authToken", data.token); - sessionStorage.setItem("email", email); - sessionStorage.setItem("password", password); // <-- Add this too if you use session fallback + showSignupMessage('Account created successfully! Redirecting...', 'success'); - setTimeout(() => { - navigate(`/profile-setup`); - }, 1500); - } + localStorage.setItem("authToken", data.token); + sessionStorage.setItem("email", signupEmail); + sessionStorage.setItem("password", signupPassword); + setTimeout(() => { + navigate('/profile-setup'); + }, 1500); setVerificationMode(false); - setUsername(''); - setEmail(''); - setPassword(''); - setConfirmPassword(''); - setVerificationCode(''); + setSignupUsername(''); + setSignupEmail(''); + setSignupPassword(''); + setSignupConfirmPassword(''); + setSignupVerificationCode(''); setVerificationId(''); } else { - showMessage(data.error || 'Verification failed', 'error'); + showSignupMessage(data.error || 'Verification failed', 'error'); } } catch (error) { - showMessage('Server error during verification', 'error'); + showSignupMessage('Server error during verification', 'error'); } finally { setIsLoading(false); } }; - const handleResendCode = async () => { + const handleSignupResendCode = async () => { setIsLoading(true); try { @@ -147,68 +509,621 @@ const SignUp = () => { 'Content-Type': 'application/json', }, body: JSON.stringify({ - email, + email: signupEmail, type: 'registration', }), }); if (response.ok) { - showMessage('Verification code resent!', 'success'); + showSignupMessage('Verification code resent!', 'success'); } else { - showMessage('Failed to resend code', 'error'); + showSignupMessage('Failed to resend code', 'error'); } } catch (error) { - showMessage('Server error', 'error'); + showSignupMessage('Server error', 'error'); } finally { setIsLoading(false); } }; + const toggle = () => { + setIsActive(!isActive); + setTimeout(() => { + navigate(isActive ? '/login' : '/signup'); + }, 600); + }; + + let headerText = 'Welcome Back'; + let subText = 'Our owl friend is keeping watch over your login'; + if (forgotMode) { + if (step === 1) { + headerText = 'Forgot Password'; + subText = 'Enter your username to receive a verification code'; + } else if (step === 2) { + headerText = 'Verify Code'; + subText = 'Enter the code sent to your email'; + } else if (step === 3) { + headerText = 'Reset Password'; + subText = 'Enter your new password'; + } + } + + const isMascotPasswordVisible = forgotMode && step === 3 ? showResetPassword : showPassword; + const isMascotPasswordFocused = forgotMode && step === 3 ? isResetFocused : isPasswordFocused; + return ( -
- - -
- -
-
- {verificationMode ? ( - - ) : ( - - )} +
+ + + + + + +
+
+
+
+
+
+ +
+
+
+
+
+
+

+ Join InterXAI +

+

+ Start your journey +

+
+
+ {verificationMode ? ( +
+
+ +
+

+ Verify Your Email +

+

+ Code sent to {signupEmail} +

+ setSignupVerificationCode(e.target.value)} + onFocus={() => setFocusedField('verification')} + onBlur={() => setFocusedField(null)} + focused={focusedField === 'verification'} + /> + + + +
+ ) : ( + <> + setSignupUsername(e.target.value)} + onFocus={() => setFocusedField('username')} + onBlur={() => setFocusedField(null)} + focused={focusedField === 'username'} + /> + setSignupEmail(e.target.value)} + onFocus={() => setFocusedField('email')} + onBlur={() => setFocusedField(null)} + focused={focusedField === 'email'} + /> + setSignupPassword(e.target.value)} + onFocus={() => setFocusedField('password')} + onBlur={() => setFocusedField(null)} + focused={focusedField === 'password'} + showToggle + showPassword={showSignupPassword} + onTogglePassword={() => setShowSignupPassword(!showSignupPassword)} + /> + setSignupConfirmPassword(e.target.value)} + onFocus={() => setFocusedField('confirmPassword')} + onBlur={() => setFocusedField(null)} + focused={focusedField === 'confirmPassword'} + showToggle + showPassword={showSignupConfirmPassword} + onTogglePassword={() => setShowSignupConfirmPassword(!showSignupConfirmPassword)} + /> + + + )} +
+
+
+
+
+
+ +
+
+

+ {headerText} +

+

+ {subText} +

+
+
+ {!forgotMode ? ( + <> +
+ + setUsername(e.target.value)} + className="input-field text-sm py-2" + placeholder="Enter your username" + /> + {errors.username &&

{errors.username}

} +
+
+ +
+ setPassword(e.target.value)} + onFocus={() => setIsPasswordFocused(true)} + onBlur={() => setIsPasswordFocused(false)} + className="input-field pr-10 text-sm py-2" + placeholder="Enter your password" + /> + +
+ {errors.password &&

{errors.password}

} +
+
+ +
+ + + ) : step === 1 ? ( + <> +
+ + setForgotUsername(e.target.value)} + className="input-field text-sm py-2" + placeholder="Enter your username" + /> +
+ + + + ) : step === 2 ? ( + <> +
+ + setVerificationCode(e.target.value)} + className="input-field text-sm py-2" + placeholder="Enter code" + /> +
+ + + + + ) : step === 3 ? ( + <> +
+ +
+ setNewPassword(e.target.value)} + onFocus={() => setIsResetFocused(true)} + onBlur={() => setIsResetFocused(false)} + className="input-field pr-10 text-sm py-2" + placeholder="New password" + /> + +
+
+
+ +
+ setConfirmPassword(e.target.value)} + onFocus={() => setIsResetFocused(true)} + onBlur={() => setIsResetFocused(false)} + className="input-field pr-10 text-sm py-2" + placeholder="Confirm password" + /> + +
+
+ + + + ) : null} +
+
+
+
+
+
+

Welcome to InterXAI!

+

Already have an account?

+ +
+
+

Hello, Welcome Back!

+

Don’t have an account?

+ +
+
+
- -
- - - + +
); }; From 113f7e1147ad5a1cb217d28e2f0e15e284d4069b Mon Sep 17 00:00:00 2001 From: RITVIKKAMASETTY Date: Sun, 24 Aug 2025 09:09:43 +0530 Subject: [PATCH 2/2] add --- core/db.sqlite3 | Bin 368640 -> 368640 bytes src/mocks/next-image.jsx | 5 + src/pages/DasInterViewPlatForm.jsx | 2949 ++++++++++++++++++++++---- src/pages/InterviewSession.jsx | 800 +++---- src/routes/ProtectorRouteWrapper.jsx | 23 +- vite.config.js | 31 +- 6 files changed, 2869 insertions(+), 939 deletions(-) create mode 100644 src/mocks/next-image.jsx diff --git a/core/db.sqlite3 b/core/db.sqlite3 index 1c94f2bf8e268fd37af6fcedb71cf30a15b77395..477bb03b1e8f4f08705b490b15fc734e255cec87 100644 GIT binary patch delta 5689 zcmb_gTWlQF8J^jl^?IE+2RpG7UlLDz!Legc=6=~Uv9~EI6=X_C+fYIT@b1oL zW;VtYw1ki*0m`LOJ8e=Bpk7s^f{0j^eIp2T%{{J7}_fqG5FLgfFok+a;c<<*yK7Ys4eN9^uOnd9g7t{PeqV?q$ zB>wxYDSj|{C=s15CVSG%BVF5)1{+oGOm;NoP&>1mrC&7Fdb^Vc*zbNjvE$;TFvE^s z{HdU@sf+Ij<))$D&B=*O^!TMj*BN);qPvg1TxlLfDF%Ivz8jS8U?nYHq0dJ>~gKk5|(9PiS z_2>{fh%BU{ecx`^08#C9S&iRd6=8xdQHXy=k3+ZLaHkv)1%ay0R3lztPOX?dt+f9CI*%b6RR zKW_ec^YP|Q>0hPi(qm2UG(Ft(xzs;WKS(t~+66MM;25l4RK< zF`nK4PtIyeR+a_R5Oqu6TWbIaN3^UY3#w&WnrQEd0kwvJl9rVv!IWjy)EXHmXH__% z2)e17vT6^>L!1x1l`QEv<=%30YGR7JIP%f2=SRMs1~geMa`$+Apw zeFSUc@`_3kj)<}Z77oRLazj8#&#HzXYN{oPbq21egrv!uAxgSE7~@In@M=ryC9qHv zG|ki{qcI?;R8+w*3|-aiff!I+2e^zULJ$R6)kJ**13@Fyj8>CHNwn<#RY2Kl2q>yq zMG_1}7Zqg#13{%I=cO5B~_5jnxu*w0D?-%0v|-n(rrEltYZlT979in6TReam>YOir$&2?bOwQev{AD~8<2V^9em8-gTDrefH;Vgu_~ zLh)oPtB}*WuC7T*ZJFsyDoqk(RTO1Kw0FjUYJ(600ko{93bLV_veei>+01I7(o`i= zJJ6e9kioV=pOFuF1$-;^z40lhmY)lKCqL(wXA;LxY+LOsOD03-Q3ORcEY-AoVtX2~ z4D2Dqh10sFt!Eh}8MPQ_W5D;aW_MG(8fkoTBbEUppyZ)Mfwj^G86YY}0TKWqv%6vg z*Rza}f-o#A8E{&a6l*15Q2%Q)04kwVh`MU2qP-&qY{W7ER7iYHQv(XE0ItKMjnq_h zS<>w7t9a5X$!ecg53Lefvn)&cMu0F6EWyx8((TR|uo26E;VKlVpy`?_)^}zalN$5^ zMHf`n5)H-fhyfe33;;!05TWA5hJA{vRCS1;4#UIV7UMN0nOFmlp=&6LCe^okY9UNO z%@jn{vY?Z0jR706Od^v@(*;8{EM+4D!C`2PhN&sK-98lqHewk7LgRz3A*q_$&_JqE zHGyTiX&H7~jJLv)=ua;uyZal}2StY#qH0hz`nk8?Vi(_jD>0(AFxN0-8+;$V4;#;4 zQ1pIZGPQYX?ptt|o^vPTu!|fDdP*-yBbEjV7)pue;IrikP2w!&zSA7qH_8yf@9`yDHds zaXF6#{wuQ&bPsL@HRryX0X41bw5;7OsFs>r1`Te&yX6r3r(8VG2RH~^uguRo0YHa7 zF5%(=U-3Mjz~cpe+Hs4xz=s}R@x4=S0rNgC;!{pJm;a@A_*UcguONR4L*R z173AzhWH4Eg|kjbO#@d7E~v(Q$ywmbUdT^jIOu{ckkn}iog)m54Q*m_Jq(j+W|*E& zCGXR#=Hf>$CO6&DNo(vQ^v0UsSI{d^md~M^$X;(YCE3Iz^DQXO(MjfEco~>v9)g$N z3Fbj~={U$-fR`-?ne*gij(MaN-V)T-hf+u4-{jTgRjA}c$>@Z_o!ERjF_%7l_dRLm zjIlNPm%{Z&f7H3wBncdQKDGTAUk!-sH{*gE(0D?EAqtQjKJZE)V5)_9#)V81zh~iM zkz9b|d9Pf?`Q_?>#Q8Y>B>F_>`uEfFUrz5KxLU@=V8SiTt?~&P6YMWWR)OX!%dljb zK+Wqmu+{#**m`>8bZeTqzk^2OhUiw6>z@ol&v&3!p&0YT`x5X9-Uk!8TaK>UO1TeR zOjHF^f_+t=WSEu&1a=6m2DTUtYuv=1iCq0HNq})}NEY16pfq#-ct?(1EPXRIoEUUY z2Dhxc0KM80$gq-4+ zkOiEBQieV;>&?>-=e=sNz`KM3gk~|zfY$gfNbj0Tn09fo5G-G-(R<_&VKLzQq_I@I z0GiAyRfGI2E;*!;fCgwgw2S!Am#_~dRC1vEO*kj(-GFB^3);7NkYSSNA+Cq(-Dt1( zBYNFUT^*kY3iW_8Y>BFD8UUEMFU?%oJCI`^IC*-@;-d$++Y{|;9|~bt6y@BNr?~$h zG}HpTqICT?dJnw^6#X-zkKTij3TE@*1flCt?#dk;CoWBxcUs=8rK_rVsLw-iF2tgb}V|( z_}>nUEM#=$50$p5Qw6Bp?G_#DTN(^$yT-6HU!ZtaD%hEIu5jx>|f_ z1=CI*NEJ!@xxT3HN$y6Lr{3DbP{E(cU^0DHE%ouqs!PTjvDd4H(1K!fhrwL-9wwJz z&sv$fc+*F8P1of$*1{-tL)VGN9zQ&bi$#y8a>=}SU_i^`>*Bd~IMQJY^I<9gGYOyK zX*wJfhG{||Q}9PI@BoU>k<6@2WRjURlh`d&l8}r5P7#<(=Qq(;z+?oHF6BhOJiv{K z{kb%8o7rIcn2IUJ#rz@q5K8%Pi2jo)k%CfAajTX70r~*Gd>7IGLk*HIn+Ca+0n;+o zG6mKBwU*6i`BV#Y|Iy|gRCYA=8u!C^?O$n+B;Fz@Honmxx?vIbXZ!8(BUOxHhq%f2 zV1SnT$NIsQyzf?smvG=FSQ{{JlWl_>1J9v**>~B{jiGj@JjX9Ucwz0J6T0m2;k>tW zxCWIShGgl$4t(#CVK4B0yp!%tVsbUrQJ^Kn@90iJ|1^g>8~xmucnjVQ5ZAfX6ka$Ee66Vzdhzo+MQX_#1mAD}x3I~wVs)7TeCwk%l9N?dI($a>NGVfyNuLf`Y| zor~t3e5)Re%BMK_Pule!zYg>^WqRskz9dHF(=_x6zaEZWlowBb!B0lTXy-*5x&UWc ze5Uin#U+06;*zjc@8sn_L4$l%z6!5@lIhi?80boH92XJdNDTAIvsgs01bO*8PW}#r z1u1&`2$HyB@?

=KJQlIoi6+$7$E+;wJj!IWZ&|mW7Wri0hel&85$r6EnBZKN0L= zB03YVE^2HU+&z=)UpR3!h$+TjJ9BG)2S)0N- zZW6;im%EjAs8SY*cV58YV;(ZE7*-LYrP zGV{3P*shDK4a+m@7P+3>G&orX2R)XFs&UwM@N~_dwMco2;3=c-`c@h>w_!#-MM_H% zt_ZaacR+pVyGwk0@%Jyp$blYS{)3bMkiY-O_m%t=0OAvQZ$RYv*iI10#ENX67>E7F z#2BpW68FOzi|>MUP5eGsyW*qlO>#nlA6|NilU@o+*FW)!cm*(YuSoZ6Xn)?B#-5D{ zxChZrH4Fz*Kp@^Kaa{u zNU6m#0i|U{c0k39Z8fS;lS3;?-C=uL&8YhJ%#Q7myrW`x*s<*@J*A;Ox{yc3oy=4#C8w*JnqyU+;O0`jEIS*R=hn92J-dth_T40-4(0MnPSrFm3o;#VfInb=5&TIB zTgGv5Vq%qmmQz%HP*-&j2;RrdtxYf^@quey;8qN$%o5Kq4V}W4x&^p&>C)S%pEhYA z5@P+t>SYvAeA}>7oE#l17FXF)bw$%NSxt{~T;O%Ewf6to+BkgIU0UZVL)om78Pu|w z92i1Z7Vj^h31Rb|v71wz9ny6ro68TXS$HTkx%nd#i!a}eo)qYZOMF*U16S2#CquhW zq-VO1UX|B^N}x`ueeAc^ukx?ZPCv?PSbKyakz7|e&h}FB>;Z%_z{8g~`BG#lvIGtC zTbPP(qMvE2g;J^cO|cHH$nz&9{>CT(xDZ8du%HfR#SSXB(5|r+&ci8tdOGD7Bn6;c z-q~yey;idU(<__*#GTrQIn{1|sVd_BDYmF1)^LwWfR!1iBqe9&&N z5*#v0p6$@b3n)oHeH%Tn8F2JER}AyV9}BJWMgt<*k=HUid}sQi{%3<{orMw~vIf>6RKWNL;&0==x?LHl$!+9!QLn_AziRJT@WO z*o3Lrmh?*mS*?OmsFY{ZZ{I?<^{*b8%Qhg-^!z>Ob~-YQ;^7U+5DTh3bb0~>Rn16e zN6=q#L|{F_ML8Hhe(Q8|euD^Xez0TdVQ7a3q{#6Uyquflizmiu^lS8f;^vOlhSWhN apDW~beeuHA=qyiv_y%p^!yjBg7ybr9M8W6) diff --git a/src/mocks/next-image.jsx b/src/mocks/next-image.jsx new file mode 100644 index 000000000..08fb7474c --- /dev/null +++ b/src/mocks/next-image.jsx @@ -0,0 +1,5 @@ +// src/mocks/next-image.js +export default function Image(props) { + return ; + } + \ No newline at end of file diff --git a/src/pages/DasInterViewPlatForm.jsx b/src/pages/DasInterViewPlatForm.jsx index 5a8218afb..a97e2c2ae 100644 --- a/src/pages/DasInterViewPlatForm.jsx +++ b/src/pages/DasInterViewPlatForm.jsx @@ -1,8 +1,1764 @@ +// import React, { useState, useEffect, useCallback } from 'react'; +// import { Clock, Play, Send, CheckCircle, XCircle, Code, AlertCircle } from 'lucide-react'; +// import { getAuthToken, fetchWithToken } from '../utils/handleToken'; +// import { useParams,useNavigate } from 'react-router-dom'; +// // Import token utilities (you'll need to add these to your project) + + +// const TIME_LIMIT = 30 * 60; // 30 minutes in seconds +// const LANGUAGES = ['Python', 'C++', 'Java']; +// const CODE_TEMPLATES = { +// Python: `# Write your solution here +// def solution(): +// # Your code here +// pass + +// # Test your solution +// if __name__ == "__main__": +// result = solution() +// print(result)`, +// 'C++': `#include +// #include +// using namespace std; + +// // Write your solution here +// int solution() { +// // Your code here +// return 0; +// } + +// int main() { +// int result = solution(); +// cout << result << endl; +// return 0; +// }`, +// Java: `public class Solution { +// // Write your solution here +// public static int solution() { +// // Your code here +// return 0; +// } + +// public static void main(String[] args) { +// int result = solution(); +// System.out.println(result); +// } +// }` +// }; + +// const DSAInterviewPlatform = ({ navigate }) => { + +// const params = useParams(); +// const nav=useNavigate(); +// const { sessionId } = params; +// const [currentQuestionIndex, setCurrentQuestionIndex] = useState(0); +// const [questions, setQuestions] = useState([]); +// const [dsaTopics, setDsaTopics] = useState([]); // Backend topics +// const [code, setCode] = useState(CODE_TEMPLATES.Python); +// const [selectedLanguage, setSelectedLanguage] = useState('Python'); +// const [loading, setLoading] = useState(true); +// const [timeLeft, setTimeLeft] = useState(TIME_LIMIT); +// const [isTestRunning, setIsTestRunning] = useState(false); +// const [testResult, setTestResult] = useState(null); +// const [submittedQuestions, setSubmittedQuestions] = useState([]); +// const [score, setScore] = useState(0); +// const [runResult, setRunResult] = useState(null); +// const [runsLeft, setRunsLeft] = useState({}); +// const [error, setError] = useState(null); + +// // Timer effect +// useEffect(() => { +// if (timeLeft > 0) { +// const timer = setTimeout(() => setTimeLeft(timeLeft - 1), 1000); +// return () => clearTimeout(timer); +// } else if (timeLeft === 0) { +// handleFinalSubmit(); // This now navigates directly +// } +// }, [timeLeft]); + +// const formatTime = (seconds) => { +// const mins = Math.floor(seconds / 60); +// const secs = seconds % 60; +// return `${mins.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`; +// }; + +// // Fetch DSA topics from backend +// const fetchDSATopics = async () => { +// const token = getAuthToken(); +// if (!token) { +// setError('Authentication required'); +// return []; +// } + +// try { +// const data = await fetchWithToken( +// `http://localhost:8000/api/interview/get-dsa-questions/${sessionId}/`, +// token, +// navigate, +// ); +// console.log(data); +// if (data.length===0) { +// console.log('Fetched DSA topics:', data); +// nav('/'); +// return data; +// } +// return data; +// } catch (error) { +// nav('/'); +// console.error('Error fetching DSA topics:', error); +// setError('Failed to fetch DSA topics'); +// return []; +// } +// }; + +// const callGroqAPI = async (prompt) => { +// try { +// const response = await fetch('https://api.groq.com/openai/v1/chat/completions', { +// method: 'POST', +// headers: { +// 'Authorization': `Bearer ${import.meta.env.VITE_GROQ_API_KEY}`, +// 'Content-Type': 'application/json', +// }, +// body: JSON.stringify({ +// model: 'llama3-8b-8192', +// messages: [{ role: 'user', content: prompt }], +// temperature: 0.1, +// }), +// }); + +// if (!response.ok) { +// throw new Error(`HTTP error! status: ${response.status}`); +// } + +// const data = await response.json(); +// return data.choices[0]?.message?.content || ''; +// } catch (error) { +// console.error('Groq API Error:', error); +// setError('Failed to connect to API. Please check your connection.'); +// return null; +// } +// }; + +// const generateQuestion = async (topic, difficulty) => { +// const prompt = `Generate a DSA coding problem for topic: ${topic} with difficulty: ${difficulty}. +// Respond ONLY with a valid JSON object in this exact format, with no additional text, markdown, or explanations: +// { +// "title": "Problem Title", +// "description": "Problem description with clear constraints, examples, and what the function should do. Include input/output format.", +// "testCases": [ +// {"input": "input1", "output": "expected_output1", "description": "test case 1 description"}, +// {"input": "input2", "output": "expected_output2", "description": "test case 2 description"}, +// {"input": "input3", "output": "expected_output3", "description": "test case 3 description"} +// ], +// "sampleInput": "sample input for testing", +// "sampleOutput": "expected sample output", +// "difficulty": "${difficulty}", +// "hints": ["hint1", "hint2"] +// } + +// Make sure: +// 1. The problem is clear and has examples +// 2. Test cases cover edge cases +// 3. Input/output format is specified +// 4. Problem is language-agnostic +// 5. Difficulty level matches: ${difficulty}`; + +// const response = await callGroqAPI(prompt); +// if (response) { +// try { +// // Clean response to extract JSON +// let cleanResponse = response.trim(); +// cleanResponse = cleanResponse.replace(/```json\n?/g, '').replace(/```\n?/g, ''); +// const jsonStart = cleanResponse.indexOf('{'); +// const jsonEnd = cleanResponse.lastIndexOf('}') + 1; +// if (jsonStart === -1 || jsonEnd === 0) { +// throw new Error('No valid JSON found in response'); +// } +// cleanResponse = cleanResponse.slice(jsonStart, jsonEnd); + +// const parsedQuestion = JSON.parse(cleanResponse); +// if (!parsedQuestion.title || !parsedQuestion.description || !parsedQuestion.testCases) { +// throw new Error('Invalid question format'); +// } + +// return parsedQuestion; +// } catch (e) { +// console.error('Failed to parse question JSON:', e, 'Response:', response); +// return null; +// } +// } +// return null; +// }; + +// const initializeQuestions = useCallback(async () => { +// setLoading(true); +// setError(null); + +// // Fetch DSA topics from backend +// const backendTopics = await fetchDSATopics(); +// if (!backendTopics || backendTopics.length === 0) { +// setError('No DSA topics found for this session'); +// setLoading(false); +// return; +// } + +// setDsaTopics(backendTopics); + +// // Generate questions for each topic +// const generatedQuestions = []; + +// for (let i = 0; i < Math.min(backendTopics.length, 3); i++) { +// const dsaTopic = backendTopics[i]; +// const question = await generateQuestion(dsaTopic.topic, dsaTopic.difficulty); +// if (question) { +// generatedQuestions.push({ +// ...question, +// topic: dsaTopic.topic, +// difficulty: dsaTopic.difficulty, +// dsaTopicId: dsaTopic.id, +// id: i +// }); +// } else { +// generatedQuestions.push({ +// id: i, +// topic: dsaTopic.topic, +// difficulty: dsaTopic.difficulty, +// dsaTopicId: dsaTopic.id, +// title: `${dsaTopic.topic.charAt(0).toUpperCase() + dsaTopic.topic.slice(1)} Problem`, +// description: `Solve a ${dsaTopic.topic} related problem with ${dsaTopic.difficulty} difficulty. Implement the solution function.`, +// testCases: [ +// { input: "test1", output: "result1", description: "Basic test case" }, +// { input: "test2", output: "result2", description: "Edge case" }, +// { input: "test3", output: "result3", description: "Complex case" } +// ], +// sampleInput: "sample", +// sampleOutput: "expected", +// hints: ["Consider the problem constraints", "Think about edge cases"] +// }); +// } +// } + +// if (generatedQuestions.length === 0) { +// setError('Failed to generate questions. Please refresh the page.'); +// } else { +// setQuestions(generatedQuestions); +// setCode(CODE_TEMPLATES.Python); +// const initialRuns = {}; +// generatedQuestions.forEach((_, index) => { +// initialRuns[index] = 3; +// }); +// setRunsLeft(initialRuns); +// } + +// setLoading(false); +// }, [sessionId, navigate]); + +// useEffect(() => { +// if (sessionId) { +// initializeQuestions(); +// } else { +// setError('Session ID is required'); +// } +// }, [initializeQuestions, sessionId]); + +// const runSingleTest = async () => { +// if (!questions[currentQuestionIndex]) return; + +// const remainingRuns = runsLeft[currentQuestionIndex] || 0; +// if (remainingRuns <= 0) { +// setRunResult({ +// isOutput: false, +// message: 'No runs left for this question' +// }); +// return; +// } + +// setIsTestRunning(true); +// setRunResult(null); +// const question = questions[currentQuestionIndex]; + +// const prompt = `Execute this ${selectedLanguage} code with the given input and return ONLY the output. + +// CRITICAL INSTRUCTIONS: +// - Run the code with the provided input +// - Return ONLY the actual output that the code produces +// - Do NOT include any explanations, descriptions, or additional text +// - Do NOT say "Output:" or "Result:" - just return the raw output +// - If there's an error, return only the error message + +// Code: +// ${code} + +// Input: ${question.sampleInput} + +// Execute and return only the output:`; + +// const result = await callGroqAPI(prompt); + +// setRunsLeft(prev => ({ +// ...prev, +// [currentQuestionIndex]: remainingRuns - 1 +// })); + +// if (result) { +// setRunResult({ +// isOutput: true, +// message: result.trim(), +// expected: question.sampleOutput +// }); +// } else { +// setRunResult({ +// isOutput: false, +// message: 'Failed to execute code' +// }); +// } +// setIsTestRunning(false); +// }; + +// const submitQuestion = async () => { +// if (!questions[currentQuestionIndex]) return; + +// setIsTestRunning(true); +// setTestResult(null); +// const question = questions[currentQuestionIndex]; + +// let passedTests = 0; +// const testResults = []; + +// for (let i = 0; i < question.testCases.length; i++) { +// const testCase = question.testCases[i]; + +// const prompt = `Execute this ${selectedLanguage} code with the given test case. + +// CRITICAL: Respond ONLY with: +// - "PASS" (if code executes correctly and output matches expected) +// - "FAIL: [brief reason]" (if code fails or output is wrong) + +// Do NOT include code descriptions, explanations, or additional commentary. + +// Code: +// ${code} + +// Test Input: ${testCase.input} +// Expected Output: ${testCase.output} + +// Execute the code and compare actual output with expected output.`; + +// const result = await callGroqAPI(prompt); +// if (result) { +// const passed = result.trim().toUpperCase().startsWith('PASS'); +// if (passed) passedTests++; +// testResults.push({ +// passed, +// message: result.trim(), +// testCase: testCase.description +// }); +// } else { +// testResults.push({ +// passed: false, +// message: 'Test execution failed', +// testCase: testCase.description +// }); +// } +// } + +// const allPassed = passedTests === question.testCases.length; +// const questionScore = allPassed ? 10 : Math.floor((passedTests / question.testCases.length) * 10); + +// // Submit to backend +// await submitToBackend(question, questionScore); + +// const newSubmission = { +// questionIndex: currentQuestionIndex, +// questionId: question.id, +// dsaTopicId: question.dsaTopicId, +// code, +// testResults, +// passedTests, +// totalTests: question.testCases.length, +// score: questionScore, +// allPassed, +// title: question.title, +// topic: question.topic +// }; + +// const updatedSubmissions = submittedQuestions.filter(sub => sub.questionIndex !== currentQuestionIndex); +// updatedSubmissions.push(newSubmission); +// setSubmittedQuestions(updatedSubmissions); + +// const totalScore = updatedSubmissions.reduce((acc, sub) => acc + sub.score, 0); +// setScore(totalScore); + +// setTestResult(newSubmission); +// setIsTestRunning(false); +// }; + +// const submitToBackend = async (question, questionScore) => { +// const token = getAuthToken(); +// if (!token) { +// console.error('No auth token found'); +// return; +// } + +// try { +// const submissionData = { +// question: JSON.stringify({ +// title: question.title, +// description: question.description, +// topic: question.topic, +// difficulty: question.difficulty +// }), +// code: code, +// score: questionScore +// }; + +// const response = await fetchWithToken( +// `http://localhost:8000/api/interview/add-dsa-scores/${sessionId}/${question.dsaTopicId}/`, +// token, +// navigate, +// 'POST', +// submissionData +// ); + +// if (response) { +// console.log('Successfully submitted to backend:', response); +// } else { +// console.error('Failed to submit to backend'); +// } +// } catch (error) { +// console.error('Error submitting to backend:', error); +// } +// }; + +// const handleQuestionSelect = (index) => { +// if (index === currentQuestionIndex) return; + +// setCurrentQuestionIndex(index); +// const submitted = submittedQuestions.find(sub => sub.questionIndex === index); + +// if (submitted) { +// setCode(submitted.code); +// setTestResult(submitted); +// } else { +// setCode(CODE_TEMPLATES[selectedLanguage]); +// setTestResult(null); +// } +// setRunResult(null); +// }; + +// const handleLanguageChange = (e) => { +// const newLanguage = e.target.value; +// setSelectedLanguage(newLanguage); + +// const isSubmitted = submittedQuestions.some(sub => sub.questionIndex === currentQuestionIndex); +// if (!isSubmitted) { +// setCode(CODE_TEMPLATES[newLanguage]); +// } + +// setTestResult(null); +// setRunResult(null); +// }; + +// const handleFinalSubmit = () => { + + +// const finalResults = { +// sessionId, +// totalScore: score, +// maxScore: questions.length * 10, +// questionsAttempted: submittedQuestions.length, +// questionsTotal: questions.length, +// timeUsed: TIME_LIMIT - timeLeft, +// timeLimit: TIME_LIMIT, +// submissions: submittedQuestions.map(sub => ({ +// dsaTopicId: sub.dsaTopicId, +// questionId: sub.questionId, +// topic: sub.topic, +// title: sub.title, +// code: sub.code, +// score: sub.score, +// passed: sub.allPassed, +// testsPassed: sub.passedTests, +// totalTests: sub.totalTests +// })), +// timestamp: new Date().toISOString() +// }; + +// console.log('Final Interview Results:', finalResults); +// nav('/'); +// }; + +// if (loading) { +// return ( +//

+//
+//
+//

Loading interview session...

+//

Fetching DSA topics and generating questions

+//
+//
+// ); +// } + +// if (error) { +// return ( +//
+//
+// +//

Error

+//

{error}

+// +//
+//
+// ); +// } + +// if (!questions.length) { +// return ( +//
+//
+//

No questions available for this session.

+//
+//
+// ); +// } + +// const currentQuestion = questions[currentQuestionIndex]; +// const isSubmitted = submittedQuestions.some(sub => sub.questionIndex === currentQuestionIndex); + +// return ( +//
+// {/* Header */} +//
+//
+//
+//
+//

DSA Interview Platform

+//

Session ID: {sessionId}

+//
+//
+//
+// +// +// {formatTime(timeLeft)} +// +//
+//
+// Score: {score}/{questions.length * 10} +//
+//
+//
+//
+//
+ +//
+// {/* Question Navigation */} +//
+// {questions.map((q, index) => { +// const submission = submittedQuestions.find(sub => sub.questionIndex === index); +// return ( +// +// ); +// })} +//
+ +//
+// {/* Question Panel */} +//
+//
+//
+//
+//

{currentQuestion.title}

+//
+// +// {currentQuestion.difficulty} +// +// +// {currentQuestion.topic} +//
+//
+// {isSubmitted && ( +//
+// {testResult.allPassed ? : } +// +// {testResult.allPassed ? 'Passed' : 'Failed'} +// +//
+// )} +//
+//
+ +//
+//
+//

Problem Description

+//
+// {currentQuestion.description} +//
+//
+ +//
+//

Sample Test Case

+//
+//
Input: {currentQuestion.sampleInput}
+//
Output: {currentQuestion.sampleOutput}
+//
+//
+ +// {currentQuestion.hints && ( +//
+//

Hints

+//
    +// {currentQuestion.hints.map((hint, index) => ( +//
  • {hint}
  • +// ))} +//
+//
+// )} + +// {runResult && ( +//
+//

+// Your Output: ({runsLeft[currentQuestionIndex] || 0} runs left) +//

+// {runResult.isOutput ? ( +//
+//
+//
Actual:
+//
{runResult.message}
+//
+//
+//
Expected:
+//
{runResult.expected}
+//
+//
+// {String(runResult.message).trim() === String(runResult.expected).trim() +// ? '✓ Output matches expected' +// : '⚠ Output differs from expected'} +//
+//
+// ) : ( +//
{runResult.message}
+// )} +//
+// )} + +// {testResult && ( +//
+//
+//
+// {testResult.allPassed ? : } +// +// {testResult.allPassed ? 'All Tests Passed!' : 'Some Tests Failed'} +// +//
+// +// {testResult.passedTests}/{testResult.totalTests} tests passed +// +//
+//
+// Score: {testResult.score}/10 points +//
+//
+// )} +//
+//
+ +// {/* Code Editor Panel */} +//
+//
+//
+//

+// +// Code Editor +//

+// +//
+//
+ +//
+//