Connect Dashboard to Supabase
9.8/10
Overall Feedback
This is a perfect prompt! You were very clear about what you need. You gave the AI a role, clear steps, and a plan for mistakes.
• google/gemini-3-flash
Your Prompt
Act as a Senior Full-Stack Engineer. The investment flow is complete and working. Categories and allocations are being created correctly. However, the User Dashboard is still displaying mock/static data. Your task is to fully connect the User Dashboard to live Supabase data and remove all mocks. ⸻ REQUIRED FIXES 1️⃣ Portfolio Section (CRITICAL) • Remove all hardcoded portfolio values (e.g. $125,000) • Compute portfolio data from real tables: • investments (parent records) • investment_allocations (child records) • Display: • Total invested amount • Total accrued profit • Active vs completed investments Portfolio must reflect actual user investments only. ⸻ 2️⃣ Recent Transactions • Replace mock transactions with real data from: • transactions • deposits • Show: • Deposits (pending / confirmed) • Investment entries (Auto-Invest + single category) • Admin balance adjustments (labelled clearly) • Order by most recent • Gracefully handle empty states ⸻ 3️⃣ Balance Consistency • Dashboard balance must come from: • profiles.balance + profiles.balance_adjustment • Do NOT recompute balance on the frontend • Ensure balance updates immediately after: • Deposit confirmation • Investment creation • Admin edits ⸻ 4️⃣ Investment Cards Each investment card must show: • Category or “Auto-Invest (Diversified)” • Amount invested • Earned profit (real-time) • Duration & progress • Status (active / completed / paused) ⸻ RULES • ❌ Remove all mock data • ❌ Do not change investment logic • ❌ Do not reset existing user data • ✅ Use existing Supabase tables only • ✅ Reuse current UI components • ✅ Handle loading + empty states cleanly ⸻ BEFORE CODING Briefly confirm: 1. Which dashboard components were using mock data 2. Which queries will replace them 3. Any assumptions made Then implement.
How Did Your Prompt Do?