This is a Web-Based Expert System Application designed for diagnosing technical issues in E-Procurement systems using the Forward Chaining inference method. The system provides intelligent diagnosis capabilities based on symptoms and user types, along with comprehensive reporting features.
- π Public Diagnosis System - No login required for basic diagnosis
- π Forward Chaining Engine - Intelligent rule-based inference system
- π₯ Multi-User Support - Vendor and Internal user types
- π Issue Reporting - Comprehensive problem reporting with file attachments
- ποΈ Admin Dashboard - Complete CRUD operations for system management
- π Analytics & Reporting - Export capabilities (PDF, Excel)
- π Secure Authentication - Laravel Breeze with email verification
- OS: Windows/Linux/macOS
- Web Server: Apache/Nginx (or Laragon 8 for Windows)
- PHP: 8.3 or higher
- Database: MySQL 8.0+ or MariaDB 10.3+
- Node.js: LTS version (for Vite/Tailwind)
- Composer: 2.0 or higher
-
Clone the repository
git clone <repository-url> cd web-based-expert-system-app-with-forward-chaining
-
Install PHP dependencies
composer install
-
Install frontend dependencies
npm install
<<<<<<< HEAD 4. Setup database
# Create MySQL database
mysql -u root -p
CREATE DATABASE expert_system;
CREATE USER 'expert_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON expert_system.* TO 'expert_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
# Update .env file with database credentials
# Then run migrations
php artisan migrate --seed-
Run the application
Option A: All processes in parallel
composer run dev
Option B: Manual separate terminals
# Terminal 1 php artisan serve # Terminal 2 npm run dev
-
Access the application
- Public Site: http://127.0.0.1:8000/
- Admin Dashboard: http://127.0.0.1:8000/dashboard
| Role | Password | |
|---|---|---|
| Super Admin | admin@example.com | password |
β οΈ Security Note: Change default passwords immediately in production!
======= 4. Generate application key
php artisan key:generate-
Setup database
# Create MySQL database mysql -u root -p CREATE DATABASE db_expert_system_fwc; EXIT; # Update .env file - uncomment and configure these lines: # DB_HOST=127.0.0.1 # DB_PORT=3306 # DB_DATABASE=db_expert_system_fwc # DB_USERNAME=root # DB_PASSWORD= # Then run migrations php artisan migrate --seed
-
Run the application
Option A: All processes in parallel
composer run dev
Option B: Manual separate terminals
# Terminal 1 php artisan serve # Terminal 2 npm run dev
-
Access the application
- Public Site: http://127.0.0.1:8000/
- Admin Dashboard: http://127.0.0.1:8000/dashboard
| Role | Password | |
|---|---|---|
| Super Admin | admin@example.com | password |
β οΈ Security Note: Change default passwords immediately in production!
70af008 (chore: update environment configuration and enhance README for Expert System)
- Forward Chaining Engine (
App\Services\ForwardChainingEngine) - Models: Gejala (Symptoms), Masalah (Problems), Aturan (Rules)
- Authentication: Laravel Breeze with email verification
- Database: MySQL with JSON data seeders
- Frontend: Tailwind CSS + Alpine.js + Vite
Users (Admin accounts)
βββ Gejala (Symptoms) - G1, G2, G3...
βββ Masalah (Problems) - M1, M2, M3...
βββ Aturan (Rules) - IF G1 AND G2 THEN M1
βββ RiwayatDiagnosis (Diagnosis History)
βββ RiwayatLaporMasalah (Issue Reports)
- Input: Selected symptom IDs + user type (Vendor/Internal)
- Validation: Check symptoms match user type
- Rule Matching:
- Find rules with 100% symptom match (highest score wins)
- If no exact match, use weighted partial matching (70% rule coverage + 30% user symptom coverage)
- Minimum threshold: 70%
- Output: Problem identification with confidence level
Input Symptoms β Validate User Type β Match Rules β Calculate Scores β Return Diagnosis
- Step 1: Select User Type (Vendor/Internal)
- Step 2: Choose Process Stage
- Step 3: Select Relevant Symptoms
- Step 4: View Diagnosis Results with Solutions
- Report technical issues, bugs, or suggestions
- Attach files (JPG, PNG, PDF, DOC, DOCX up to 10MB)
- Track reports with unique IDs
- Symptoms Management (
/admin/gejala) - Problems Management (
/admin/masalah) - Rules Management (
/admin/aturan) - Diagnosis History (
/admin/riwayat-diagnosis) - Issue Reports (
/admin/riwayat-lapor-masalah)
- PDF exports for Problems and Rules
- Excel/PDF exports for History and Reports
- Individual report PDF generation
app/
βββ Http/Controllers/ # Application controllers
βββ Models/ # Eloquent models
βββ Services/ # Business logic (Forward Chaining Engine)
βββ Exports/ # Excel/PDF export classes
βββ Providers/ # Service providers
database/
βββ data/ # JSON seed data (gejala.json, masalah.json, aturan.json)
βββ migrations/ # Database migrations
βββ seeders/ # Database seeders
resources/
βββ views/ # Blade templates
βββ css/ # Tailwind CSS
βββ js/ # Alpine.js components
routes/
βββ web.php # Web routes
βββ auth.php # Authentication routes
# Development
composer run dev # Run all dev processes in parallel
npm run dev # Vite dev server
php artisan serve # Laravel dev server
# Production
npm run build # Build frontend assets
php artisan optimize # Optimize application
# Database
php artisan migrate --seed # Run migrations with seeders
php artisan db:seed # Run seeders only
php artisan migrate:fresh --seed # Fresh migration with seeders
# Storage
php artisan storage:link # Link storage for file uploads| Component | Technology |
|---|---|
| Backend | Laravel 12, PHP 8.3+ |
| Database | MySQL 8.0+, MariaDB 10.3+ |
| Frontend | Tailwind CSS, Alpine.js, Vite |
| Authentication | Laravel Breeze |
| Exports | DomPDF, Maatwebsite Excel |
| File Storage | Laravel Storage with Symbolic Links |
The system uses JSON files for initial data:
database/data/gejala.json- Symptoms datadatabase/data/masalah.json- Problems datadatabase/data/aturan.json- Rules data
Rules follow the pattern: "IF G3 AND G4 THEN M4"
Example rule structure:
{
"kode": "R1",
"masalah_id": 1,
"gejala_ids": [1, 2, 3],
"deskripsi": "IF G1 AND G2 AND G3 THEN M1"
}# Copy environment file
cp .env.example .env
<<<<<<< HEAD
# Key configurations
APP_NAME="Expert System E-Procurement"
APP_URL=http://127.0.0.1:8000
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=expert_system
DB_USERNAME=your_username
DB_PASSWORD=your_password
=======
# Key configurations (uncomment the DB_* lines in .env)
APP_NAME="Expert System Forward Chaining"
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=db_expert_system_fwc
DB_USERNAME=root
DB_PASSWORD=
>>>>>>> 70af008 (chore: update environment configuration and enhance README for Expert System)# Create storage link for file uploads
php artisan storage:linkFor production environments, configure queue workers:
# Run queue worker
php artisan queue:work
# Or use supervisor for daemon process-
Install dependencies
composer install --optimize-autoloader --no-dev npm install
-
Build assets
npm run build
-
Optimize application
php artisan config:cache php artisan route:cache php artisan view:cache
-
Set permissions
chmod -R 755 storage bootstrap/cache
- PHP 8.3+
- MySQL 8.0+ or MariaDB 10.3+
- PDO MySQL extension
- OpenSSL extension
- Mbstring extension
- Tokenizer extension
- XML extension
- Ctype extension
- JSON extension
- BCMath extension
- β Change default admin passwords
- β Use HTTPS in production
- β Regular database backups
- β Secure file upload validation
- β Email verification for admin accounts
- β CSRF protection on all forms
# Backup MySQL database
mysqldump -u username -p database_name > backups/database_$(date +%Y%m%d).sql
# Backup uploaded files
tar -czf backups/storage_$(date +%Y%m%d).tar.gz storage/app/public/| Issue | Solution |
|---|---|
404 on /storage/... URLs |
Run php artisan storage:link |
| Migration errors | Check database connection and credentials in .env |
| Can't login with default credentials | Run php artisan db:seed |
| Rules not working | Check symptom codes (G1, G2) match JSON data |
| Assets not loading | Run npm run build for production |
# Check application status
php artisan about
# View logs
php artisan pail
# Clear caches
php artisan cache:clear
php artisan config:clear
php artisan view:clear- MySQL indexes are configured on frequently queried columns
- Connection pooling for better performance
- Eager loading used to prevent N+1 queries
- Query optimization with proper indexing
# Production build with optimization
npm run build
# Analyze bundle size
npm run build -- --analyze- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow PSR-12 coding standards
- Write tests for new features
- Update documentation for API changes
- Use semantic commit messages
This project is licensed under the MIT License - see the LICENSE file for details.
For technical support or questions:
- οΏ½ Documentation: Check this README and inline code comments
- π Issues: Create an issue on the repository
- οΏ½ Discussions: Use the repository discussions for questions
Built with β€οΈ using Laravel 12 and modern web technologies