KeydUkun is a full-cycle poultry enterprise platform designed for hatchery operations, farm management, and financial control.
It tracks the process end-to-end: egg procurement -> incubation -> hatching -> chick growth -> inventory usage -> accounting -> reporting.
This system helps poultry businesses answer critical operational questions in one place:
- What is the hatch success rate by batch and incubator?
- How many chicks are currently alive, and where are they located?
- Which stock items are low or near expiry?
- Can we afford this expense or payroll run right now?
- Which operation units are profitable or loss-making?
| Layer | Technology |
|---|---|
| UI Layer | PHP views, Bootstrap 5, jQuery, AJAX |
| API Layer | PHP 7.4+ / 8.x REST-style JSON API |
| Data Layer | MySQL 5.7+ / MariaDB 10.4+ |
| Authentication | JWT (custom implementation) |
| Mail/Alerts | PHPMailer |
| Deployment | Apache + .htaccess rewrite |
flowchart LR
U[User Browser] --> V[PHP Views]
V --> J[JS Modules]
J --> A[REST API /api/v1]
A --> C[Controllers]
C --> H[Helpers + Middleware]
H --> D[(MySQL / MariaDB)]
C --> N[Notifications]
- User opens a page from
views/through Apache. - Frontend JS module sends AJAX calls to
/api/v1/.... - Middleware validates JWT and role permission.
- Controller validates payload and business rules.
- Database transaction is executed.
- JSON response returns to UI and updates state.
- Notification/log is created for important events.
flowchart TD
S[Supplier] --> E[Egg Batch]
E --> I[Incubation Session]
I --> F[Fertility Check]
F --> H[Hatching Record]
H --> C[Chick Batch]
C --> M[Mortality + Growth]
M --> R[Performance Reports]
E --> X[Egg Cost]
X --> PnL[Profit and Loss]
C --> Sales[Income]
Sales --> PnL
What it does
- Maintains supplier records and egg sourcing history.
- Creates egg batches with quantity, grade, and cost details.
- Generates batch references for traceability.
Why it matters
- Establishes data lineage from supplier to final profitability.
- Improves quality control before incubation starts.
Stage model: placed -> fertility_check -> development -> hatching -> completed
What it does
- Creates incubation sessions linked to egg batches and incubators.
- Records environment and observation logs (temperature/humidity/notes).
- Tracks fertile vs infertile eggs during checks.
- Supports stage progression and expected hatch timelines.
Why it matters
- Converts manual incubator notes into measurable outcomes.
- Enables hatch-rate analytics by session, incubator, and source batch.
What it does
- Records hatch outcomes (hatched, dead-in-shell, infertile, early loss).
- Automatically creates chick batches from hatch records.
- Tracks cage assignment, growth, and mortality events.
Why it matters
- Maintains continuity from incubation results to live flock operations.
- Gives accurate alive-count and health trend visibility.
What it does
- Manages inventory items by category (feed, medicine, equipment, packaging).
- Records stock movements and manual adjustments.
- Flags low-stock levels and medicine expiry risks.
Why it matters
- Prevents stock-out disruptions in feeding/treatment plans.
- Supports better purchasing and wastage reduction.
sequenceDiagram
participant UI as UI/API Caller
participant F as Finance Controller
participant DB as Accounts DB
UI->>F: Create Expense(amount, account_id)
F->>DB: Check current balance
alt balance >= amount
F->>DB: Insert expense + debit account
F->>DB: Insert account transaction snapshot
F-->>UI: Success
else insufficient balance
F-->>UI: Reject (validation error)
end
What it does
- Handles accounts, incomes, expenses, and transaction history.
- Auto-credits balances on income and auto-debits on expense.
- Blocks overspending at write-time.
- Supports low-balance alerting and multi-account operations.
Why it matters
- Protects cash integrity and prevents hidden negative balances.
- Creates auditable financial movement trails.
What it does
- Stores employee profiles and payroll history.
- Supports advance payments and deduction tracking.
- Generates payroll periods with validation checks.
- Records salary payout impact in finance.
Why it matters
- Unifies workforce cost control with accounting controls.
- Reduces payroll calculation errors and unpaid liabilities.
What it does
- Profit and loss report by period/category.
- Hatch rate analytics and batch performance.
- Mortality report by cause and trend.
- Cash flow trend and inventory valuation.
Why it matters
- Turns raw transactions into decision-ready KPIs.
- Helps managers optimize breeding, feed planning, and spending.
What it does
- JWT authentication for API access.
- Role-based permissions (Admin, Manager, Accountant, Worker).
- Input validation and prepared statements.
- Password hashing and login logging.
Why it matters
- Protects operational and financial data from misuse.
- Enforces least-privilege access by function.
http://localhost/dooro/api/v1/
- Login endpoint returns JWT tokens.
- All protected endpoints require:
Authorization: Bearer <jwt-token>
- Auth:
/auth/* - Hatchery:
/batches,/suppliers - Incubation:
/incubation/*,/incubators,/hatching/* - Chick Ops:
/chicks,/cages,/mortality - Inventory:
/inventory/*,/stock - Finance:
/accounts,/incomes,/expenses - HR/Payroll:
/employees,/payroll/* - Reports:
/reports/* - System:
/dashboard,/notifications,/users,/settings
{
"success": true,
"data": {},
"message": "Optional status message"
}{
"success": true,
"data": [],
"pagination": {
"total": 150,
"per_page": 20,
"current_page": 1,
"last_page": 8
}
}- Windows (XAMPP):
C:\xampp\htdocs\dooro\ - Linux (LAMP):
/var/www/html/dooro/
cp .env.example .envUpdate database and app settings in .env.
mysql -u root -p < database/migrations/001_create_schema.sql
mysql -u root -p KeydUkun < database/seeds/001_seed_data.sql- Ensure Apache
mod_rewriteis enabled. - Ensure
AllowOverride Allis enabled for project directory.
| URL | Purpose |
|---|---|
http://localhost/dooro/ |
Main App |
http://localhost/dooro/views/auth/login.php |
Login |
http://localhost/dooro/api/v1/ |
API Base |
| Role | Password | |
|---|---|---|
| Admin | admin@KeydUkun.com |
password |
| Manager | manager@KeydUkun.com |
password |
| Accountant | accountant@KeydUkun.com |
password |
| Worker | worker@KeydUkun.com |
password |
Security note: change all default passwords immediately.
dooro/
|-- api/
| |-- config/
| |-- controllers/
| |-- helpers/
| |-- middleware/
| `-- index.php
|-- database/
| |-- migrations/
| `-- seeds/
|-- includes/partials/
|-- public/assets/
|-- views/
|-- uploads/
|-- logs/
|-- .env.example
|-- .htaccess
`-- index.php
users, roles, permissions, role_permissions
auth_tokens, login_logs
suppliers, egg_batches
incubators, incubation_sessions, incubation_logs
hatch_records, chick_batches, cages
mortality_logs, feeding_schedules
inventory_categories, inventory_items, stock_movements
accounts, incomes, expenses, account_transactions
income_categories, expense_categories
departments, employees
payroll_periods, payroll_items, advance_payments
notifications, settings
- Install Apache, PHP, MySQL.
- Enable rewrite module.
- Create database and credentials.
- Run migrations and seeders.
- Configure
.envwith production values. - Restrict file permissions on
uploads/andlogs/. - Enforce HTTPS and strong JWT secret.
- Disable debug mode in production.
- Change seeded passwords and secret keys.
- Configure SMTP and alert channels.
- Schedule automated DB backups.
- Verify role permissions per user group.
- Validate CORS and API exposure rules.
- Multi-language (Somali + English)
- Mobile client integration
- AI hatch-rate prediction
- QR/barcode batch tracking
- WhatsApp/SMS notifications
- PDF/Excel exports
- Cron automation for stage transitions
Built for KeydUkun Poultry Farm.
Version 1.0.0 (April 2026)