feat: replace mock data with live MongoDB CRUD + fix hydration + AI s…#8
feat: replace mock data with live MongoDB CRUD + fix hydration + AI s…#8abhayshaw1601 wants to merge 1 commit into
Conversation
|
@abhayshaw1601 is attempting to deploy a commit to the mayank10123's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi @Mayank10123 , Could you please add the gssoc'26 and level:advance/intermediate (as u feel) labels to this PR and issue so it can be tracked on the GSSoC leaderboard? Thank you! |
|
Hi, @Mayank10123 is there any issue with the changes ? If any issue u can see then tell me I will resolve it ASAP |
|
i can't understand what exactly you did coz the things you mentioned above either were already there or were not needed in app |
|
Hey @abhayshaw1601! Saw your work on GSSoC 2026. We are building TermUI, a TypeScript terminal UI framework with React-style hooks and JSX, rendered entirely in the terminal. We have 74 unassigned GSSoC issues open across widgets, hooks, adapters, and CLI tooling. Your JavaScript background transfers directly. Karanjot, TermUI maintainer |
PR Description: Transition Mock Data to Dynamic MongoDB Integration, Hydration Resolutions, and Python AI Service Stabilization
Fixing ISSUE #5
Overview
This Pull Request transitions the application's core dashboard and profile metrics from hardcoded static mock datasets to a fully dynamic, stateful database integration backed by MongoDB (Mongoose) and the Express backend server. It also resolves critical runtime React hydration errors in the Next.js client, crashes in the FastAPI Python AI service, and improves git hygiene across the monorepo.
🛠️ Key Changes Included
1. Database Integration & Dynamic Schemas
server/routes/userRoutes.js): Added robustGET/PUT /profileandGET/PUT /progressREST API endpoints with automatic self-healing fallback constructors that automatically initialize baseline records for newly authenticated Firebase SSO users.UserandProgressschemas to persist target roles, daily active streaks, total experience points (XP), weekly change offsets, and recent activity logs.server/seed.js): Isolated all developer test data into a dedicated, clean database seeder. Developers can wipe and repopulate their local MongoDB databases by runningnpm run seed.2. Zero-State Onboarding Architecture
0%placement probability,0 XP,0 streak, and with a fresh onboarding checklist containingpendingtasks (ready for them to check off).client/app/page.js): Binded all dashboard gauges, weekly change subtexts, active day circles (M, T, W, T, F, S, S), and the 4 AI Brain progress bars to real-time database state (no hardcoded indicators remaining!).+0%for new profiles created today), and red if negative.3. Critical Hydration & FastAPI Bug Resolutions
layout.jsintoglobals.cssand deleted the inline<style>element inside the head, resolving the React runtime hydration crash (Text content does not match server-rendered HTML).ai_service/main.py): Fixed a critical crash in the Python AI Service where the/mentor/contextendpoint attempted to parse a rawdictbody instead of a valid Pydantic model. Added a strictMentorContextPayloadschema..gitignore): Added local Python virtual environments (.venv/,venv/,env/,.env/) and the privateai_service/.envfile containing live Groq API keys to the root.gitignoreto prevent secret leaks and keep commit packages clean.How to Test
Step 1: Initialize & Seed the Developer Demo Environment
Verify that the standalone database seeder functions correctly and creates a fully loaded, realistic environment for testing:
serverdirectory and run:http://localhost:3000(defaults to themayank@example.comseeded account).68%with a green+4% this weeksubtext.14 Day Streakwith all 7 days (M to S) lit up green.Level 3 Executive (1240 / 2000 XP).Step 2: Test Onboarding & Zero-State for a New User
Verify that a newly registered user starts at a clean, zero-progress state without pre-filled mock clutter:
0%.+0% this weekin a muted, neutral slate-grey (indicating a fresh profile created today!).0 Day Streak.Level 1 Executive (0 / 2000 XP)with an empty progress bar.pendingtasks (Setup Career Focus Area,Generate AI Guided Roadmap,Upload Initial Resume Draft).Step 3: Test Real-Time Data Persistence
Verify that changes made from the UI instantly update MongoDB and update your dashboard live:
Staff Systems EngineerorPrincipal Architect), and click Save.Step 4: Verify Python AI Service Stability
Verify that the AI service compiles and handles requests gracefully without crashing:
ai_service./mentor/contextqueries now parse correctly through the Pydantic schema and call the LLaMA 3.1 LLM without crashing.Impact
npm run seed) seeds a highly realistic environment.