Expert System for Diagnosing Pests and Diseases in Rice Plants Using Forward Chaining and Certainty Factor Methods
This project is an implementation of an expert system based on research presented at the CORISINDO conference. The system leverages artificial intelligence techniques, specifically Forward Chaining for logical inference and Certainty Factor for handling uncertainty in diagnosis. By combining these methodologies, the application provides accurate and reliable diagnoses of rice plant pests and diseases, helping farmers and agricultural professionals make informed decisions to protect their crops.
The research paper that inspired this implementation can be found at: https://corisindo.utb-univ.ac.id/index.php/penelitian/article/view/111
- User authentication and authorization
- Disease diagnosis based on symptoms
- Knowledge base management
- CRUD Disease data (Create, Read, Update, Delete disease data)
- CRUD Symptom data (Create, Read, Update, Delete symptom data)
- CRUD Rule data (Create, Read, Update, Delete rule data)
Before you begin, make sure you have Node.js installed on your system.
- Visit the official Node.js website at https://nodejs.org
- Download Node.js version 24.12.0 or newer
- Run the installer and follow the installation wizard
- Verify the installation by opening a terminal and running:
node --version
npm --version# Clone the repository
git clone https://github.com/andrianfaa/Sistem-Pakar.git && cd Sistem-Pakar
# Install dependencies
npm installAfter installing dependencies, create a .env.local file in the root directory of your project:
# Create .env.local file
touch .env.localAdd the following environment variables to your .env.local file:
URL=http://localhost:3000
SECRET_KEY=your-secret-key-here
MONGODB_URI=your-mongodb-connection-stringImportant: Replace the placeholder values with your actual configuration:
URL: Your application URL (usehttp://localhost:3000for development)SECRET_KEY: A secure random string for encryption/authenticationMONGODB_URI: Your MongoDB connection string
Note: Never commit your
.env.localfile to version control. Make sure it's listed in your.gitignorefile.
To run the application in development mode:
npm run devThe application will be available at http://localhost:3000
To run the application in production mode:
# Build the application
npm run build
# Start the production server
npm startThe application will run on the URL specified in your .env.local file.
If you fork this project and need to create an initial user account, you must manually call the user creation API endpoint:
Endpoint: POST /api/user
Request Body Example:
{
"name": "Admin",
"email": "admin@anfa.my.id",
"username": "admin",
"password": "Admin@123"
}Note: The example above is just a template. You can customize the user data according to your needs. Make sure to use a strong password for security purposes.
Security Warning: Before building for production, make sure to delete the
/api/userfolder to prevent unauthorized user creation. This endpoint should only be used during initial setup and should be removed to avoid potential security risks.
- Next.js - React framework for production
- React - JavaScript library for building user interfaces
- MongoDB - NoSQL database for data storage
- Jose - JavaScript module for JSON Web Tokens (JWT) authentication and authorization
- Zod - TypeScript-first schema validation library
- Tailwind CSS - Utility-first CSS framework for styling
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.