Skip to content

Path2Wellness is a healthcare web application designed to support patients through ENT operation preparation and recovery, while also guiding expectant mothers through pregnancy and postpartum care. It provides personalized resources, structured routines, and AI-powered assistance for better well-being.

Notifications You must be signed in to change notification settings

Kaps59/Path-2-wellness

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Path2Wellness Unified Navigation System

A centralized React Router-based navigation system that integrates all Path2Wellness applications with role-based routing and authentication.

๐ŸŽฏ Overview

The unified app serves as the main entry point for the Path2Wellness monorepo, providing seamless navigation between different applications based on user roles.

๐Ÿ—๏ธ Architecture

unified-app/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ Homepage.jsx           # Landing page with Get Started button
โ”‚   โ”‚   โ”œโ”€โ”€ ProfileManagement.jsx  # Login/Authentication page
โ”‚   โ”‚   โ”œโ”€โ”€ PatientPortal.jsx      # Patient dashboard wrapper
โ”‚   โ”‚   โ”œโ”€โ”€ DoctorDashboard.jsx    # Doctor dashboard wrapper
โ”‚   โ”‚   โ”œโ”€โ”€ AdminDashboard.jsx     # Admin dashboard wrapper
โ”‚   โ”‚   โ”œโ”€โ”€ ProtectedRoute.jsx     # Route protection component
โ”‚   โ”‚   โ””โ”€โ”€ NotFound.jsx           # 404 error page
โ”‚   โ”œโ”€โ”€ contexts/
โ”‚   โ”‚   โ””โ”€โ”€ AuthContext.jsx        # Authentication state management
โ”‚   โ”œโ”€โ”€ App.jsx                    # Main router configuration
โ”‚   โ””โ”€โ”€ main.jsx                   # Application entry point
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ vite.config.js
โ”œโ”€โ”€ tailwind.config.js
โ””โ”€โ”€ Dockerfile

๐Ÿš€ Navigation Flow

1. Homepage โ†’ Get Started

  • Route: /
  • Component: Homepage
  • Action: "Get Started" button navigates to /profile-management
  • Features:
    • Modern landing page with feature showcase
    • Automatic redirect to dashboard if already logged in
    • Responsive design with Tailwind CSS

2. Profile Management (Login)

  • Route: /profile-management
  • Component: ProfileManagement
  • Features:
    • Email/username and password authentication
    • Demo credentials for testing
    • Integration with existing authentication APIs
    • Automatic role-based redirection after login

3. Role-Based Dashboards

Patient Portal

  • Route: /home/*
  • Component: PatientPortal
  • Access: Patients only
  • Features: Health dashboard, appointments, medical records

Doctor Dashboard

  • Route: /doctor-dashboard/*
  • Component: DoctorDashboard
  • Access: Doctors only
  • Features: Patient management, escalation tickets, schedule

Admin Dashboard

  • Route: /admin-dashboard/*
  • Component: AdminDashboard
  • Access: Admins only
  • Features: User management, system monitoring, analytics

๐Ÿ” Authentication System

API Endpoints

The unified app integrates with existing authentication systems:

  1. Primary: PathAI API (http://localhost:5002/api/auth/login)
  2. Fallback: Profile Management API (http://localhost:3004/api/auth/users/login)

Demo Credentials

// Admin Access
Email: admin@path2wellness.com
Password: Admin123!@#

// Doctor Access  
Email: doctor@path2wellness.com
Password: Doctor123!@#

// Patient Access
Email: patient@path2wellness.com
Password: Patient123!@#

Authentication Flow

  1. User enters credentials on /profile-management
  2. System attempts login via PathAI API
  3. If PathAI fails, fallback to Profile Management API
  4. On success, JWT token stored in localStorage
  5. User redirected based on role:
    • Patient โ†’ /home
    • Doctor โ†’ /doctor-dashboard
    • Admin โ†’ /admin-dashboard

๐Ÿ›ก๏ธ Route Protection

ProtectedRoute Component

  • Checks authentication status
  • Validates user roles
  • Redirects unauthorized users
  • Shows loading states during authentication

Route Configuration

// Public Routes
/ (Homepage)
/profile-management (Login)
/404 (Not Found)

// Protected Routes
/home/* (Patient only)
/doctor-dashboard/* (Doctor only)  
/admin-dashboard/* (Admin only)

๐ŸŽจ UI/UX Features

Design System

  • Framework: React 18 with Vite
  • Styling: Tailwind CSS
  • Icons: Lucide React
  • Theme: Modern gradients with glassmorphism effects

Responsive Design

  • Mobile-first approach
  • Adaptive layouts for all screen sizes
  • Touch-friendly interface elements

User Experience

  • Smooth transitions and animations
  • Loading states and error handling
  • Intuitive navigation patterns
  • Accessibility considerations

๐Ÿš€ Getting Started

Development Mode

cd unified-app
npm install
npm run dev

Access at: http://localhost:3001

Production Build

npm run build
npm run preview

Docker Deployment

docker build -t path2wellness-unified .
docker run -p 3000:3000 path2wellness-unified

๐Ÿ”ง Configuration

Environment Variables

The app automatically detects and connects to:

  • Profile Management API: http://localhost:3004
  • PathAI API: http://localhost:5002

Vite Configuration

  • Path aliases for clean imports
  • Development server with HMR
  • Production optimizations

๐Ÿงช Testing the System

Manual Testing Steps

  1. Homepage Navigation

  2. Authentication Testing

    • Use demo credentials to test each role
    • Verify proper dashboard redirection
    • Test logout functionality
  3. Route Protection

    • Try accessing protected routes without login
    • Verify role-based access restrictions
    • Test invalid route handling (404)

Integration Points

  • โœ… MongoDB Atlas authentication
  • โœ… JWT token management
  • โœ… Role-based access control
  • โœ… Existing API compatibility

๐Ÿ“ Monorepo Structure

Path2Wellness/
โ”œโ”€โ”€ apps/
โ”‚   โ”œโ”€โ”€ homepage/              # Legacy homepage (port 5173)
โ”‚   โ”œโ”€โ”€ profile-management/    # Auth backend (port 3004)
โ”‚   โ”œโ”€โ”€ home/                  # Patient portal (port 3001)
โ”‚   โ”œโ”€โ”€ doctor-dashboard/      # Doctor dashboard (port 3002)
โ”‚   โ””โ”€โ”€ admin-dashboard/       # Admin dashboard (port 3003)
โ”œโ”€โ”€ unified-app/               # Main navigation app (port 3001)
โ”œโ”€โ”€ pathAi/                    # AI system (port 5002)
โ””โ”€โ”€ docker-compose.yml         # Container orchestration

๐Ÿ”„ Migration Notes

From Individual Apps

  • Each app maintains its existing functionality
  • Unified app provides centralized entry point
  • Existing APIs remain unchanged
  • Docker configuration updated for new structure

Backward Compatibility

  • Legacy routes still accessible
  • Existing authentication systems preserved
  • Database connections maintained
  • API endpoints unchanged

๐Ÿš€ Deployment

Development

# Start all services
docker-compose up -d

# Or start unified app only
cd unified-app && npm run dev

Production

  • Unified app serves as main entry point on port 3000
  • Individual services run on their respective ports
  • Load balancer can route to unified app
  • CDN integration for static assets

๐Ÿ“Š Performance

Optimizations

  • Code splitting by route
  • Lazy loading of components
  • Optimized bundle sizes
  • Fast refresh in development

Monitoring

  • Authentication success rates
  • Route navigation patterns
  • Error tracking and logging
  • Performance metrics

๐Ÿ”ฎ Future Enhancements

Planned Features

  • Single Sign-On (SSO) integration
  • Multi-factor authentication
  • Advanced role permissions
  • Real-time notifications
  • Progressive Web App (PWA) features

Scalability

  • Micro-frontend architecture ready
  • API gateway integration
  • Horizontal scaling support
  • Multi-tenant capabilities

๐ŸŽ‰ Success Metrics

โœ… Unified Navigation: Single entry point for all applications
โœ… Role-Based Routing: Automatic redirection based on user roles
โœ… Folder-Based Structure: Clean monorepo organization
โœ… Authentication Integration: Works with existing MongoDB Atlas system
โœ… Modern UI/UX: Professional healthcare application design
โœ… Docker Ready: Full containerization support
โœ… Production Ready: Optimized builds and deployment configuration

The unified navigation system successfully integrates all Path2Wellness applications into a cohesive, role-based healthcare management platform.

About

Path2Wellness is a healthcare web application designed to support patients through ENT operation preparation and recovery, while also guiding expectant mothers through pregnancy and postpartum care. It provides personalized resources, structured routines, and AI-powered assistance for better well-being.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.7%
  • Other 0.3%