Skip to content

4E-org/Blocate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

43 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯🩺 BLocate: Decentralized Health Monitoring

BLocate Project Banner

A decentralized health monitoring system using ESP32 IoT sensors, blockchain, and a modern dashboard. Eliminates single points of failure and enables permissionless deployment.


πŸš€ Project Overview

BLocate enables real-time monitoring of patient vitals (heart rate, temperature, GPS location) through a fully decentralized architecture:

  • βœ… Real-time Monitoring (IoT sensors)
  • βœ… Smart Geofencing (auto alerts)
  • βœ… AI Health Interpretation (Gemini AI)
  • βœ… Immutable Blockchain Verification
  • βœ… Decentralized Storage (GunDB)
  • βœ… Guardian Alerts
  • βœ… Modern Frontend Dashboard

πŸ› οΈ Tech Stack

Backend:

Frontend:


πŸ—οΈ Architecture

picture 0

picture 2

No REST API required β€” frontend reads directly from blockchain + GunDB!


πŸ‘€ User Flow

picture 1


πŸ“‹ 5 Steps to Run the Repository

1️⃣ Install Dependencies Backend & Frontend

cd backend && npm install
cd ../frontend && npm install

2️⃣ Configure Backend Environment

cd ../backend
cp .env.example .env

# Edit the .env file with the following data:

# NODE_ID=patient-guardian-node-1
# NODE_ENV=development

# MQTT_BROKER=mqtt://localhost:1883
# MQTT_USERNAME=
# MQTT_PASSWORD=

# TON_RPC=https://eth-sepolia.g.alchemy.com/v2/YOUR_ALCHEMY_API_KEY
# TON_PRIVATE_KEY=your_wallet_private_key_here
# TON_CONTRACT_ADDRESS=0x0000000000000000000000000000000000000000

# SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_ALCHEMY_API_KEY
# PRIVATE_KEY=your_wallet_private_key_here

# GEMINI_API_KEY=your_gemini_api_key_here
# GEMINI_API_URL=https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent
# AI_ENABLED=true
# AI_FALLBACK_MESSAGE=AI Unavailable

3️⃣ Run MQTT Broker

# Windows
mosquitto -v
# Mac/Linux
brew install mosquitto && mosquitto -v

4️⃣ Start Backend & Frontend

# Backend
cd backend
npm start
# Frontend (new terminal)
cd frontend
npm run dev

5️⃣ Test Data & Dashboard

# Publish sample data to MQTT (new terminal):
mosquitto_pub -h localhost -t "patient/test-001/telemetry" -m '{"deviceId":"test-001","bpm":75,"temp":36.5,"gps":"14.5995,120.9842","timestamp":1700000000}'
# Buka dashboard di browser:
http://localhost:3000

πŸ“‚ Directory Structure

Blocate/
β”œβ”€β”€ backend/   # Node.js backend, smart contracts, MQTT, GunDB
β”œβ”€β”€ frontend/  # Next.js dashboard
└── README.md  # Root project info

🀝 Contributing

Pull requests and issues are welcome! Please follow conventional commit messages and ensure code is linted before submitting.


πŸ‘₯ Developer Team – 4E

BLocate Development Team
J. David
Faculty of Engineering
Hakim N.
Faculty of Computer Science
Bryan H.
Faculty of Engineering
Laura F.S.
Faculty of Engineering

Built for decentralized healthcare.

About

Backend & Frontend for B-Locate

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors