> For the complete documentation index, see [llms.txt](https://decentragri.gitbook.io/decentragri.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://decentragri.gitbook.io/decentragri.com/project-details/technical-stack.md).

# Technical Stack

DecentrAgri leverages a modular, scalable architecture composed of open-source technologies and decentralized protocols. Each layer is designed to ensure data reliability, traceability, and usability across diverse agricultural contexts.

| **Layer**            | **Technology Stack**                                                                                                                                                                                                                                                                                                                                                                                 |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Sensor Layer**     | <p>- Custom-built IoT boards using <strong>ESP32</strong> or <strong>STM32</strong> chips with low-power wireless modules (LoRa/Wi-Fi)<br>- Equipped with sensors for <strong>soil pH</strong>, <strong>moisture</strong>, <strong>light intensity</strong>, <strong>temperature</strong>, and <strong>humidity</strong><br>- Solar-powered with fallback battery support for off-grid operation</p> |
| **Edge Processing**  | <p>- Lightweight C++ or MicroPython firmware for on-device preprocessing and calibration<br>- <strong>AES encryption</strong> for secure data packaging before transmission</p>                                                                                                                                                                                                                      |
| **Data Layer**       | <p>- <strong>bun javascript</strong> handle ingestion, validation, and transformation of raw data<br>- <strong>Memgraph</strong> as database with schema validation to enforce data consistency</p>                                                                                                                                                                                                  |
| **Storage Layer**    | <p>- Decentralized file storage using <strong>IPFS</strong> via <strong>Pinata</strong> or <strong>Filebase</strong><br>- Data is structured in <strong>JSON</strong></p>                                                                                                                                                                                                                            |
| **Blockchain Layer** | <p>- NFT minting and metadata anchoring on <strong>Swellchain</strong><br>- Smart contracts written in <strong>Solidity</strong> following ERC-1155 standards (customized for non-transferable utility NFTs)</p>                                                                                                                                                                                     |
| **NFT Metadata**     | <p>- Uses <strong>JSON</strong> schema to link IPFS hash, GPS coordinates, timestamp, sensor type, and consent status<br>- Immutable metadata provides long-term auditability</p>                                                                                                                                                                                                                    |
| **Frontend (UI/UX)** | <p>- Built with <strong>Godot</strong>,<br>- Supports real-time data filtering,dataset downloads<br>- Future-ready for integrating GIS layers and AI insights</p>                                                                                                                                                                                                                                    |
| **Authentication**   | <p>- Traditional Username and Password login but using Web3 Acccount Abstraction<br>- Farmer device pairing and ownership validation via signed device keys</p>                                                                                                                                                                                                                                      |
| **APIs & SDKs**      | <p>- RESTful APIs to access datasets programmatically<br>- SDKs in <strong>JavaScript</strong> and <strong>Python</strong> for data science integration, mobile apps, and external tools</p>                                                                                                                                                                                                         |
