A fullstack livestock and agriculture marketplace built with the MERN stack. Features role based dashboards for buyers, sellers, and admins with realtime chat, AI powered image analysis, mandi market integration, and report exports.
# DngarHub
DngarHub is a full-stack livestock and agriculture marketplace built with the MERN stack. It connects buyers, sellers, and vendors on a single platform where they can list, browse, and purchase animals and agriculture products with dedicated dashboards per role and real-time chat between users.
---
## Features
### Buyers
- Browse animal and product listings from the home page
- Filter by category, location, price, and mandi
- Add items to cart or favorites
- Place orders with **cash on delivery** or **online payment**
- View full order history and individual order details
- Real-time chat with sellers
### Sellers / Vendors
- Dashboard with listing stats and recent activity
- Create, edit, and delete animal or product listings
- Upload up to 5 images and 1 video per listing
- **AI-powered image analysis**: upload a photo and auto-fill the breed and estimated weight using Google Gemini
- Track orders placed by buyers
- View analytics for listing performance (views, sales)
- Manage seller profile
### Admins
- Full user management — view, ban, and unban accounts
- Moderate all listings (approve, reject, remove)
- Manage mandis (markets) — create, update, assign listings
- Generate and download **PDF and Excel reports** for sales, users, and listings
---
## AI Image Analysis
Sellers can click **Analyze with AI** while creating a listing to automatically identify the animal's breed and estimate its weight from the uploaded photo.
- **Endpoint**: `POST /api/ai/analyze` (requires seller auth)
- **Model**: Google Gemini via `@google/generative-ai`
- **Returns**: `breed`, `estimated_weight_kg`, `confidence_score`
- **Mock mode**: set `USE_MOCK_AI=true` in `server/.env` to skip API calls during development
---
## Tech Stack
**Frontend**
- React 19 + Vite
- React Router v7
- TailwindCSS v4
- Axios (cookie-based auth)
- Socket.io-client
- Framer Motion
**Backend**
- Node.js + Express
- MongoDB + Mongoose
- JWT authentication via HTTP-only cookies
- Socke …