1.1.5 • Published 8 months ago

smart-agriculture-ts v1.1.5

Weekly downloads
-
License
ISC
Repository
-
Last release
8 months ago

Smart Agriculture System

Overview

This Smart Agriculture System is a TypeScript-based project designed to enhance agricultural productivity through real-time monitoring and automated management of crops. It integrates various technologies including sensors, mobile applications, and automated irrigation systems.

Unified Process Artifacts Overview

1. Use Case Model

The Smart Agriculture System use case model identifies primary interactions, capturing the functional requirements of the system:

  • Actors:

    • Farmer: End-user managing crops and irrigation.
    • Admin: Responsible for managing system data and user accounts.
    • Sensor Device: Collects real-time agricultural data.
  • Primary Use Cases:

    • View Crop Data: Farmers can view real-time data about their crops.
    • Monitor Soil Moisture: System displays soil moisture levels from sensors.
    • Adjust Irrigation: Farmers can adjust irrigation settings based on data.
    • Manage User Accounts (Admin): Admins add, update, or remove user accounts.
    • Process Sensor Data: The system processes data collected from sensors and displays it.

2. Design Model

The design model includes architectural decisions:

  • Backend: RESTful APIs for communication with the frontend and sensor devices.
  • Database: Mongodb database for storing sensor data and user information.
  • Frontend: Web-based dashboard for farmers to interact with the system.

3. Implementation Artifacts

  • Code Modules: Divided into user-facing components, service APIs, and utility functions.
  • Test Scripts: Ensure use case functionalities are robust and bug-free.

4. Deployment Model

  • Hosted on a cloud-based infrastructure like AWS or Azure.
  • Integrated with a CI/CD pipeline for regular updates.

Use Cases in Detail

Use CaseActor(s)Description
View Crop DataFarmerEnables farmers to explore real-time data about their crops.
Monitor Soil MoistureFarmerDisplays soil moisture levels collected from sensors in real-time.
Adjust IrrigationFarmerAllows farmers to adjust irrigation settings based on current soil moisture readings.
Manage User AccountsAdminAdmins can create, update, or delete user accounts in the system.
Process Sensor DataSensor DeviceCollects and processes data from various sensors to provide insights into crop health.

Features

  • Real-time crop data monitoring
  • Soil moisture sensing
  • Automated irrigation control
  • Mobile application interface
  • Edge computing for local data processing

Technologies

  • TypeScript
  • Node.js
  • IoT sensors
  • Mobile app development (framework specifics to be added)

Smart Agriculture System

To install this package directly from this NPMJS and run, Follow the given below Steps:

1. Create a new directory :
mkdir folder_name

Change Directory to Current if you are in any:
2. cd folder_name

3.Install the Package Locally :
npm i smart-agriculture-ts

4. Navigate to the package directory:
cd node_modules/smart-agriculture-ts

5. Run the App
node dist/index.js

6. Install dependencies for the jest test
npm install

7.To run the jest test cases:
npm test

Installation through Github

# Clone Repository
git clone https://github.com/PujanRimal77/new-smart-agriculture-ts.git

# Navigate to Project
cd new-smart-agriculture-ts

# Install Dependencies
npm install

# Compile TypeScript
npx tsc

# Run Application
node dist/index.js

# Run Tests
npm test

Usage

  • Access the mobile app or web interface to view crop data
  • The system automatically adjusts irrigation based on soil moisture readings

Project Structure

  • src/: Contains TypeScript source files
  • dist/: Output directory for compiled JavaScript
  • entities/: Classes for system components (e.g., MobileApp, Sensors)

Project Link: https://github.com/PujanRimal77/new-smart-agriculture-ts.git

Testing Running Tests To run the Jest test suite, use the following command:

 npm test

Test Case Explanations

EdgeDevice Tests

  • should create an EdgeDevice instance with correct properties: Verifies correct initialization of EdgeDevice
  • collectSensorData should log the correct message: Checks sensor data collection logging
  • processLocalData should log the correct message: Validates local data processing logging
  • sendDataToServer should log the correct message: Confirms data transmission logging

Farmer Tests

  • should create a Farmer instance with correct properties: Ensures correct Farmer object creation
  • viewCropData should log the correct message: Validates crop data viewing functionality
  • receiveAlerts should log the correct message: Checks alert reception mechanism
  • adjustIrrigation should log the correct message: Confirms irrigation adjustment logging

IrrigationSystem Tests

  • should create an IrrigationSystem instance with correct properties: Verifies IrrigationSystem initialization
  • adjustWater should update water flow and log the correct message: Checks water flow adjustment
  • reportStatus should log the correct message: Validates status reporting

MobileApp Tests

  • should create a MobileApp instance with correct properties: Ensures MobileApp object creation
  • displayDashboard should log the correct message: Checks dashboard display functionality
  • sendCommands should log the correct message: Validates command sending
  • receiveNotifications should log the correct message: Confirms notification reception

Test Journaling Test Run: November 19, 2024

Total Test Suites : 5 Total Test Cases: 19 Passed: 19 Failed: 0 Coverage: 100%

Traceability Matrix

Requirement IDRequirement DescriptionFeature/FunctionJest Test Case IDOracle (Expected Outcome)Test Status
REQ-001Edge device data collectionEdge device collects sensor dataEdgeDevice-001Console log of data collectionPassed
REQ-002Farmer crop data viewingFarmer can view crop dataFarmer-001Console log of farmer viewing dataPassed
REQ-003Irrigation system controlAdjust water flow in irrigation systemIrrigationSystem-001Water flow adjustment loggedPassed
REQ-004Mobile app dashboardDisplay dashboard for userMobileApp-001Console log of dashboard displayPassed
REQ-005Sensor environment measurementMeasure and transmit sensor dataSensor-001Console log of measurement and transmissionPassed
  • All tests passed successfully.
  • Observations:

    • EdgeDevice data collection and transmission working as expected.
    • Farmer interface correctly displays crop data and alerts.
    • IrrigationSystem adjusts water flow accurately based on input.
    • MobileApp successfully displays user-specific information.
    • Sensors accurately measure and transmit environmental data.

    No issues were encountered during this test run. The system demonstrates good integration between components, with each module performing its designated functions correctly.

    Usage

  • Access the mobile app or web interface to view crop data

  • The system automatically adjusts irrigation based on soil moisture readings

Contributing

Contributions are welcome. Please fork the repository and submit pull requests for any enhancements.

Continuous Improvement Test results and observations will be continuously updated to improve system reliability and performance.

License

Copyright © 2024 Team Dhobikhola

1.1.5

8 months ago

1.1.4

8 months ago

1.1.3

8 months ago

1.1.2

8 months ago

1.1.1

8 months ago

1.0.12

8 months ago

1.0.11

8 months ago

1.0.10

8 months ago

1.0.9

8 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago