https://github.com/sosane/agriculture-product-tracking-chain
Designing blockchain model for agriculture product tracking - INF4523 course (UQO)
https://github.com/sosane/agriculture-product-tracking-chain
blockchain blockchain-technology development ethereum node nodejs postgres postgresql postgresql-database project react reactjs school school-education school-project school-projects smart-contracts solidity solidity-contracts solidity-dapps
Last synced: 6 months ago
JSON representation
Designing blockchain model for agriculture product tracking - INF4523 course (UQO)
- Host: GitHub
- URL: https://github.com/sosane/agriculture-product-tracking-chain
- Owner: SOSANE
- License: mit
- Created: 2025-04-19T15:53:33.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-04-23T13:47:57.000Z (6 months ago)
- Last Synced: 2025-04-23T19:24:49.693Z (6 months ago)
- Topics: blockchain, blockchain-technology, development, ethereum, node, nodejs, postgres, postgresql, postgresql-database, project, react, reactjs, school, school-education, school-project, school-projects, smart-contracts, solidity, solidity-contracts, solidity-dapps
- Language: TypeScript
- Homepage:
- Size: 987 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# *AgriChain* : Blockchain for product tracking
[](LICENSE)
A decentralized solution for tracking agricultural products through their lifecycle using blockchain technology.
Designing blockchain model for agriculture product tracking involves using the inherent characteristics of blockchain - decentralisation, immutability and transparency - to track agricultural products through every stage of their lifecycle. This include everything from production, processing, transportation, and distribution, to retail. Below are the essential details for building such a blockchain system.
**April 2025**
- mock data (for now)
- implement next : smart contracts, role-specific functionalities, qr scannerHome page

Authentification page

Analytics page

## Table of Contents
- [Features](#features)
- [Project Structure](#project-structure)
- [Prerequisites](#prerequisites)
- [Setup Guide](#setup-guide)
- [Running the System](#running-the-system)
- [Test Accounts](#test-accounts)
- [License](#license)## Features
- Role-based authentication (Admin, Farmer, Processor, Distributor, Retailer, Regulator)
- Product traceability with blockchain verification
- PostgreSQL database backend
- React frontend dashboard## Project Structure
```
agriculture-product-tracking-chain/
├── agrichain-backend/ # Node.js API server (port 5000)
├── agrichain-database/ # PostgreSQL schemas and scripts
├── agrichain-frontend-react/ # React Vite frontend (port 5173)
└── agrichain-smartcontract/ # Future smart contracts
```## Prerequisites
- Node.js v18+
- npm v9+
- PostgreSQL 15+ (running on port 5432)
- Git## Setup Guide
### 1. Clone Repository
```bash
git clone https://github.com/SOSANE/agriculture-product-tracking-chain
cd agriculture-product-tracking-chain
```### 2. Backend Setup
```bash
cd agrichain-backend
npm install
cp .env.example .env
```**Edit .env**:
```dotenv
PORT=5000
DB_USER=postgres
DB_HOST=localhost
DB_NAME=agrichain
DB_PASSWORD=your_postgres_password
DB_PORT=5432
SESSION_SECRET=your_session_secret
```### 3. Database Setup
1. Initialize the database:
```bash
createdb agrichain
psql -U postgres -d agrichain -f agrichain-database/commands/init.sql
```Hash the passwords (run once):
```bash
cd agrichain-backend
node hash-passwords.js
```### 4. Frontend Setup
```bash
cd ../agrichain-frontend-react/agrichain-frontend
npm install# Create environment file
echo "VITE_API_URL=http://localhost:5000" > .env
```## Running the System
### 1. Start Backend:
```bash
cd agrichain-backend
npm start
```
### 2. Start Frontend:
```bash
cd ../agrichain-frontend-react/agrichain-frontend
npm run dev
```Access: http://localhost:5173
## Test Accounts
| Role | Username | Password |
|-------------|--------------|---------------|
| Admin | admin | admin123 |
| Farmer | farmer1 | password123 |
| Regulator | regulator1 | securepass |
| Processor | processor1 | process123 |
| Distributor | distributor1 | distribute123 |
| Retailer | retailer1 | retail123 |## Licence
MIT © 2025 AgriChain