Backend Architecture

Server Workflow Visualization

An interactive guide to understanding the backend architecture, data flow, and service interactions in the nutmeg traceability system.

System Infrastructure Diagram

📡

IoT Devices

Sensors & GPS

🖥️

MAIN SERVER (cPanel)

LARAVEL App

  • Web Frontend
  • API Endpoint
  • Core Business Logic
  • Database (MySQL/PgSQL)
  • IPFS & Fabric SDK
💾

IPFS Server

IPFS Daemon & Storage

⛓️

HYPERLEDGER Network

Peer, Orderer, Chaincode

Workflow Simulation

Flow 1: IoT Sensor Data Ingestion

1

Data Transmission

IoT Device sends sensor data (temp & humidity) in JSON format.

POST /api/sensor-data\n\n{ "deviceId": "GUDANG-01", "temp": 32 }
2

API Call

Laravel API Endpoint receives the HTTP POST request from the IoT device.

3

Validation & Logging

Laravel Controller validates data and logs it to the database (MySQL/PgSQL).

Flow 2: Traceability Data Recording

1

User Input

Farmer fills out harvest data form via the Laravel web interface.

2

IPFS Interaction

Laravel uploads harvest JSON data to IPFS and receives a CID (hash) back.

3

Reference Recording

Laravel stores the batch ID and IPFS CID into its internal database.

4

Hyperledger Interaction

Laravel invokes Fabric chaincode, sending a transaction containing the CID to the ledger.

5

Confirmation

After transaction commit, Laravel displays a success notification to the user.