Priocardix AI uses a decoupled microservices architecture:
- Frontend (Guardian AI Sentinel): React, Vite, Tailwind CSS, Framer Motion, and Three.js (
react-three-fiber). - Backend (ML PulseIQ Interface): FastAPI, Scikit-Learn (Simulated Neural Engine), and Uvicorn.
Important: To enable the ultra-realistic "Guardian Elite" 3D visualization, you must independently download a .glb human heart model (e.g., from Sketchfab or Poly Pizza) and place it directly into the frontend directory before running:
/frontend/public/heart.glbIf this file is missing, the system will launch using a safe procedural medical primitive fallback.
Priocardix AI has two parts running simultaneously:
- Frontend β React + Vite app β
localhost:5173 - ML Backend β FastAPI (Python) β
localhost:8000 - Guardian Brain β Zustand (runs entirely client-side, no extra server needed)
Important
The Guardian Brain (Zustand store with localStorage persistence) is self-contained in the frontend. Even without the backend running, the simulation engine will still work β demonstrating live vitals, anomaly detection, emergency protocols, and all UI features.
- Node.js 18+ (
node --version) - Python 3.9+ (
python --version) - pip (
pip --version)
cd services/ml-service
pip install -r requirements.txt
python -m uvicorn app.main:app --reload --port 8000β
Backend running at: http://localhost:8000
β
Swagger API docs: http://localhost:8000/docs
cd frontend
npm install
npm run devβ
Frontend running at: http://localhost:5173
| Role | Login | Password |
|---|---|---|
| Doctor (Demo) | doctor@hospital.com |
admin |
| Patient | Register via /signup |
β |
| File | Purpose |
|---|---|
frontend/src/store/healthStore.js |
Global Guardian Brain (Zustand v4.0 β all state including Workspace Expansion) |
frontend/src/hooks/useGuardianEngine.js |
Autonomous Sentinel Engine (3-second deterministic simulation loop) |
frontend/src/components/EmergencySystem.jsx |
Multi-tier emergency lifecycle (Warning β Dispatch β Acknowledged) |
frontend/src/components/RiskMap.jsx |
Global Leaflet map with expansion zones |
frontend/src/components/AuditLogPanel.jsx |
Real-time event audit log |
frontend/src/pages/DigitalTwin.jsx |
3D Heart command center + patient selector + speed control |
frontend/src/layouts/MainLayout.jsx |
Global system mode, AI thinking, Universal Expansion Hub, Logo persistence |
- Push project to GitHub
- Go to render.com β New Web Service
- Connect repo β set root directory to
services/ml-service - Build Command:
pip install -r requirements.txt - Start Command:
uvicorn app.main:app --host 0.0.0.0 --port $PORT
- Go to vercel.com β New Project β Import from GitHub
- Set root directory to
frontend - Framework: Vite
- Build command:
npm run build - Output directory:
dist
The Guardian Brain uses Zustand persist middleware with the key priocardix-guardian-elite-v4.
| Data | Stored In | Persists? |
|---|---|---|
| Vitals + History | localStorage (Guardian Brain) |
β Yes β survives reload |
| Workspace State | localStorage (Guardian Brain) |
β Yes β expands globally |
| Personalization | localStorage (Guardian Brain) |
β Yes |
| Audit Logs | localStorage (Guardian Brain) |
β Yes |
| Auth Session | localStorage (authStore) |
β Yes |
Before any presentation:
- Backend running (
python -m uvicorn app.main:app --port 8000 --reload) - Frontend running (
npm run dev) in a separate terminal - Browser open to
http://localhost:5173 - Test Global Expansion: Click the floating chevron in the bottom-left to expand the workspace. Verify logo visibility.
- Test Determinism: Use the same BP/Stress inputs twice. Verify identical Risk and BPM output (no jitter).
- Check Accuracy: Verify Simulation Accuracy shows realistically between 85-88%.
- Switch patient profile: Change to "Senior" profile β verify risk jumps predictably.
- Enable 5x speed mode: Verify simulation accelerates.
- Set BP to 180: Trigger emergency lifecycle.
- Test "Reset Simulation": Verify all vitals and workspace state return to baseline.
| Problem | Solution |
|---|---|
| Floating Button missing | Check z-index conflict in custom components |
| No BPM Jitter? | Intentional β system is now deterministic for medical consistency |
| Accuracy seems low | Re-calibrated to 85-88% for professional clinical realism |
| 3D heart not loading | Ensure heart.glb is in /frontend/public/ |
| Sidebar won't expand | Global state block β refresh or Reset Simulation |
| Map not showing | Check Leaflet CSS import in RiskMap.jsx |