This project is a comprehensive crop monitoring system developed for Green Shadow (Pvt) Ltd., a mid-scale farm specializing in root crops and cereals. The system leverages the Spring Boot framework to provide services for managing field operations, crop monitoring, resource allocation, and data analysis. The application is designed to support CRUD operations across various entities such as fields, crops, staff, vehicles, and equipment.
- Project Overview
- System Requirements
- Key Features
- Installation
- Technologies Used
- Entity Models
- Project Structure
- Endpoints
- Future Enhancements
Green Shadow (Pvt) Ltd. has expanded their production facilities and requires a digital solution to manage crop and asset data effectively. This application provides an enterprise-level solution using Spring Boot and MySQL, enabling administrators, managers, and scientists to oversee field activities, crop growth, and resource allocations.
- Java - JDK 21 or above
- MySQL - For relational database management
- Spring Boot - Application framework
- Spring Security & OAuth2 - For authentication and authorization
- Git - For version control
- Maven - For dependency management
- User Access Control: Supports user roles (MANAGER, ADMINISTRATIVE, SCIENTIST) with varying permissions.
- CRUD Operations: Allows CRUD operations on fields, crops, staff, vehicles, and equipment.
- Monitoring Logs: Logs crop observations and field activities for effective monitoring.
- Data Analysis: Provides relational and spatial analysis features.
- Secure Authentication: Implements Spring Security with OAuth 2.0 for secure access.
-
Clone the repository:
git clone https://github.com/ranindunethmina/CropMonitoringSystem.git cd crop-monitoring-system
-
Configure the application properties:
Update
src/main/resources/application.properties
with your MySQL database credentials:spring.datasource.url=jdbc:mysql://localhost:3306/crop_monitoring spring.datasource.username=your-username spring.datasource.password=your-password
-
Build and run the project:
mvn clean install mvn spring-boot:run
-
Access the application on
http://localhost:5055
.
- Front End: HTML, CSS, JavaScript, jQuery, AJAX
- Back End: Spring Boot, Spring Data, Spring Web MVC, Spring Validation, Spring Security, MySQL
- Security: JWT, OAuth 2.0, Spring Security
- Other: Lombok, Model Mapper, Jackson
- Field: Represents areas for cultivation, with crop and staff assignments.
- Crop: Information on crop types, growth stages, and field allocations.
- Staff: Details on employees, their roles, and assigned tasks.
- Vehicle: Vehicles assigned to staff for field support.
- Equipment: Agricultural equipment used for field operations.
- Monitoring Log: Observations and activity logs for fields and crops.
- User: Authentication and role management for users.
- Field ↔ Crop
- Field ↔ Staff
- MonitoringLog ↔ Field, Crop, Staff
- Staff ↔ Vehicle and Equipment
crop-monitoring-system/
├── src/main/java/com/greenshadow
│ ├── controller/ # API controllers
│ ├── repository/ # JPA repositories
│ ├── service/ # Service layer
│ ├── config/ # Security and configuration classes
│ └── Application.java
├── src/main/resources/
│ ├── application.properties
│ ├── static/ # Static resources (HTML, CSS)
│ └── templates/ # Thymeleaf templates
└── pom.xml # Project dependencies
-
Auth Service
POST /auth/login
- Login a userPOST /auth/register
- Register a new user
-
Field Service
GET /fields
- Retrieve all fieldsPOST /fields
- Create a new fieldPUT /fields/{id}
- Update a fieldDELETE /fields/{id}
- Delete a field
-
Crop Service
GET /crops
- Retrieve all cropsPOST /crops
- Create a new cropPUT /crops/{id}
- Update a cropDELETE /crops/{id}
- Delete a crop
-
Staff Service
GET /staff
- Retrieve all staffPOST /staff
- Add a new staff memberPUT /staff/{id}
- Update staff detailsDELETE /staff/{id}
- Delete a staff member
-
Vehicle and Equipment Services
- Similar CRUD endpoints for managing vehicles and equipment.
- Advanced Reporting: Introduce additional reports for better data visualization and analysis.
- Mobile Access: Develop a mobile application for field staff to access information remotely.
- IoT Integration: Integrate sensors for real-time monitoring of crop health and environmental conditions.
- Automated Alerts: Provide alerts for crop health or equipment maintenance based on predefined thresholds.
Contributions are welcome! Please fork this repository and submit a pull request with your changes.
This project is licensed under the MIT License. See the LICENSE file for more details.