A full-stack health dashboard demonstrating React, Node.js, and Agentic AI (Model Context Protocol / MCP) integration. Structured as an npm workspaces monorepo and configured for deployment with Vercel Services.
The project is structured into three distinct services:
Mini-Health-Dashboard/
├── frontend/ # React + Vite SPA (Client UI)
├── backend/ # Express.js + TypeScript (API Gateway & MCP Client)
├── mcp-server/ # Model Context Protocol Server (AI Biomarker Tools)
├── vercel.json # Vercel Services & Rewrites configuration
└── package.json # Root workspaces & unified scripts
- Stack: React 18, Vite, Tailwind CSS, Recharts, React Router.
- Role: Interactive patient dashboard displaying vitals, metabolic, and cardiovascular biomarkers.
- Features: Real-time metric simulation, charts, error boundaries (with
/503service unavailable redirect), and automated code splitting (manualChunks). - Networking: Requests
/apivia Vite development proxy (in dev) or relative path rewritten directly to the backend service (on Vercel). Configured viaVITE_API_URL.
- Stack: Express.js, TypeScript, Vitest, Supertest.
- Role: Secure API Gateway and data provider.
- Endpoints:
GET /api/patients: List all seeded patients.GET /api/patients/:id: Get detailed patient profile.GET /api/patients/:id/biomarkers: Query biomarkers by patient and category.POST /api/patients/:id/analyze: Triggers AI analysis via the MCP server.GET /api/health: Service health check.
- MCP Client: Spawns and communicates with
mcp-serverviaStdioClientTransportwith linkedInMemoryTransportfallback.
- Stack: TypeScript,
@modelcontextprotocol/sdk, Zod. - Role: Dedicated Model Context Protocol server exposing AI tools:
analyze_biomarkers: Evaluates metrics against clinical target ranges and flags potential health risks (cardiovascular, diabetes, cardiac alerts).suggest_monitoring_priorities: Computes deviations from reference bounds to recommend targeted biomarker monitoring priorities.
- Communication: Runs on
stdiotransport, connected to the backend client.
The project uses Vercel Services in vercel.json to build and deploy the polyglot monorepo atomically under a single deployment:
{
"services": {
"frontend": {
"root": "frontend",
"framework": "vite"
},
"backend": {
"root": "backend"
},
"mcp-server": {
"root": "mcp-server"
}
},
"rewrites": [
{
"source": "/api(/.*)?",
"destination": {
"type": "service",
"service": "backend"
}
},
{
"source": "/(.*)",
"destination": {
"type": "service",
"service": "frontend"
}
}
]
}- Node.js (v18+)
- npm (v9+)
Clone the repository and install all workspace dependencies from the root:
git clone https://github.com/taypyc/Mini-Health-Dashboard.git
cd Mini-Health-Dashboard
npm installCopy .env.example to .env (or configure in frontend/.env):
cp .env.example .env| Variable | Default | Description |
|---|---|---|
VITE_API_URL |
/api |
Base URL for frontend API calls. Proxied to backend in development. |
PORT |
3001 |
Local port for Express backend server. |
Run from the root directory:
Start the MCP server build, backend API, and Vite frontend dev server concurrently:
npm run dev- Frontend:
http://localhost:5173 - Backend API:
http://localhost:3001
Builds all services in correct dependency sequence (mcp-server -> backend -> frontend):
npm run buildIndividual service builds:
npm run build:mcp: Compilesmcp-server/srctomcp-server/distviatsc.npm run build:backend: Compilesbackend/srctobackend/distviatsc.npm run build:frontend: Compiles Vite React app tofrontend/dist.
Execute unit and integration tests across services:
# Run backend tests (Vitest + Supertest)
npm test --prefix backend
# Run frontend tests (Vitest + React Testing Library + JSDOM)
npm test --prefix frontend- Open the frontend in your browser (
http://localhost:5173). - Select a patient from the patient directory.
- Click "Get AI Insights" to trigger the MCP biomarker analysis.
- Toggle "Live Updates" to simulate real-time patient biomarker fluctuation.