A secure, enterprise-grade web application engineered for the National Food Authority (NFA) to standardize grain quality evaluation, calculate Actual & Potential Milling Recoveries, supervise commercial rice milling contracts, and facilitate multi-tiered regional and central office approvals.
- Overview
- Workflow Architecture
- Key Features
- Role-Based Access Control (RBAC)
- Technology Stack
- System Requirements
- Local Development Setup
- Environment Configuration
- Production Deployment
- Testing & Quality Assurance
- Sponsorship & Support
- License
The NFA GMR (Guaranteed Milling Recovery) System automates the end-to-end evaluation and management of palay (paddy rice) stocks and milling recoveries across NFA branches and warehouses.
It replaces manual logging and disparate spreadsheets with a unified, auditable platform that:
- Captures multi-trial laboratory analyses (moisture, purity, foreign matter, chalky/damaged grains, broken rice).
- Computes standard AMR (Actual Milling Recovery) and PMR (Potential Milling Recovery) figures.
- Derives aggregate EMR (Estimated Milling Recovery) benchmarks.
- Orchestrates formal RMEC (Regional / Monitoring Evaluation Committee) recommendations and Central Office GMR Approvals.
- Monitors commercial rice miller performance, batch allocations, and real-time accomplishment milestones.
flowchart TD
A[πΎ Palay Intake & Pile Stacking] --> B[π§ͺ Laboratory Sampling Trials]
B --> C{Form Type}
C -->|AMR Testing| D[Actual Milling Recovery Calculations]
C -->|PMR Testing| E[Potential Milling Recovery Calculations]
D --> F[Multi-Trial Aggregation & Quality Parameters]
E --> F
F --> G[RMEC Technical Review]
G -->|Recommend for Retest| B
G -->|Endorse for Approval| H[Central Office GMR Approval Workflow]
H -->|Rejected| G
H -->|Approved| I[GMR Form Configuration & Official Certification]
I --> J[π Rice Milling Contract Allocation]
J --> K[Daily Milling Progress & Accomplishment Logs]
K --> L[π EMR Dashboard & Formal NFA Reports PDF/Excel]
- Multi-Trial Data Entry: Intuitive forms for recording detailed trial batches (gross weights, purity, moisture content, foreign matter, yellow/chalky grains, red rice, and head rice recovery).
- Dynamic Renumbering: Built-in automated re-indexing of trial sets upon adjustments or removal of trial rows.
- Retest Triggers: Formal mechanisms to initiate re-sampling workflows when quality thresholds deviate from standards.
- AMR & PMR Analysis: Automated formula execution with validation checks against allowable tolerances.
- EMR Executive Dashboard: Centralized performance metrics aggregating recovery estimates across branches, warehouses, and piles.
- Dynamic Signatories & Column Customization: Tailor printable GMR certificates with configurable authority signatures and toggleable report fields.
- Contractor & Miller Directory: Maintain profiles, accreditation statuses, and milling capacities.
- Batch & Pile Tracking: Allocate specific palay piles to milling batches.
- Progress Tracking: Daily accomplishment logs recording milled volumes, recovery percentages, and outstanding balances.
- Granular RBAC: 4 distinct clearance tiers (
ADMINISTRATOR,RMEC,STAFF,VIEWER). - Audit Logging: Comprehensive activity tracking recording user actions, timestamps, and model mutations.
- Brute-Force & IP Lockout: Built-in IP throttling with administrative unblock controls.
- Credential Governance: Mandatory password change on initial login, expiring temporary credentials, and secure reset links.
- Safe Hierarchical Cleanup: Restricted administrative bottom-up data purge (Trials β Piles β Warehouses) with immutable audit events.
- Spreadsheet Exports: Excel exports formatted via PhpSpreadsheet.
- Print-Ready PDFs: Vector-rendered, agency-compliant print formats via Barryvdh DomPDF.
| Capability / Module | Administrator | RMEC | Staff | Viewer |
|---|---|---|---|---|
| Grain Quality Data Entry (AMR/PMR) | β | β | β | β |
| View AMR, PMR, & GMR Summaries | β | β | β | β |
| Export AMR / PMR Reports (Excel/PDF) | β | β | β | β |
| Export EMR Dashboard & Reports | β | β | β | β |
| Configure GMR Signatories & Columns | β | β | β | β |
| Print Official GMR Report | β | β | β | β |
| Central-Office GMR Approvals | β | β | β | β |
| Manage Millers & Milling Allocations | β | β | β | β |
| Log Milling Progress / Accomplishment | β | β | β | β |
| User Administration & Security Settings | β | β | β | β |
| Bottom-Up Safe Data Cleanup | β | β | β | β |
- Backend Framework: Laravel 13.x
- Language Runtime: PHP 8.3+
- Database Engine: MySQL 8.0+
- Frontend Toolkit: Tailwind CSS, Vite, Alpine.js
- Document Processors:
- Barryvdh Laravel DomPDF (Official PDF reports)
- PhpOffice PhpSpreadsheet (Data exports)
- Mailing Engine: Brevo SMTP Relay
- Code Quality & Testing: Laravel Pint, PHPUnit 12
Ensure the host environment satisfies the following baseline prerequisites:
- PHP:
^8.3(withbcmath,ctype,curl,dom,fileinfo,gd,mbstring,openssl,pdo_mysql,tokenizer,xml,zipextensions) - Composer:
^2.7 - Node.js:
^20.xor^22.x& npm - Database: MySQL
^8.0or MariaDB^10.5 - SMTP Service: A verified Brevo account with API/SMTP relay credentials
Follow these steps to configure and run the application locally:
git clone https://github.com/playpixelpro/GMR-System.git
cd GMR-System
# Install PHP dependencies
composer install
# Install JavaScript dependencies
npm installCopy the example environment template:
# macOS / Linux / Git Bash
cp .env.example .env
# Windows PowerShell
Copy-Item .env.example .envGenerate the cryptographic application key:
php artisan key:generateCreate a MySQL database (e.g., nfa_gmr), then configure .env:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=nfa_gmr
DB_USERNAME=root
DB_PASSWORD=your_passwordDefine initial administrator credentials in .env (required for initial seeding; must be at least 16 characters):
NFA_ADMIN_EMAIL=administrator@example.com
NFA_ADMIN_PASSWORD=SetAStrongPasswordWith16+Chars!Execute migrations and database seeders:
php artisan migrate --seed --no-interactionTip
To reset and seed a fresh database at any time during development:
php artisan migrate:fresh --seed --no-interactionUpdate email settings in .env to test password resets and account confirmations:
MAIL_MAILER=brevo
MAIL_FROM_ADDRESS=verified-sender@yourdomain.com
MAIL_FROM_NAME="${APP_NAME}"
BREVO_SMTP_HOST=smtp-relay.brevo.com
BREVO_SMTP_PORT=587
BREVO_SMTP_SCHEME=tls
BREVO_SMTP_USERNAME=your-brevo-login
BREVO_SMTP_PASSWORD=your-brevo-master-key
BREVO_SMTP_EHLO_DOMAIN=yourdomain.com# Build frontend assets
npm run build
# Start the local development server
php artisan serveFor live asset hot-reloading during UI development, execute:
npm run devVisit the application at http://127.0.0.1:8000.
User avatars resolve through a three-stage cascade:
- Local Uploaded Avatar: File stored in application storage.
- Gravatar: SHA-256 hash lookup of the user's email address (no plain-text email transmitted).
- Generated Fallback: Monogram/initials avatar.
To disable external Gravatar queries entirely, toggle:
GRAVATAR_ENABLED=falsecomposer install --no-dev --optimize-autoloader
npm ci
npm run buildEnsure the following variables are strictly set on your production server:
APP_ENV=production
APP_DEBUG=false
APP_URL=https://gmr.yourdomain.gov.phRun the production deployment routine:
# Apply schema updates
php artisan migrate --force
# Establish public symbolic link for avatars and assets
php artisan storage:link
# Cache configuration, routes, and views for peak performance
php artisan optimizeIf initializing a brand-new production database, seed the initial administrator:
php artisan db:seed --forceImportant
Configure your web server (Nginx / Apache / Caddy) document root to point strictly to the public/ directory. Never expose the repository root directory or the .env file to the web.
Maintain strict code reliability and formatting standards before pushing modifications:
# Run feature and unit test suites
php artisan test --compact
# Run test suite with PHPUnit directly
vendor/bin/phpunit
# Automatically format code to adhere to Laravel Pint standards
vendor/bin/pint --format agentThe GMR System is maintained and developed by playpixelpro. If this platform assists your agency or organization, please consider supporting future maintenance and development:
This software is released under the terms of the MIT License.