AI-powered system for morphometric measurement and ATC scoring of cattle and buffaloes from side-view images.
- 🐄 AI-based breed classification for cattle and buffaloes
- 📏 Automated morphometric measurements (body length, heart girth, height, hip width)
- 📊 ATC scoring and body condition assessment
- 📈 Dashboard with analytics and charts
- 🔐 JWT authentication
- 🌙 Dark/light mode
- 📱 Responsive design
- Frontend: React 18, Vite, TailwindCSS, Recharts, Framer Motion, Zustand
- Backend: Node.js, Express, MongoDB, Mongoose, JWT
- Tools: Multer (uploads), bcryptjs, helmet, CORS
- Node.js 18+
- MongoDB running locally or a MongoDB Atlas URI
# Install all dependencies
npm run install:all
# Copy and configure environment
cp server/.env.example server/.env
# Edit server/.env with your MongoDB URI and JWT secret
# Seed sample data
npm run seed
# Start development (both client and server)
npm run devAfter seeding: demo@example.com / password123
URL - bovisionai.vercel.app
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register | Register user |
| POST | /api/auth/login | Login |
| GET | /api/auth/me | Get current user |
| PUT | /api/auth/profile | Update profile |
| PUT | /api/auth/password | Change password |
| GET | /api/classifications | List classifications |
| POST | /api/classifications | Create classification (multipart) |
| GET | /api/classifications/:id | Get single classification |
| DELETE | /api/classifications/:id | Delete classification |
| GET | /api/classifications/dashboard | Dashboard stats |
The classification engine uses Google Gemini Vision API (free tier) as the primary AI backend:
| Engine | Purpose | Cost |
|---|---|---|
| Gemini 2.0 Flash (primary) | Species, breed, BCS, measurements, ATC — all in one vision call | Free (1500 req/day) |
| Local Python ML service (optional fallback) | CLIP + Keras + OpenCV pipeline | Self-hosted |
- Cattle (10): Holstein Friesian, Jersey, Angus, Hereford, Brahman, Sahiwal, Gir, Red Sindhi, Tharparkar, Ongole
- Buffalo (10): Murrah, Nili-Ravi, Surti, Mehsana, Jaffarabadi, Bhadawari, Nagpuri, Pandharpuri, Toda, Marathwadi
Gemini Vision API → Local ML Service (if configured) → Random fallback
Vercel (Frontend) → Render (Node API) → Gemini Vision API (free)
No separate ML service to deploy — the Node backend calls Google Gemini directly.
Go to aistudio.google.com/apikey and create a key (free, instant).
Set these environment variables on Render:
MONGODB_URI=<your-mongodb-atlas-uri>
JWT_SECRET=<your-secret>
CLIENT_URL=https://bovisionai.vercel.app
GEMINI_API_KEY=<your-free-gemini-key>
CLOUDINARY_CLOUD_NAME=<your-cloudinary>
CLOUDINARY_API_KEY=<your-key>
CLOUDINARY_API_SECRET=<your-secret>
Update VITE_API_URL in Vercel env vars to point to your Render backend URL.
├── server/ # Express API
│ ├── config/ # DB & app config
│ ├── controllers/ # Route handlers
│ ├── middleware/ # Auth, upload, errors
│ ├── models/ # Mongoose schemas
│ ├── routes/ # API routes
│ ├── services/ # Classification engine (Gemini + ML fallback)
│ ├── ml-service/ # Python ML microservice (optional fallback)
│ │ ├── predict_service.py # CLIP + Keras + OpenCV pipeline
│ │ ├── bovision_ai_classifier.h5 # Trained species model
│ │ ├── Dockerfile # For Docker deploy
│ │ └── requirements.txt # Python dependencies
│ └── seed.js # Sample data seeder
├── client/ # React SPA
│ └── src/
│ ├── components/ # UI components
│ ├── pages/ # Route pages
│ ├── stores/ # Zustand stores
│ ├── services/ # API client
│ └── hooks/ # Custom hooks
└── README.md