How mukulsonker/curana-risk-compass works
Project type and purpose
• From the README and file tree, this is a single-page dashboard application built with Vite + React + TypeScript, styled with Tailwind CSS and shadcn-ui component library. It provides various “pages” (e.g., CareGapReports, PatientRiskTable) presenting healthcare metrics via charts, tables, and widgets. No backend services are in this repo—it’s purely a front-end client consuming mock data for demonstration.
File structure
• Top-level config/build files:
• vite.config.ts, tsconfig*.json, postcss.config.js, tailwind.config.ts, package.json, bun.lockb, package-lock.json
• Public/static assets:
• public/robots.txt, index.html
• Source code under src/:
• main.tsx – app entry point, mounts React tree
• App.tsx & App.css – root layout, global styles
• pages/ – route components (e.g., Index.tsx, PatientRiskTable.tsx)
• components/ – reusable UI parts and domain-specific cards, tables, charts
• components/ui/ – primitive UI building blocks from shadcn-ui (buttons, dialogs, inputs, etc.)
• hooks/ – custom React hooks (use-mobile, use-toast)
• services/mockData.ts – data layer providing sample data
• lib/utils.ts – shared utility functions
• types/ – TypeScript interfaces for dashboard data
• No backend, no microservices; follows a component-driven, single-page-app (SPA) architecture.
README for additional insights
• Confirms tech stack: Vite, TypeScript, React, shadcn-ui, Tailwind CSS
• Deployment model: static hosting via Lovable, no server-side code
a. Main components
• Browser/client
• Static asset host (e.g., Lovable’s CDN or any static file server)
• Vite build pipeline (dev server & bundler)
• React SPA
• UI library (shadcn-ui + Tailwind)
• Data layer (mockData service)
• Custom hooks & utils
b. Relationships & interactions
• Browser requests index.html from static host → loads bundled JS/CSS
• main.tsx initializes React Router → renders App → routes to pages
• Each page imports domain components (e.g., PatientTable, RiskTierChart)
• Components invoke services/mockData to fetch data → pass into charts/tables
• UI primitives (components/ui) are composed by domain components
• Hooks (use-mobile, use-toast) intercede in component logic (responsiveness, notifications)
c. Architectural patterns/principles
• SPA with client-side routing (React Router implied)
• Component-driven design: primitive UI layer vs. domain components vs. pages
• Unidirectional data flow: services → components → UI
• Separation of concerns: hooks for cross-cutting concerns, utils for pure functions, types for contracts
d. Relevant technologies
• Vite (dev server + bundler)
• React + ReactDOM + React Router
• TypeScript
• Tailwind CSS
• shadcn-ui primitives