How nayi-disha-org/nayi-disha works
Nayi-Disha is a family and care-support platform with React role-based portals, an Express/PostgreSQL API, and an ESP32 hardware component. The main flow is a user selecting a role, authenticating, then using care workflows that exchange data with backend routes and database controllers. The README documents additional routines, hardware, AI-notification and weather capabilities; their source excerpts are limited, so those links are shown only where documented or marked unverified.
Main entry points: App.jsx Role portals · server.js Express API server · WeatherEngine.jsx Weather dashboard · PortalLayout.jsx Portal layout
Components 23
Frontend
- Role portals
frontend/src/App.jsx - Role sign-in
frontend/src/pages/auth/RoleAuth.jsx - Session context
frontend/src/context/AuthContext.jsx - Account settings
frontend/src/pages/AccountSettings.jsx - API client
frontend/src/services/api.js - Portal layout
frontend/src/components/PortalLayout.jsx - Brand identity
frontend/src/components/BrandLogo.jsx - Interface icons
frontend/src/components/Icons.jsx
Backend API
- Health routes
backend/routes/healthRoutes.js - Health and care data
backend/controllers/healthController.js - Authentication routes
backend/routes/authRoutes.js - Authentication and profiles
backend/controllers/authController.js - Express API server
backend/server.js - Routine and hardware routes
backend/routes
Care workflows
- Care and role pages
frontend/src/pages - Weather dashboard
frontend/src/pages/features/WeatherEngine.jsx
Platform services
- PostgreSQL pool
backend/config/db.js - Weather engine
backend/utils/weatherEngine.js - LLM notifier
backend/utils/llmNotifier.js - ESP32 band
hardware/esp32_band/config.h - Cloudinary integration
backend/config/cloudinary.js
Other components
- Families and staff
- PostgreSQL service
Connections 28
- Families and staff → Role portals: select role
- Role portals → Role sign-in: routes to
frontend/src/App.jsx - Role sign-in → API client: submits credentials
frontend/src/pages/auth/RoleAuth.jsx - Role sign-in → Session context: updates session
frontend/src/pages/auth/RoleAuth.jsx - Session context → Role portals: provides session
frontend/src/App.jsx - Role portals → Account settings: routes to
frontend/src/App.jsx - Role portals → Care and role pages: routes to
frontend/src/App.jsx - Account settings → API client: requests profile
frontend/src/pages/AccountSettings.jsx - Care and role pages → API client: requests care data
frontend/src/pages/auth/RoleAuth.jsx - Care and role pages → Portal layout: renders pages
frontend/src/pages/features/WeatherEngine.jsx - Weather dashboard → Portal layout: renders within
frontend/src/pages/features/WeatherEngine.jsx - Weather dashboard → Interface icons: renders icon
frontend/src/pages/features/WeatherEngine.jsx - Portal layout → Brand identity: renders logo
frontend/src/components/PortalLayout.jsx - Portal layout → Interface icons: renders icon
frontend/src/components/PortalLayout.jsx - API client → Express API server: calls API
- Express API server → Authentication routes: mounts routes
backend/server.js - Express API server → Health routes: mounts routes
backend/server.js - Authentication routes → Authentication and profiles: dispatches requests
backend/routes/authRoutes.js - Health routes → Health and care data: dispatches requests
backend/routes/healthRoutes.js - Authentication and profiles → PostgreSQL pool: queries users
backend/controllers/authController.js - Health and care data → PostgreSQL pool: queries care data
backend/controllers/healthController.js - PostgreSQL pool → PostgreSQL service: connects to
backend/config/db.js - Express API server → Routine and hardware routes: mounts routes
backend/server.js - Families and staff → Weather dashboard: views forecasts
- Weather dashboard → ESP32 band: syncs warnings
- Weather engine → Weather dashboard: supports forecasts
- LLM notifier → Families and staff: notifies users
- Cloudinary integration → Express API server: optional media integration