AyurTrace is a comprehensive blockchain-based supply chain traceability system designed to address the ₹5,000+ crore annual losses from fake Ayurvedic products in India. The system provides end-to-end transparency from farm to consumer using cutting-edge technology.
- Herb selection (Ashwagandha, Brahmi, Tulsi, Neem, Turmeric, Amla)
- Automatic GPS coordinate capture
- A/B/C quality grading system
- Timestamp recording with seasonal validation
- Unique batch ID generation with blockchain recording
- Image upload for herbs and harvest conditions
- Available harvested herbs display with filters
- Processing step documentation (drying, grinding, extraction)
- Lab result integration for moisture, pesticides, active compounds
- Batch mixing capabilities
- QR generation for final products
- Camera-based QR scanning and instant verification
- Complete farm-to-shelf journey display
- Blockchain verification against counterfeits
- Interactive map showing herb origins
- Farmer profiles with stories and photos
- Real-time counters for batches, farmers, verifications
- Heat map of herb production regions
- Quality grade distribution and seasonal patterns
- Pricing trends with farmer income tracking
- Live blockchain transaction display
- Transaction search by hash or batch ID
- Cryptographic proof display
- Network status monitoring
- Backend: Node.js with Express.js
- Database: MongoDB for off-chain data
- Blockchain: Hyperledger Fabric permissioned network
- Frontend: React.js with responsive design
- Authentication: JWT with role-based access control
- Additional: GPS tracking, QR generation, RESTful APIs
- Farmers: Herb cultivation and harvest recording
- Manufacturers: Processing and product creation
- Consumers: Product verification and transparency
- Government: Ministry of AYUSH oversight and control
- Admins: System maintenance and monitoring
AyurTrace/
├── backend/ # Node.js Express API
│ ├── src/
│ │ ├── controllers/ # API controllers
│ │ ├── middleware/ # Authentication, validation
│ │ ├── models/ # MongoDB schemas
│ │ ├── routes/ # API routes
│ │ ├── services/ # Business logic
│ │ └── utils/ # Helper functions
│ ├── tests/ # Backend tests
│ └── config/ # Configuration files
├── frontend/ # React.js application
│ ├── src/
│ │ ├── components/ # Reusable components
│ │ ├── pages/ # Page components
│ │ ├── services/ # API services
│ │ ├── utils/ # Helper functions
│ │ └── assets/ # Images, styles
│ └── public/ # Static files
├── blockchain/ # Hyperledger Fabric network
│ ├── chaincodes/ # Smart contracts
│ ├── network/ # Network configuration
│ └── scripts/ # Deployment scripts
├── docs/ # Documentation
└── scripts/ # Utility scripts
- Node.js (v16+)
- Docker & Docker Compose
- MongoDB
- Git
git clone https://github.com/Prajjwal2051/AyurTrace.git
cd AyurTracecd backend
npm install
cp .env.example .env
# Configure environment variables
npm run devcd frontend
npm install
npm startcd blockchain
./scripts/setup-network.sh
./scripts/deploy-chaincode.shcd scripts
node seed-database.jsCreate .env files in backend directory:
# Server Configuration
NODE_ENV=development
PORT=3001
# Database
MONGODB_URI=mongodb://localhost:27017/ayurtrace
MONGODB_TEST_URI=mongodb://localhost:27017/ayurtrace_test
# JWT
JWT_SECRET=your-super-secret-jwt-key
JWT_EXPIRE=7d
# Blockchain
FABRIC_NETWORK_PATH=../blockchain/network
CHAINCODE_NAME=ayurtrace
CHANNEL_NAME=ayurchannel
# External Services
GPS_API_KEY=your-gps-api-key
QR_SERVICE_URL=http://localhost:3002POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/profile- Get user profile
GET /api/farmer/dashboard- Farmer overviewPOST /api/farmer/add-batch- Create herb batchGET /api/farmer/batches- Get farmer's batches
GET /api/manufacturer/available-batches- Available herbsPOST /api/manufacturer/process-batch- Add processing stepsGET /api/manufacturer/products- Get products
GET /api/consumer/verify/:batchId- Verify productGET /api/consumer/journey/:batchId- Get supply chain journey
GET /api/dashboard/stats- Real-time statisticsGET /api/dashboard/analytics- Comprehensive metrics
GET /api/blockchain/transactions- Recent blockchain activityGET /api/blockchain/block/:id- Get block details
cd backend
npm testcd frontend
npm testnpm run test:integration# Build all services
docker-compose build
# Start the application
docker-compose up -d
# View logs
docker-compose logs -f# Build for production
npm run build:prod
# Deploy to cloud
npm run deploy- Backend:
http://localhost:3001/api/health - Frontend:
http://localhost:3000 - Blockchain:
http://localhost:7054
- Application logs:
logs/app.log - Error logs:
logs/error.log - Blockchain logs:
blockchain/logs/
- JWT-based authentication
- Role-based access control (RBAC)
- Input validation and sanitization
- Rate limiting
- Data encryption
- GDPR compliance
- Secure blockchain transactions
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, contact:
- Technical Issues: [[email protected]]
- Business Inquiries: [[email protected]]
- Government Relations: [[email protected]]
- Ministry of AYUSH, Government of India
- Hyperledger Foundation
- Open source community
- Ayurvedic farmers and manufacturers
Built for Smart India Hackathon 2025 Addressing the ₹5,000+ crore problem of fake Ayurvedic products