AI-powered warehouse automation system that eliminates counting errors, provides video proof, and tracks operator performance—all with complete data privacy.
Features • Tech Stack • Installation • Usage • Documentation
BoxGuard is an intelligent warehouse automation system built for NEXUS 2025 that uses YOLOv8-powered computer vision to count boxes in real-time, eliminating manual counting errors while maintaining complete data privacy through local processing.
- ✅ 95%+ Accuracy: Custom-trained YOLOv5 model for box detection
- 🎥 Video Evidence: Automatic recording of every packing session
- 📄 Instant Challans: Auto-generated PDF documents with QR codes
- 📊 Operator Analytics: Comprehensive performance tracking and insights
- 🔒 100% Local: No cloud dependencies, complete data privacy
- YOLOv5-powered computer vision with sub-50ms latency
- Custom-trained model achieving 95%+ accuracy on warehouse boxes
- Live box counting with visual feedback
- Adjustable confidence threshold (0-100%)
- Live camera feed or video upload support
- Batch ID validation (format: WORD-XXX, min 3 digits)
- Operator ID tracking (format: OP-XXX, min 3 digits)
- Pause/Resume/Reset controls during sessions
- Real-time count updates via WebSocket
- Automatic recording of all sessions
- Multiple format support (MP4, AVI)
- Downloadable session videos
- Video evidence for dispute resolution
- Professional packing slip layout
- Auto-populated customer and transporter details
- QR code for verification
- Session metadata and box count
- Downloadable PDF documents
- Performance metrics and throughput trends
- Session history and statistics
- Batch efficiency tracking
- Exportable analytics reports
- Visual charts and graphs
- Secure authentication with JWT tokens
- Password strength validation
- User profile management
- Warehouse and challan information storage
- Framework: React 19.2.4
- Build Tool: Vite 8.0.1
- Styling: Tailwind CSS 4.2.2
- Animations: Framer Motion 12.38.0
- Charts: Recharts 3.8.0
- Icons: Lucide React 0.577.0
- HTTP Client: Axios 1.13.6
- Routing: React Router DOM 7.13.1
- PDF Export: jsPDF 4.2.1
- Framework: Python Flask
- Database: MongoDB
- Real-time: WebSocket (Flask-Sock)
- AI/ML: YOLOv8, OpenCV, Ultralytics
- Authentication: JWT, bcrypt
- PDF Generation: ReportLab
- Video Processing: OpenCV (cv2)
- Model: YOLOv5n (Ultralytics)
- Framework: PyTorch
- Computer Vision: OpenCV
- Detection: Real-time object detection
Before installation, ensure you have:
- Node.js 16.x or higher
- Python 3.8 or higher
- MongoDB 4.4 or higher (running locally or remote)
- Webcam (optional, for live detection)
- Git for cloning the repository
git clone <repository-url>
cd boxguardcd Frontend
npm installCreate a .env file (if needed):
VITE_API_URL=http://localhost:5000cd Backend
python -m venv venv
# Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txtCreate a .env file in the Backend directory:
MONGO_URI=mongodb://localhost:27017
JWT_SECRET=your-secret-key-change-in-production
MODEL_PATH=models/yolov8n.ptEnsure MongoDB is running:
# Windows (if installed as service):
net start MongoDB
# macOS:
brew services start mongodb-community
# Linux:
sudo systemctl start mongodThe YOLOv5n model will be downloaded automatically on first run, or you can manually place it:
# Place yolov8n.pt in Backend/models/Ensure MongoDB is running on mongodb://localhost:27017
cd Backend
# Activate venv if not already activated
python main.pyBackend will run on http://localhost:5000
cd Frontend
npm run devFrontend will run on http://localhost:5173
Open your browser and navigate to:
http://localhost:5173
-
Create Account
- Click "Get Started" or "Sign Up"
- Fill in warehouse details
- Provide challan information (M/S, Transporter ID, Courier Partner)
- Create strong password (min 8 chars, uppercase, lowercase, number, special char)
-
Login
- Use your email and password
- Access the dashboard
-
Configure Session
- Enter Batch ID (format: BATCH-001, min 3 digits)
- Enter Operator ID (format: OP-001, min 3 digits)
- Choose video source (Live Camera or Upload Video)
-
Start Detection
- Click "START SESSION"
- AI will begin counting boxes in real-time
- Monitor count and video feed
-
Session Controls
- Pause/Resume: Temporarily pause detection
- Reset: Reset count to zero
- Confidence Slider: Adjust detection threshold (35% default)
-
End Session
- Click "STOP SESSION"
- View final count
- Download challan PDF
- Download session video
-
Sessions Page
- View all completed sessions
- Filter and search sessions
- Download challans and videos
- Delete old sessions
-
Analytics Page
- View operator performance
- Analyze throughput trends
- Export comprehensive reports
- Track batch efficiency
- Update Profile
- Click user menu → "Profile Settings"
- Update warehouse information
- Modify challan details
- Save changes
boxguard/
├── Frontend/ # React frontend application
│ ├── src/
│ │ ├── api/ # API integration
│ │ │ └── index.js # Axios API calls
│ │ ├── components/ # Reusable components
│ │ │ ├── Header.jsx # Navigation header
│ │ │ ├── LandingNav.jsx # Landing page navbar
│ │ │ ├── Motion.jsx # Animation wrappers
│ │ │ ├── ProtectedRoute.jsx # Auth guard
│ │ │ └── Tooltip.jsx # Tooltip component
│ │ ├── context/ # React context
│ │ │ └── SessionContext.jsx # Session state management
│ │ ├── hooks/ # Custom hooks
│ │ │ └── useWebSocket.js # WebSocket hook
│ │ ├── pages/ # Page components
│ │ │ ├── Dashboard.jsx # Main dashboard
│ │ │ ├── Landing.jsx # Landing page
│ │ │ ├── Login.jsx # Login page
│ │ │ ├── Signup.jsx # Signup page
│ │ │ ├── Sessions.jsx # Sessions list
│ │ │ ├── OperatorStats.jsx # Analytics page
│ │ │ └── Profile.jsx # User profile
│ │ ├── App.jsx # Main app component
│ │ ├── main.jsx # Entry point
│ │ └── index.css # Global styles
│ ├── public/ # Static assets
│ ├── index.html # HTML template
│ ├── package.json # Dependencies
│ └── vite.config.js # Vite configuration
│
├── Backend/ # Python Flask backend
│ ├── models/ # AI models
│ │ └── yolov5n.pt # YOLOv5 model
│ ├── main.py # Main API server
│ ├── auth.py # Authentication logic
│ ├── database.py # MongoDB operations
│ ├── detection.py # YOLOv8 box detection
│ ├── pdf_generator.py # Challan PDF generation
│ ├── video_recorder.py # Video recording
│ ├── requirements.txt # Python dependencies
│ └── .env # Environment variables
│
├── challans/ # Generated PDF challans
├── recordings/ # Session video recordings
├── uploads/ # Uploaded videos
└── README.md # This file
# MongoDB Connection
MONGO_URI=mongodb://localhost:27017
# JWT Authentication
JWT_SECRET=your-secret-key-change-in-production
# AI Model
MODEL_PATH=models/yolov8n.pt
# Server Settings
FLASK_ENV=development
FLASK_DEBUG=TrueThe frontend uses Vite and connects to http://localhost:5000 by default. Update API endpoints in Frontend/src/api/index.js if needed.
- Format:
WORD-XXX(e.g., BATCH-001, WH-123) - Minimum 3 digits required
- Auto-uppercase
- Duplicate checking per user
- Real-time validation with debounce
- Format:
OP-XXX(e.g., OP-001, OP-123) - Minimum 3 digits required
- Auto-uppercase
- Can be reused across batches
- Real-time format validation
- Live Camera: Real-time webcam feed
- Upload Video: Pre-recorded video files (MP4, AVI, MOV, WEBM)
- Company header: "BoxGuard Systems"
- Customer details section
- Challan information with session ID
- Product table with box count
- Footer with generation timestamp
- QR code for verification
-
Password Requirements:
- Minimum 8 characters
- At least one uppercase letter
- At least one lowercase letter
- At least one number
- At least one special character (@$!%*?&)
-
JWT Authentication:
- 24-hour token expiration
- Secure token storage
- Protected routes
-
Data Privacy:
- 100% local processing
- No cloud dependencies
- All data stored locally
POST /auth/signup- Create new user accountPOST /auth/login- User loginGET /profile- Get user profilePUT /profile- Update user profile
GET /sessions- List all sessionsPOST /sessions- Create new sessionGET /sessions/<id>- Get session detailsDELETE /sessions/<id>- Delete sessionGET /sessions/<id>/video- Download session videoGET /sessions/<id>/challan- Download challan PDF
POST /validate/batch- Validate batch IDPOST /validate/operator- Validate operator ID
POST /control/pause- Pause/resume sessionPOST /control/reset- Reset countPOST /settings/confidence- Update confidence threshold
WS /detection- Real-time detection stream
MongoDB Connection Error
Solution: Ensure MongoDB is running on localhost:27017
Check: mongod --version
Start: net start MongoDB (Windows) or brew services start mongodb-community (macOS)
YOLOv5 Model Not Found
Solution: Model will auto-download on first run
Manual: Download yolov5n.pt and place in Backend/models/
WebSocket Connection Failed
Solution: Ensure backend is running on port 5000
Check: Backend console for errors
Restart: Stop and restart backend server
Camera Access Denied
Solution: Grant camera permissions in browser settings
Check: Browser console for permission errors
This project was built for NEXUS 2025. For contributions or issues, please contact the development team.
© 2025 BoxGuard. All rights reserved.
Built For: NEXUS 2025
Institution: VYES Institute of Technology
Track: Senior AI/ML
- Ultralytics for YOLOv5
- OpenCV for computer vision capabilities
- MongoDB for database solutions
- React and Vite for frontend framework
- Flask for backend framework
For support, questions, or feedback:
- Open an issue in the repository
- Contact the development team
- Check documentation in
/docs(if available)
BoxGuard - Count Smarter. Pack Smarter. Ship Smarter.
Made with ❤️ for warehouse automation