An innovative web-based biosecurity platform that leverages modern Flask technology to provide comprehensive agricultural pest and weed management capabilities.
Supports role-based access control, detailed species information management, and visual identification tools with image galleries.
One-click FREE deployment of your agricultural biosecurity system.
Live Application · Screenshots · Documentation · Database Schema · Issues
Share Biosecurity Guide Repository
🌱 Pioneering the future of agricultural biosecurity. Built for the next generation of farmers, agronomists, and agricultural professionals.
[!TIP] Explore the intuitive user interface designed for agricultural professionals across different user roles.
📱 More Screenshots
[!NOTE] Experience the comprehensive biosecurity management system in action through our demo.
Tech Stack Badges:
Important
This project demonstrates modern agricultural technology integration with web development best practices. It combines Flask backend with MySQL database to provide comprehensive biosecurity management. Features include role-based access control, visual species identification, and comprehensive agricultural data management.
📑 Table of Contents
- 🌱 Biosecurity Guide for Agricultural Pests and Weeds - TOC -
We are passionate developers creating next-generation agricultural biosecurity solutions. By adopting modern web development practices and comprehensive database design, we aim to provide agricultural professionals with powerful, scalable, and user-friendly biosecurity management tools.
Whether you're an agronomist seeking species identification resources, staff managing agricultural content, or administrators overseeing system operations, this platform will be your comprehensive biosecurity playground. Please note that this project is under active development, and we welcome feedback for any issues encountered.
Note
- Python 3.8+ required
- MySQL database required for data storage
- Web browser with JavaScript enabled
- Internet connection for image resources
| No installation required! Visit our live demo to experience it firsthand. |
|---|
Tip
⭐ Star us to receive all release notifications from GitHub without delay!
⭐ Star History
Experience comprehensive user management with distinct role-based interfaces. Our innovative approach provides specialized access levels for different agricultural professionals through advanced authentication and authorization systems.
Key capabilities include:
- 👥 Multi-Role Support: Administrators, Staff, and Agronomists
- 🔒 Secure Authentication: Password hashing with Werkzeug
- 📋 Profile Management: Individual user profile customization
- 🛡️ Session Security: Secure session management
Revolutionary agricultural species management that transforms how users access pest and weed information. With our comprehensive database and intuitive design, users can efficiently identify and manage agricultural threats while maintaining detailed records.
Database Features:
- Pest Management: Comprehensive pest identification and control information
- Weed Database: Detailed weed species with biological characteristics
- Image Galleries: Multiple images per species for accurate identification
- Scientific Data: Biology, impacts, and control methods for each species
Beyond the core features, this biosecurity platform includes:
- 🌐 Multi-User System: Support for multiple concurrent users with role separation
- 🔍 Advanced Search: Search and filter capabilities across all species data
- 📊 Data Management: CRUD operations for agricultural species information
- 🖼️ Image Management: Multiple image support with primary image designation
- 📱 Responsive Design: Mobile-friendly interface with Bootstrap CSS
- 🔐 Secure Password: Complex password requirements and secure storage
- 📋 Content Management: Easy-to-use forms for species data entry
- 🏠 Dashboard Interface: Role-specific home pages and navigation
✨ More features are continuously being added as agricultural needs evolve.
Backend Stack:
- Framework: Flask 3.0.2 with Blueprint architecture
- Language: Python 3.8+ for robust server-side logic
- Database: MySQL with mysql-connector-python driver
- Authentication: Werkzeug for password hashing and security
- Forms: WTForms for form validation and processing
Frontend Stack:
- Styling: Bootstrap 5 for responsive design
- Templates: Jinja2 templating engine
- JavaScript: Vanilla JS for interactive features
- UI Components: Custom agricultural-focused design system
Development & Operations:
- Deployment: PythonAnywhere cloud hosting
- Database Tools: MySQL Workbench compatible schema
- Version Control: Git with structured branching
- Documentation: Comprehensive README and code comments
Tip
Each technology was carefully selected for agricultural application needs, ease of deployment, and long-term maintainability in educational and professional environments.
Tip
This architecture supports multi-user agricultural environments and role-based data access patterns, making it suitable for educational institutions and agricultural organizations.
graph TB
subgraph "Frontend Layer"
A[Flask Templates] --> B[Bootstrap UI]
B --> C[JavaScript Interactions]
C --> D[Form Handling]
end
subgraph "Application Layer"
E[Flask Blueprints] --> F[Route Handlers]
F --> G[Authentication Logic]
G --> H[Business Logic]
end
subgraph "Data Layer"
I[MySQL Database]
J[User Management]
K[Species Database]
L[Image Storage]
end
D --> E
H --> I
I --> J
I --> K
I --> L
subgraph "Security"
M[Session Management]
N[Password Hashing]
O[Role-based Access]
end
G --> M
G --> N
G --> O
The database follows a normalized structure optimized for agricultural data management:
erDiagram
users ||--o{ agronomists : "has profile"
users ||--o{ staff_and_administrators : "has profile"
agriculture_items ||--o{ images : "has images"
users {
int user_id PK
varchar username
varchar password_hash
enum role_name
enum status
}
agriculture_items {
int agriculture_id PK
enum item_type
varchar common_name
varchar scientific_name
text key_characteristics
text biology
text impacts
text control
}
images {
int image_id PK
int agriculture_id FK
varchar image_path
boolean is_primary
}
agronomists {
int agronomist_id PK
int user_id FK
varchar first_name
varchar last_name
varchar email
varchar phone_number
varchar address
date date_joined
}
staff_and_administrators {
int staff_id PK
int user_id FK
varchar first_name
varchar last_name
varchar email
varchar work_phone_number
date hire_date
varchar position
varchar department
}
The system implements a three-tier role-based access control:
- Administrators: Full system access, user management, complete CRUD operations
- Staff: Content management, species data entry, user viewing capabilities
- Agronomists: Read-only access to species database, identification tools
Application Performance:
- ⚡ Fast Load Times: Optimized database queries with proper indexing
- 🚀 Responsive UI: Bootstrap-based responsive design for all devices
- 💾 Efficient Queries: Prepared statements preventing SQL injection
- 📊 Pagination Support: Efficient data loading with configurable page sizes
Database Optimization:
- 🔄 Connection Pooling: Efficient database connection management
- 📋 Indexed Searches: Optimized search across species characteristics
- 🖼️ Image Management: External image hosting for optimal performance
- 🔍 Query Optimization: Efficient JOIN operations for related data
Note
Performance metrics are continuously monitored and optimized for agricultural workflow requirements.
Important
Ensure you have the following installed:
1. Clone Repository
git clone https://github.com/ChanMeng666/biosecurity.git
cd biosecurity2. Install Dependencies
# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install required packages
pip install -r requirements.txt3. Database Setup
# Create MySQL database
mysql -u root -p
CREATE DATABASE biosecurity;
# Import database structure
mysql -u root -p biosecurity < app/database/biosecurity(structure_only).sql
# Optional: Import sample data
mysql -u root -p biosecurity < app/database/biosecurity(structure_and_data).sql4. Configuration
# Edit config.py
class Config(object):
SECRET_KEY = 'your-secret-key-here'
DATABASE_URI = 'mysql://username:password@localhost/biosecurity'5. Start Application
python app.py🎉 Success! Open http://localhost:5000 to view the application.
Configure your local environment:
# Database Configuration
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=your_password
DB_NAME=biosecurity
# Application Configuration
SECRET_KEY=your-secret-key
DEBUG=TrueTip
Use a strong secret key for production deployments. Generate one using Python's secrets module.
# Start with debug mode
python app.py
# Check database connection
python -c "from app.database import check_db_connection; check_db_connection()"Important
Choose the deployment strategy that best fits your agricultural organization's needs.
Live Application: 1160210.pythonanywhere.com
Steps for PythonAnywhere:
- Upload your code to PythonAnywhere
- Configure MySQL database in the Databases tab
- Set up the WSGI configuration file
- Configure environment variables
- Reload the web application
# Production configuration
export FLASK_ENV=production
export SECRET_KEY=your-production-secret
# Start with production settings
python app.py| Variable | Description | Required | Example |
|---|---|---|---|
SECRET_KEY |
Flask secret key | ✅ | your-secret-key |
DATABASE_URI |
MySQL connection string | ✅ | mysql://user:pass@localhost/biosecurity |
DEBUG |
Debug mode | 🔶 | False |
Warning
Never commit database credentials to version control. Use environment variables or secure configuration files in production.
Getting Started:
- Access Application via the live demo or local installation
- Login/Register with appropriate role credentials
- Navigate Dashboard based on your user role
- Explore Features through role-specific interfaces
Administrator Functions:
- User management (create, edit, delete users)
- Complete species database management
- System configuration and oversight
- Access to all application features
Staff Functions:
- Species database content management
- Image uploads and management
- View agronomist profiles
- Content creation and editing
Agronomist Functions:
- Browse species database
- View detailed species information
- Access image galleries for identification
- Read-only access to comprehensive guides
| Role | Username | Password |
|---|---|---|
| Admin | hello777 | 1234qweASD@ |
| Admin | admin0 | 123qweASD@ |
| Staff | staff1 | 123qweASD@ |
| Agronomist | agro1 | 123qweASD@ |
| Role | Username | Password |
|---|---|---|
| Agronomist | agro1 | 123qweASD@ |
| Staff | staff1 | 123qweASD@ |
| Admin | admin1 | 123qweASD@ |
Note
These are demonstration accounts. Change passwords for production use.
Current and planned integrations for enhanced agricultural functionality:
| Feature | Status | Description |
|---|---|---|
| External Image APIs | ✅ Active | Support for external agricultural image databases |
| Email Notifications | 🔶 Planned | User registration and system notifications |
| Export Functions | 🔶 Planned | PDF and Excel export of species data |
| Mobile App | 🔶 Future | Native mobile application for field use |
| API Endpoints | 🔶 Future | RESTful API for third-party integrations |
The biosecurity database contains comprehensive agricultural data:
- 80+ Species Records: Detailed pest and weed information
- 400+ Images: Visual identification resources
- Multi-User Support: Role-based data access
- Relationship Management: Normalized database structure
Key Tables:
agriculture_items: Core species data (pests and weeds)images: Associated identification imagesusers: Authentication and authorizationagronomists: Agricultural professional profilesstaff_and_administrators: Staff member information
Setup Development Environment:
# Clone and setup
git clone https://github.com/ChanMeng666/biosecurity.git
cd biosecurity
# Virtual environment
python -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Database setup
mysql -u root -p < app/database/biosecurity(structure_and_data).sql
# Start development server
python app.pyDevelopment Workflow:
- Create feature branch
- Implement functionality in appropriate blueprint
- Add templates and styling
- Test with different user roles
- Update documentation
- Submit pull request
Project Structure:
app/
├── routes/ # Flask blueprints for different features
├── templates/ # Jinja2 templates organized by role
├── static/ # CSS, JavaScript, and assets
├── database/ # Database schemas and connection
└── utils.py # Utility functions
Manual Testing:
- Test all user roles and permissions
- Verify database operations
- Check responsive design
- Validate form submissions
Database Testing:
# Test database connection
python -c "from app.database.db_connection import get_db_connection; conn = get_db_connection(); print('Connected!' if conn else 'Failed')"We welcome contributions to improve agricultural biosecurity management! Here's how you can help:
1. Fork & Clone:
git clone https://github.com/your-username/biosecurity.git
cd biosecurity2. Create Branch:
git checkout -b feature/your-feature-name3. Make Changes:
- Follow Python PEP 8 style guidelines
- Add comprehensive comments
- Test across different user roles
- Update documentation as needed
4. Submit PR:
- Provide clear description
- Include screenshots for UI changes
- Reference related issues
- Ensure all features work correctly
Code Style:
- Use Python 3.8+ features appropriately
- Follow Flask best practices
- Write clear, agricultural-domain-specific comments
- Ensure cross-role compatibility
Agricultural Focus:
- Consider real-world agricultural workflows
- Maintain scientific accuracy in species data
- Ensure accessibility for field use
- Support various agricultural environments
This project is licensed under the MIT License - see the LICENSE file for details.
Open Source Benefits:
- ✅ Educational use encouraged
- ✅ Commercial use allowed
- ✅ Modification and distribution permitted
- ✅ Agricultural research applications supported
Chan Meng Creator & Lead Developer |
Chan Meng
LinkedIn: chanmeng666
GitHub: ChanMeng666
Email: chanmeng.dev@gmail.com
Website: chanmeng.live
Empowering agricultural professionals with modern digital tools
⭐ Star us on GitHub • 📖 Read the Documentation • 🐛 Report Issues • 💡 Request Features • 🤝 Contribute
Made with ❤️ for the agricultural community





