Nivarra is a highly polished, culturally tailored menopause transition assistant designed for women (aged 38–65) managing perimenopause, active menopause, and post-menopause. Crafted with a premium, high-contrast Editorial Aesthetic, Nivarra provides holistic Ayurvedic remedies, clinical laboratory reports logging, dynamic Harmony Score computation, a reflective mindful journal, and support communities.
This repository is optimized for development sandboxing, SaaS scale-up, and is 100% production-ready for deployment using Next.js, Clerk, Supabase, Razorpay, Resend, PostHog, Sentry, Upstash Redis, and Pinecone!
The codebase utilizes a dual-capability architecture designed to run as a single-page full-stack Express+Vite application inside sandboxes, which can be seamlessly migrated/exported to Next.js (App Router).
All major SaaS integrations are written as lazy-initialized modules (src/lib/integrations/*) with secure, elegant runtime fallbacks:
- Database & Storage (Supabase): Live cloud sync of logs, clinical labs, journals and profiles. Falls back securely to local storage when inactive.
- User Authentication (Clerk): Multi-social login (Email, Google) matching Clerk JWTs. Falls back to immediate local sandbox clinical profiles when deactivated.
- Payments (Razorpay Checkout): Native dynamic script-loading of India's leading payment gateway supporting UPI, Netbanking, Cards, and Wallets. Falls back to simulated sandbox tracking when toggled.
- Transactional Emails (Resend): Handles automated clinical registrations, welcome packets and purchase invoices. Logs safely to server consoles when offline.
- Caching & Security (Upstash Redis): Restricts API abuse and rate-limits the Gemini AI Companion engine.
- AI Vector Database (Pinecone): Generates 768-dimension semantic embeddings via Gemini (
text-embedding-004) to query Ayurvedic remedy inventories.
- Aesthetic Enhancements: Improved dark mode support, updating typography and systemic text colors (e.g. customized Nivarra Rose and slate shades) for increased readability in the Store & Wellness views.
- Branding Integration: Migrated the core Nivarra logo as the universal application favicon for seamless browser integration.
- Git Hygiene: Refined and modernized
.gitignoreconfigurations aligned with best-practice Vite/Node.js structures.
├── server.ts # Full-stack backend Express server with Sentry, Redis, and APIs
├── vite.config.ts # Vite asset compiling pipelines
├── package.json # Direct deployment lock entries
├── supabase/
│ └── schema.sql # Core database schema, indices, & Row Level Security (RLS) rules
├── src/
│ ├── main.tsx # React mounting entry point
│ ├── App.tsx # Primary router & view controller
│ ├── app/ # Main platform modules & pages
│ │ ├── DashboardPage.tsx # Clinical stats & somatic stretches
│ │ ├── StorePage.tsx # Ayurvedic Remedies store with Razorpay
│ │ ├── WellnessPage.tsx # Daily comfort logs, lab panels, & Harmony Scores
│ │ ├── MindspacePage.tsx # Mindful reflective journal with prompts
│ │ └── SettingsPage.tsx # Secure clinical records configuration
│ ├── lib/
│ │ ├── dbStore.ts # Modular Local offline-first data manager
│ │ └── integrations/ # Multi-SaaS production adapters
│ │ ├── clerk.ts # Clerk Auth bridge
│ │ ├── supabase.ts # Supabase Client CRUD
│ │ ├── razorpay.ts # Razorpay checkout modal triggers
│ │ ├── resend.ts # Resend email triggers
│ │ ├── redis.ts # Upstash Redis rate limiter
│ │ └── pinecone.ts # Pinecone Vector Search
│ └── types/
│ └── index.ts # Safe shared typescript interface schemas- Node.js v18+
- npm v9+
Install base dependencies:
npm installRuns both Vite frontend assets compilation and the Express API server on unified port 3000:
npm run devOpen http://localhost:3000 in your browser.
Performs a strict TypeScript compilation (tsc) and bundles optimized production assets into /dist:
npm run build- Strong Types Only: All interfaces are defined cleanly in
/src/types/index.ts. No implicitanyvariables permitted. - Atomic Components: Avoid monolithic components; sub-widgets are modularly declared.
- Accented Themes: Fully supports high-contrast Light and Dark rendering modes styled elegantly with responsive Tailwind margins.