Skip to content

veranyagaka/Bazaar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

90 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Bazaar - Market Match Platform for Farmers 🌾

A web-first platform connecting small-scale farmers with better market opportunities through real-time pricing data, buyer matching, and transparent agricultural commerce.

πŸš€ Demo & Resources

πŸ“Œ Table of Contents

🎯 Problem Statement

Small-scale farmers often lack access to:

  • Real-time market pricing information
  • Direct connections to buyers
  • Transparent pricing mechanisms
  • Efficient distribution channels
  • Low-quality produce

This leads to financial losses, market inefficiencies, and limited growth opportunities.

πŸ’‘ Solution

Bazaar provides a comprehensive web platform that:

  • Live Market Prices: Real-time crop pricing across different markets
  • Buyer Matching: Algorithm-driven connections between farmers and buyers
  • Crop Disease Detection: Enables real-time analysis of crop health
  • Price Alerts: Notifications for optimal selling opportunities
  • Trend Analysis: Historical data and market predictions
  • Direct Communication: In-app messaging or WhatsApp integration

πŸ“ Prompts & AI Guidance

Bazaar leverages advanced prompt engineering and AI tools (Lovable, Copilot, Claude AI, Rork) to accelerate development and ensure a robust, user-focused platform.
We use carefully crafted prompts for both web and mobile app planning, debugging, and feature ideationβ€”including AI-powered crop disease detection and market matching.

  • Lovable & Claude AI: For web-first and mobile-first project planning, tech stack selection, UI/UX guidelines, and database design.
  • Copilot: For TypeScript and code debugging prompts.
  • Rork: For mobile app architecture, API, and feature prompts.
  • v0: For refining the web architecture and crafting a readable README.
  • AI Feature Prompts: For integrating crop disease detection, analytics, and dashboard extensions.

πŸ‘‰ View the full prompts documentation on Notion

πŸ› οΈ Tech Stack

Frontend Backend Auth UI & Styling Dev Tools
React + TypeScript Supabase (PostgreSQL) Clerk Shadcn/ui, Tailwind CSS Vite, Lovable.dev+Supabase
React Native + Expo Supabase Realtime Magic Links Lucide React, Recharts GitHub, Rork.app, v0

πŸ–Ό Screenshots

Bazaar Insights Landscape Bazaar App Welcome Screen Bazaar Dashboard Disease Detection Screen Buyer Matches Screen Disease Detection Disease Detection Disease Detection Bazaar Analytics Landscape

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ and npm
  • Clerk account
  • Supabase project

Installation

  1. Clone the repository

    git clone https://github.com/veranyagaka/Bazaar.git
    cd bazaar
    
    # **Install dependencies
    npm install**
  2. Set up Clerk Authentication

  3. Set up Supabase

    • Connect your Lovable project to Supabase using the green button
    • Run the SQL schema from SUPABASE_SETUP.md
    • Configure Row Level Security policies
  4. Start development server

    npm run dev
    

πŸ” User Access & Flow

1. Authentication Journey

  • Landing Page – Hero section with value proposition
  • Sign Up – Choose role (Farmer / Buyer)
  • Onboarding – Complete profile and set preferences
  • Dashboard – Role-specific features

2. User Types & Features

Role Key Actions
🌾 Farmers Add crops, set prices/quality, view buyer matches, receive alerts, track sales
πŸͺ Buyers Post needs, browse produce, set alerts, connect with farmers, manage procurement
πŸ‘¨β€πŸ’Ό Admins Manage market data, verify users, analytics, moderation

πŸ—οΈ Project Structure

public/                 # Static Files i.e images
server/                 # Backend for AI assistant
src/
β”œβ”€β”€ components/          # Reusable UI components
β”‚   β”œβ”€β”€ Navigation.tsx   # Main navigation bar
β”‚   β”œβ”€β”€ Hero.tsx        # Landing page hero section
β”‚   β”œβ”€β”€ MarketFeed.tsx  # Live market prices display
β”‚   β”œβ”€β”€ ChatWidget.tsx
β”‚   β”œβ”€β”€ RoleOnboarding.tsx
β”‚   β”œβ”€β”€ FarmerDashboard.tsx
β”‚   β”œβ”€β”€ BuyerDashboard.tsx
β”‚   └── Footer.tsx           
β”œβ”€β”€ pages/              # Page components
β”‚   β”œβ”€β”€ AdminDashbord.tsx
β”‚   β”œβ”€β”€ Alerts.tsx
β”‚   β”œβ”€β”€ Buyers.tsx
β”‚   β”œβ”€β”€ DiseaseDetection.tsx
β”‚   β”œβ”€β”€ Markets.tsx
β”‚   β”œβ”€β”€ Index.tsx       # Main landing/dashboard page
β”‚   └── NotFound.tsx    # 404 error page
β”œβ”€β”€ types/              # TypeScript type definitions
β”‚   └── index.ts        # Core data models
β”œβ”€β”€ hooks/              # Custom React hooks
β”œβ”€β”€ lib/                # Utility functions
β”‚   β”œβ”€β”€ supabaseClient.tsx       
└── styles/             # Global styles and themes

πŸ“ˆ Roadmap

Phase 1 (Current)

  • User authentication and profiles
  • Basic farmer and buyer dashboards
  • Market price display
  • Responsive design implementation

Phase 2 (Next)

  • Advanced matching algorithm
  • Real-time price data integration
  • Full mobile app development

Phase 3 (Future)

  • Payment integration
  • AI-powered price predictions
  • Multi-language support

TECHNICAL IMPLEMENTATION OF FEATURES

Market Matching System 🎯

Quick Overview

The Market Matching System intelligently connects farmers with potential buyers using a sophisticated algorithm that analyzes location, crop type, quantity, price preferences, and delivery requirements.

Key Features

  • Smart Matching Algorithm: Weighted scoring system (Location 30%, Price 25%, Quantity 20%, Delivery 15%, Recency 10%)
  • Real-time Results: Instant matching with buyers based on farmer preferences
  • Advanced Filtering: Filter by match score, distance, price range, and delivery dates
  • Market Insights: Analytics showing average match scores, best prices, and market demand
  • Secure Communication: Protected contact system with Clerk authentication

Core Components

Component Purpose
MarketMatch Main interface for crop input and preferences
MatchResults Displays matched buyers with scores and details
MatchFilters Advanced filtering and sorting options

Tech Stack

Frontend Backend AI/ML Data Warehouse Analytics
React + TypeScript Supabase Edge Functions OpenAI GPT-4o Vision Azure Synapse / AWS Redshift / Google BigQuery Real-time Dashboards
Tailwind CSS PostgreSQL with RLS Custom Agricultural Prompts ETL Pipelines Predictive Modeling
Microsoft Fabric Warehouse Azure Synapse Analytics

Quick Stats

  • 17+ Supported Crops: Comprehensive crop type coverage
  • 30% Minimum Match Score: Quality threshold for displayed results
  • Multi-factor Scoring: Location, price, quantity, delivery, and recency
  • Real-time Updates: Live market data integration

Getting Started

  1. Navigate to /market-match (authentication required)
  2. Input crop details and preferences
  3. Review matched buyers sorted by compatibility score
  4. Connect with buyers using built-in communication tools

πŸ“– View Complete Technical Documentation

The full documentation includes detailed architecture diagrams, database schemas, API specifications, security considerations, testing strategies, and deployment guidelines.

AI Crop Disease Detection System πŸŒ±πŸ€–

Quick Overview

An intelligent system that uses OpenAI Vision API (GPT-4o) to detect crop diseases in real-time, integrated with comprehensive data warehousing for agricultural analytics and market intelligence.

Key Features

  • AI-Powered Detection: Real-time crop disease identification using advanced computer vision
  • High Accuracy Analysis: Confidence scoring, severity assessment, and treatment recommendations
  • Data Warehousing: ETL pipelines for agricultural analytics and market intelligence
  • Predictive Analytics: Yield forecasting, outbreak prediction, and economic impact modeling
  • Real-time Dashboards: Live disease monitoring, market intelligence, and alert systems

Core Components

Component Purpose
OpenAI Vision Integration Real-time disease detection and analysis
Edge Functions Image processing and API orchestration
Data Warehouse Sync Analytics aggregation and insights
Predictive Models Yield forecasting and risk assessment

System Architecture

Frontend (React) ↔ Supabase Edge Functions ↔ OpenAI Vision API
                           ↓
                   Supabase Database
                           ↓
                   Data Warehouse (Azure/AWS/GCP)

AI Crop Disease Detection with AI Bazaar chatbot

Detection Capabilities

  • 17+ Crop Types: Comprehensive coverage of Kenyan agricultural crops
  • Disease Identification: Automated pathogen detection and classification
  • Severity Assessment: Mild, moderate, severe, and critical classifications
  • Treatment Recommendations: Actionable intervention strategies
  • Economic Impact: Yield loss estimation and market impact analysis

Tech Stack

Frontend Backend AI/ML Data Warehouse Analytics
React + TypeScript Supabase Edge Functions OpenAI GPT-4o Vision Azure Synapse / AWS Redshift / Google BigQuery Real-time Dashboards
Tailwind CSS PostgreSQL with RLS Custom Agricultural Prompts ETL Pipelines Predictive Modeling

Quick Stats

  • 89% Average Confidence: High-accuracy disease detection
  • Real-time Processing: Instant analysis and recommendations
  • Multi-cloud Support: Azure, AWS, and GCP integration options
  • Comprehensive Analytics: Disease patterns, market correlations, yield predictions

Getting Started

  1. Upload crop image through the web interface
  2. AI analyzes image and identifies potential diseases
  3. Receive detailed assessment with treatment recommendations
  4. Access analytics dashboard for broader insights
  5. Monitor disease patterns and market impacts

πŸ“– View Complete Technical Documentation

The full documentation includes detailed system architecture, API specifications, database schemas, setup instructions for multiple cloud providers, security considerations, cost optimization strategies, and implementation roadmaps.

πŸ”’ Security & Testing

  • βœ… Authentication: Clerk handles secure user authentication
  • βœ… Authorization: Role-based access control (RBAC)
  • βœ… Data Protection: Row Level Security in Supabase
  • βœ… API Security: Protected endpoints and rate limiting
  • βœ… Input Validation: Client and server-side validation
  • βœ… Manual testing of flows (signup β†’ match β†’ chat)

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘₯ Contributors


Made with ❀️ for farmers and sustainable agriculture

Empowering small-scale farmers through technology and transparent markets.

About

Bazaar - Market Match Platform for Farmers 🌾

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages