WhatNow is a multi-app wellness platform that combines fitness coaching, workout analytics, nutrition planning, restaurant discovery, skin and hair analysis, and a community experience into one connected system.
The codebase is organized as several independent Next.js services that share authentication, data, and navigation context across the platform.
The repository currently contains six user-facing services:
NowWhat/
|- base/ # Port 3000 - login, profile, landing page, AI fitness coach
|- skin-hair-analysis/ # Port 3002 - skin/hair profile, image analysis, recommendations
|- nutrition-wellness/ # Port 3003 - pantry planner, dish optimizer, recipes, insights
|- nutrition-yelp/ # Port 3004 - restaurant discovery, health scoring, food scan
|- fitness-dashboard/ # Port 3005 - workout analytics and trends
|- community/ # Port 3006 - posts, events, mood check-ins, people-like-you
|- docs/ # Project notes, deployment docs, implementation details
High-level flow:
baseacts as the main entry point and navigation hub.- Each module exposes its own UI and API routes.
- MongoDB stores shared user, session, and feature data.
- Gemini powers generation and image-understanding features where unstructured AI is useful.
- Deterministic backend logic handles validation, filtering, scoring, persistence, and fallbacks.
- Email/password registration and login
- Shared session-token authentication across all services
- Secure
httpOnlyauth cookie - Cross-origin auth handoff routes so users can move between services without re-logging in
- Voice-first fitness workflow in the
baseapp - User can request an exercise and generate an analyzer for it
- MediaPipe Pose-based live tracking
- Rep counting, form checks, and spoken feedback
- Session logging to MongoDB
- Session totals and rep totals
- Form, posture, arm-position, and visibility analytics
- Joint symmetry charts
- Daily rep timeline and trend charts
- Mood-linked motivation view
- Nutrition profile with goals, calorie targets, protein targets, preferences, allergies, and restrictions
- Pantry meal generation
- Authentic dish optimization with identity-preserving validation
- Recipe library with save, search, filter, duplicate, and tweak flows
- Custom recipe creation
- Wellness insight cards and session-memory summaries
- Yelp restaurant search by location, category, price, and sort
- AI-generated restaurant health scoring
- Saved favorites and dining-behavior tracking
- Food image scan for calorie and macro estimates
- Skin/hair profile management
- Face and scalp image analysis
- Loved products tracking
- Product recommendation generation
- Rule-based wellness insight generation
- Raw uploaded image bytes are discarded after analysis
- Discussion feed with posts, comments, tags, and upvotes
- Wellness events with RSVP
- Mood check-ins and recent mood history
- "People Like You" discovery
- Floating
What Now? AgentUI in multiple apps - Rebuilds a user context summary from recent activity across modules
- Uses backend tooling to verify personal-data questions against MongoDB instead of guessing
- Frontend: Next.js 14 App Router, React, TypeScript
- Styling: Tailwind CSS
- Database: MongoDB
- Authentication: shared opaque session tokens validated against MongoDB
- AI: Google Gemini API
- Fitness pose tracking: MediaPipe Pose
- Charts and motion: Recharts, Framer Motion
- Voice: Web Speech API, optional ElevenLabs integration
- External APIs and datasets: Yelp Fusion, Open Beauty Facts
The implemented auth flow is:
- A user logs in through the
baseapp. - The server creates a random opaque session token.
- That token is stored in the MongoDB
sessionscollection with an expiry. - The browser receives the token in a secure
httpOnlyauth_tokencookie. - When the user opens another service, an auth handoff route creates a short-lived handoff grant and sets the same session token cookie on the target origin.
- Each service validates the cookie by looking up the session in MongoDB.
- Logout deletes the stored session and clears the cookie.
This gives centralized session invalidation and consistent login state across services.
- Node.js 20+
- npm
- MongoDB connection string
- Gemini API key
- Yelp API key for
nutrition-yelp
From the repo root:
npm run setupCopy each app's example env file to .env.local:
base/.env.local.exampleskin-hair-analysis/.env.local.examplenutrition-wellness/.env.local.examplenutrition-yelp/.env.local.examplefitness-dashboard/.env.local.examplecommunity/.env.local.example
Common variables used across apps:
MONGODB_URI=...
MONGODB_DB=wellbeing_app
GEMINI_API_KEY=...
NEXT_PUBLIC_BASE_URL=http://localhost:3000
NEXT_PUBLIC_FITNESS_URL=http://localhost:3005
NEXT_PUBLIC_NUTRITION_URL=http://localhost:3003
NEXT_PUBLIC_RESTAURANTS_URL=http://localhost:3004
NEXT_PUBLIC_SKIN_URL=http://localhost:3002
NEXT_PUBLIC_COMMUNITY_URL=http://localhost:3006Service-specific extras:
nutrition-yelp:YELP_API_KEYbase: optionalNEXT_PUBLIC_ELEVENLABS_API_KEYnutrition-wellness: optionalNUTRITION_MEMORY_CRON_SECRET
Note:
- Some env examples still include legacy
JWT_SECRETfields from an older auth approach. Those are stale compatibility leftovers and are not the active auth mechanism described above.
From the repo root:
npm run devThis starts:
baseonhttp://localhost:3000skin-hair-analysisonhttp://localhost:3002nutrition-wellnessonhttp://localhost:3003nutrition-yelponhttp://localhost:3004fitness-dashboardonhttp://localhost:3005communityonhttp://localhost:3006
Then open:
http://localhost:3000
If needed:
cd base && npm run dev
cd skin-hair-analysis && npm run dev
cd nutrition-wellness && npm run dev
cd nutrition-yelp && npm run dev
cd fitness-dashboard && npm run dev
cd community && npm run devImportant collections used across the platform include:
userssessionsuser_profilesfitness_sessionsfitness_exercise_biomechanicsnutrition_profilespantry_itemsgenerated_recipessaved_recipesrecipe_modificationsnutrition_insight_memorynutrition_sessions_summaryskin_hair_profilesskin_logshair_logsloved_productsproduct_recommendationsfavoritesclickscommunity_postscommunity_commentscommunity_moodscommunity_eventscommunity_connections
Each service includes its own deployment assets, including Dockerfiles and env examples under each service's deployment/ directory.
The current deployment docs target containerized deployment, with the broader repository plan documented in:
DEPLOYMENT.mdbase/deployment/README.mdcommunity/deployment/README.mdfitness-dashboard/deployment/README.mdnutrition-wellness/deployment/README.mdnutrition-yelp/deployment/README.mdskin-hair-analysis/deployment/README.md
Additional notes live in docs/, including:
docs/HOW_TO_RUN.mddocs/SESSION_NOTES.mddocs/AUTH_IMPLEMENTATION.mddocs/AUTHENTICATION_SUMMARY.md
- Check the
NEXT_PUBLIC_*_URLvariables in every app's.env.local. - Make sure all apps are running on the expected localhost ports.
- Confirm the
baseapp can create sessions in MongoDB. - Confirm the target service can reach the same MongoDB instance.
- Check that cross-app handoff URLs match your local ports.
- Verify
GEMINI_API_KEYis present in the app using that feature. nutrition-yelpalso needsYELP_API_KEY.- Many AI-backed flows include deterministic or mock fallbacks, but some features still require the upstream key to be present for full functionality.
- Re-run
npm run setup - Delete stale
.nextfolders if necessary - Restart the affected service