diff --git a/backend/check_enum.py b/backend/check_enum.py new file mode 100644 index 0000000..07b532c --- /dev/null +++ b/backend/check_enum.py @@ -0,0 +1,9 @@ +import asyncio +from sqlmodel import create_engine, text + +DATABASE_URL = "postgresql://pragativeer_admin:local_secure_password_2026@postgres:5432/pragativeer_prod" +engine = create_engine(DATABASE_URL) + +with engine.connect() as conn: + result = conn.execute(text("SELECT unnest(enum_range(NULL::tierenum));")) + print(result.fetchall()) diff --git a/backend/check_tier.py b/backend/check_tier.py new file mode 100644 index 0000000..bb33878 --- /dev/null +++ b/backend/check_tier.py @@ -0,0 +1,9 @@ +import asyncio +from sqlmodel import create_engine, text + +DATABASE_URL = "postgresql://pragativeer_admin:local_secure_password_2026@postgres:5432/pragativeer_prod" +engine = create_engine(DATABASE_URL) + +with engine.connect() as conn: + result = conn.execute(text("SELECT email, tier FROM \"user\" LIMIT 10;")) + print(result.fetchall()) diff --git a/backend/find_amit.py b/backend/find_amit.py new file mode 100644 index 0000000..73ebaa0 --- /dev/null +++ b/backend/find_amit.py @@ -0,0 +1,15 @@ +import asyncio +from sqlmodel import create_engine, select, Session +import sys +sys.path.append('backend') +import models + +DATABASE_URL = "postgresql://pragativeer_admin:local_secure_password_2026@postgres:5432/pragativeer_prod" +engine = create_engine(DATABASE_URL) + +with Session(engine) as session: + amit = session.exec(select(models.User).where(models.User.name == "Amit Kumar")).first() + if amit: + print(f"Amit Kumar: {amit.id}, {amit.tier}, {amit.target_exam}") + else: + print("Amit Kumar not found") diff --git a/backend/fix_tier.py b/backend/fix_tier.py new file mode 100644 index 0000000..7ad0fe7 --- /dev/null +++ b/backend/fix_tier.py @@ -0,0 +1,10 @@ +import asyncio +from sqlmodel import create_engine, text + +DATABASE_URL = "postgresql://pragativeer_admin:local_secure_password_2026@postgres:5432/pragativeer_prod" +engine = create_engine(DATABASE_URL) + +with engine.connect() as conn: + conn.execute(text("UPDATE \"user\" SET tier = 'AI Coach' WHERE tier = 'Al_Coach';")) + conn.commit() + print('Updated successfully') diff --git a/backend/list_tests.py b/backend/list_tests.py new file mode 100644 index 0000000..feb2bdf --- /dev/null +++ b/backend/list_tests.py @@ -0,0 +1,14 @@ +import asyncio +from sqlmodel import create_engine, select, Session +import sys +sys.path.append('backend') +import models + +DATABASE_URL = "postgresql://pragativeer_admin:local_secure_password_2026@postgres:5432/pragativeer_prod" +engine = create_engine(DATABASE_URL) + +with Session(engine) as session: + tests = session.exec(select(models.Test)).all() + print(f"Total Tests: {len(tests)}") + for t in tests: + print(t.id, t.title) diff --git a/backend/test_api_tests.py b/backend/test_api_tests.py new file mode 100644 index 0000000..63abca4 --- /dev/null +++ b/backend/test_api_tests.py @@ -0,0 +1,18 @@ +import asyncio +from sqlmodel import create_engine, select, Session +import sys +sys.path.append('backend') +import models + +DATABASE_URL = "postgresql://pragativeer_admin:local_secure_password_2026@postgres:5432/pragativeer_prod" +engine = create_engine(DATABASE_URL) + +with Session(engine) as session: + user = session.exec(select(models.User).where(models.User.name == "Amit Kumar")).first() + print(f"User: {user.name}, Tier: {user.tier}, Exam: {user.target_exam}") + + query = select(models.Test).where(models.Test.is_active == True).where(models.Test.type != "DPS") + tests = session.exec(query).all() + print(f"Tests returned from DB (excluding DPS): {len(tests)}") + for t in tests: + print(f" - {t.title} ({t.exam_pattern})") diff --git a/src/app/dashboard/ai-coach/cbt-dpp/[id]/page.tsx b/src/app/dashboard/ai-coach/cbt-dpp/[id]/page.tsx index cbf1d3f..d96f2d8 100644 --- a/src/app/dashboard/ai-coach/cbt-dpp/[id]/page.tsx +++ b/src/app/dashboard/ai-coach/cbt-dpp/[id]/page.tsx @@ -103,7 +103,7 @@ export default function AIComCBTDPPPage() { } return ( -
+
{/* Top Header */}
diff --git a/src/app/dashboard/ai-coach/cbt-dpp/page.tsx b/src/app/dashboard/ai-coach/cbt-dpp/page.tsx index 622276e..2ac76c0 100644 --- a/src/app/dashboard/ai-coach/cbt-dpp/page.tsx +++ b/src/app/dashboard/ai-coach/cbt-dpp/page.tsx @@ -235,7 +235,7 @@ export default function AIDailyPracticePage() { {/* ── PROTECTED PDF READER MODAL (FREE TIER) ── */} {selectedPdfDpp && ( -
+
{/* Modal Header */}
diff --git a/src/app/dashboard/ai-coach/college-predictor/page.tsx b/src/app/dashboard/ai-coach/college-predictor/page.tsx index 3200cbe..e6f4db1 100644 --- a/src/app/dashboard/ai-coach/college-predictor/page.tsx +++ b/src/app/dashboard/ai-coach/college-predictor/page.tsx @@ -36,7 +36,7 @@ export default function CollegePredictorPage() { const maxRank = Math.max(...CUTOFF_TRENDS.map(d => d.rank)) return ( -
+
{/* Page Header */}
diff --git a/src/app/dashboard/ai-coach/heatmap/page.tsx b/src/app/dashboard/ai-coach/heatmap/page.tsx index 29d3c08..df2a614 100644 --- a/src/app/dashboard/ai-coach/heatmap/page.tsx +++ b/src/app/dashboard/ai-coach/heatmap/page.tsx @@ -35,7 +35,7 @@ export default function HeatmapPage() { const criticalTopics = isDemo ? DEMO_CRITICAL_TOPICS : [] return ( -
+
{/* Page Header */}
diff --git a/src/app/dashboard/ai-coach/page.tsx b/src/app/dashboard/ai-coach/page.tsx index 0805357..621f836 100644 --- a/src/app/dashboard/ai-coach/page.tsx +++ b/src/app/dashboard/ai-coach/page.tsx @@ -60,7 +60,7 @@ export default function AICoachDashboard() { if (!hasAccessTo("ai-mistake-tracking")) { return ( -
+
@@ -89,7 +89,7 @@ export default function AICoachDashboard() { const currentStreakDays = `${user?.streak_count || (isDemo ? 12 : 1)} d` return ( -
+
{/* ── METRICS BAR ── */}
diff --git a/src/app/dashboard/ai-coach/readiness/page.tsx b/src/app/dashboard/ai-coach/readiness/page.tsx index 51ab68d..bbd3ebe 100644 --- a/src/app/dashboard/ai-coach/readiness/page.tsx +++ b/src/app/dashboard/ai-coach/readiness/page.tsx @@ -32,7 +32,7 @@ export default function ReadinessPage() { const maxScore = Math.max(1, ...scoreHistory.map(d => d.score)) return ( -
+
{/* Page Header */}
diff --git a/src/app/dashboard/ai-coach/strategy/page.tsx b/src/app/dashboard/ai-coach/strategy/page.tsx index 9c836e5..0bd03fa 100644 --- a/src/app/dashboard/ai-coach/strategy/page.tsx +++ b/src/app/dashboard/ai-coach/strategy/page.tsx @@ -24,7 +24,7 @@ export default function StrategyPage() { const negMarkingData = isDemo ? DEMO_NEG_MARKING_DATA : ZERO_NEG_MARKING_DATA return ( -
+
{/* Page Header */}
diff --git a/src/app/dashboard/ai-coach/study-plan/page.tsx b/src/app/dashboard/ai-coach/study-plan/page.tsx index df196bb..5fa029a 100644 --- a/src/app/dashboard/ai-coach/study-plan/page.tsx +++ b/src/app/dashboard/ai-coach/study-plan/page.tsx @@ -12,7 +12,7 @@ export default function StudyPlanPage() { const streakCount = user?.streak_count || (isDemo ? 12 : 1) return ( -
+
{/* Page Header */}
diff --git a/src/app/dashboard/ai-coach/time-optimization/page.tsx b/src/app/dashboard/ai-coach/time-optimization/page.tsx index 3fc701b..569564b 100644 --- a/src/app/dashboard/ai-coach/time-optimization/page.tsx +++ b/src/app/dashboard/ai-coach/time-optimization/page.tsx @@ -69,7 +69,7 @@ export default function TimeOptimizationPage() { ] return ( -
+
{/* Page Header */}
diff --git a/src/app/dashboard/ai-coach/tutor/page.tsx b/src/app/dashboard/ai-coach/tutor/page.tsx index 70bb981..1771997 100644 --- a/src/app/dashboard/ai-coach/tutor/page.tsx +++ b/src/app/dashboard/ai-coach/tutor/page.tsx @@ -12,7 +12,7 @@ const CAPABILITIES = [ export default function TutorChatPage() { return ( -
+
{/* Page Header */}
diff --git a/src/app/dashboard/ai-coach/weekly-progress/page.tsx b/src/app/dashboard/ai-coach/weekly-progress/page.tsx index b16ae57..e4512c2 100644 --- a/src/app/dashboard/ai-coach/weekly-progress/page.tsx +++ b/src/app/dashboard/ai-coach/weekly-progress/page.tsx @@ -41,7 +41,7 @@ export default function WeeklyProgressPage() { const syllabusProgress = isDemo ? DEMO_SYLLABUS_PROGRESS : ZERO_SYLLABUS_PROGRESS return ( -
+
{/* Page Header */}
diff --git a/src/app/dashboard/cbt/history/[attemptId]/page.tsx b/src/app/dashboard/cbt/history/[attemptId]/page.tsx index 65d85c1..92d2909 100644 --- a/src/app/dashboard/cbt/history/[attemptId]/page.tsx +++ b/src/app/dashboard/cbt/history/[attemptId]/page.tsx @@ -88,7 +88,7 @@ export default function AttemptHistoryPage({ params }: { params: Promise<{ attem const maxScore = attempt.total_questions * 4; return ( -
+
{test?.type === 'DPS' ? 'Back to PrepPilot AI' : 'Back to Tests'} diff --git a/src/app/dashboard/cbt/page.tsx b/src/app/dashboard/cbt/page.tsx index 6c6ec22..bdf7b0a 100644 --- a/src/app/dashboard/cbt/page.tsx +++ b/src/app/dashboard/cbt/page.tsx @@ -337,7 +337,7 @@ export default function CBTPage() {
{showUpgradeModal && ( -
+
diff --git a/src/app/dashboard/community/page.tsx b/src/app/dashboard/community/page.tsx index 457dd48..0094cd6 100644 --- a/src/app/dashboard/community/page.tsx +++ b/src/app/dashboard/community/page.tsx @@ -95,7 +95,7 @@ export default function CommunityPage() { if (!hasAccessTo("doubt-resolution-community")) { return ( -
+
@@ -214,7 +214,7 @@ export default function CommunityPage() { {/* Expanded Replies Section */} {expandedDoubtId === doubt.id && ( -
+
AI @@ -262,7 +262,7 @@ export default function CommunityPage() {
{/* Ask Doubt Modal */} {isAskModalOpen && ( -
+

diff --git a/src/app/dashboard/dpp/page.tsx b/src/app/dashboard/dpp/page.tsx index bdf5c6a..1a335c7 100644 --- a/src/app/dashboard/dpp/page.tsx +++ b/src/app/dashboard/dpp/page.tsx @@ -232,7 +232,7 @@ export default function DPPPage() { {/* ── PROTECTED PDF READER MODAL (FREE TIER) ── */} {selectedPdfDpp && ( -
+
{/* Modal Header */}
diff --git a/src/app/dashboard/layout.tsx b/src/app/dashboard/layout.tsx index 668e982..9dee182 100644 --- a/src/app/dashboard/layout.tsx +++ b/src/app/dashboard/layout.tsx @@ -428,7 +428,7 @@ export default function DashboardLayout({ children }: { children: ReactNode }) { {/* Scrollable page body */}
-
+
{children}
diff --git a/src/app/dashboard/materials/page.tsx b/src/app/dashboard/materials/page.tsx index f60ff0d..0281b01 100644 --- a/src/app/dashboard/materials/page.tsx +++ b/src/app/dashboard/materials/page.tsx @@ -119,7 +119,7 @@ export default function MaterialsPage() { {/* ── PROTECTED STUDY MATERIAL PDF READER MODAL ── */} {selectedPdf && ( -
+
{/* Modal Header */}
diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index 18cd4f0..16dd1a3 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -112,7 +112,7 @@ export default function DashboardPage() { const isNeet = user?.target_exam === "NEET" return ( -
+
{/* Basic Performance Dashboard (F-05) */}
@@ -134,7 +134,7 @@ export default function DashboardPage() { {downloading ? 'Generating...' : 'Share Card'} {shareMenuOpen && ( -
+