Buyer-hosted controller · Windows Desktop EXE + Web/PWA · English installation, configuration and practical user guide
Bahar Poultry Farm combines the existing farm workspace with a buyer-hosted device access-control panel. The supplied web edition runs in a desktop or mobile browser, with browser PWA installation where supported. A portable Windows x64 EXE and editable C# source/build script are included in Desktop/. This is a WebView2 desktop client for your hosted PHP app; it does not bundle a local PHP server or the old native database engine.
The owner manages device approval, Full/Preview access, bans and online/offline status. An owner can connect several installations to one controller. Farm production, stock, sales, debts and expenses remain in each browser profile. This is centralized ACCESS control, not automatic business-data synchronization or a consolidated multi-farm accounting service. Use separate origins or browser profiles to isolate farms; folders on the same origin share the app’s IndexedDB and identity keys.
Officer Login is the original Paid/Full workflow, Staff Preview is the original password-free Demo workflow, and Admin Panel opens the owner’s controller. These button labels do not create officer/subordinate roles, restricted staff permissions or a read-only preview. Staff Preview can use the same locally stored records as Full access. Use a separate browser profile for demonstrations.
Use a new HTTPS Apache hosting folder, PHP 8.1 or later, PHP sessions and PDO SQLite. SQLite is required for the bundled controller. The original account API has a file fallback, but that fallback does not replace the controller’s SQLite requirement. Optional cloud voices require PHP cURL and outbound HTTPS. Controller styling and optional push features may need internet access.
Upload CONTENTS of source/ into a new empty folder, such as public_html/poultry/. Keep hidden .htaccess files. Open /poultry/ for the farm and /poultry/controller/ for access management. Do not overwrite a working farm installation. The web build uses IndexedDB even on localhost; the old native /api/state runtime is not part of this staging edition.
Use ordinary file permissions644 and directory permissions755. Grant the PHP account the necessary write permission to data/ and controller/ for their SQLite databases, without granting global write access. data/control.sqlite stores registered accounts; controller/app_database.db stores device policies and administrator credentials. Both must be private. Check that requests to those database paths and private/ return403 before real registration. On Nginx or another server ignoring .htaccess, configure equivalent deny rules. Deny database journal/WAL/SHM files, controller/vendor/ and private configuration files as well. Never upload backup archives to public folders.
No original account database, production device database or Azure secret is included. They remain in the original installation. Keep the initial staging URL unpublished until the owner claims administrator setup.
Immediately open controller/ and use the original Create Admin Password screen. The hosting owner chooses and confirms a strong unique password. No default password or author master password is provided. Log in to the existing dashboard and keep its URL private where possible. The controller retains its original administrator session and remember-cookie behavior; log out on shared devices.
buyer-config.js contains public appName, controlBaseUrl, supportPhone and supportWhatsApp. Keep controlBaseUrl as controller/ for the bundled controller. To share a buyer-owned controller across farm installations, set this URL to the owner’s HTTPS controller address and configure the same base_url in private/controller.php. That PHP configuration belongs on the server, not in public JavaScript. Leave its base_url blank for the bundled controller. Never add admin passwords, API keys or tokens to buyer-config.js.
Give each installation a meaningful appName, such as North Farm. This name identifies device rows; it does not create a separate server business ledger. Test registration, approval, ban and re-enable from each farm before inviting staff. The optional deployment helper in controller/ requires administrator authentication and CSRF protection. It is unnecessary for the bundled app, which already loads the local mobile-gate script.
Choose Register on the farm login screen. Enter name, a unique username, mobile, optional email, password and confirmation. The original browser validation requires an11-digit Bangladesh mobile beginning01. Password minimum remains6characters; choose a longer unique password. Registration stores a PHP password_hash verifier in this installation’s private account store and sends identity/device metadata to the buyer controller. The author’s hosted approval service is not required.
First use Staff Preview with test details to enrol the device. In Admin Panel locate the matching device serial and app name. Use the panel’s existing Paid/Full controls to permit Full access. Officer Login then uses the registered username/password. If the newly created Full device row is Pending, approve/activate that row and retry Officer Login. The policy may block a new Full row until the owner grants access; a username/password alone does not bypass this controller policy. Paid/Full is an owner-managed access label, not an automatic payment gateway.
Staff Preview collects name/mobile without a password. Its original fallback may permit preview when the controller cannot be reached, except explicit banned/inactive responses. It is not a secure restricted employee role. Full sessions check status periodically; revocation is not instantaneous and offline availability is limited. Changing browser, clearing storage or changing device can require registration and approval again. Business data is not encrypted by the login screen and is not protected against someone controlling the unlocked device or browser developer tools.
A fresh app contains the original sample farm, flocks and transactions. Practise in a separate browser profile. Before entering real records, download Backup and retain a private copy. To start clean, use Restore and select the supplied Blank-Workspace.json. Restore REPLACES the complete local workspace; it does not merge records. This optional file changes only the browser workspace where you deliberately restore it. Settings → Reset restores the original sample data and removes current local entries after confirmation.
Set the farm’s name and contact details in Settings. Create Suppliers and Customers, then Sheds and Batches. Enter each batch’s actual start date and initial bird count. Enter opening feed and medicine quantities on their item records. Record opening saleable eggs with a dated Egg Production entry and an opening note, if necessary.
There is no separate opening cash/bank ledger or customer/supplier opening-balance field. If pre-existing debts must be represented, enter the real outstanding historical sales/purchases and their paid amounts, with clear carry-forward notes. These entries also affect reports and sometimes stock; reconcile quantities carefully. A customer payment reduces existing due; it does not create an opening receivable. Keep a separate opening reconciliation for cash/bank balances. Do not claim automatic accounting migration.
In Sheds add a name, type, capacity, operating status and notes. In Flocks/Batches choose the correct shed, enter batch number, type, breed, start date, initial birds, buying rate, target days and status. A photo is optional. For example, batch BR-01 starts with1000birds. The current count is initial birds minus daily mortality, culls and live-bird sales, with a minimum display of zero.
In Chick Purchases choose date, batch and hatchery supplier. Enter1000birds at70, paid50000. The purchase total is70000 and supplier due increases20000. A chick purchase records cost/debt; it does NOT add those1000birds again to the batch’s initial count. Initial Birds controls available birds. If birds are added to an existing batch, review and update the initial count deliberately while preserving a clear purchase trail. Do not double-count opening birds and purchases. Save, then check the batch card, purchase table and supplier due.
Create each feed item with name, brand, unit, opening stock and minimum stock. In Feed Purchases select the item and supplier, enter date, quantity, rate and paid amount. In Feed Usage choose batch, feed and kilograms actually issued. Feed stock equals opening quantity plus purchases minus Feed Usage.
Example: opening500kg plus purchase800kg minus usage620kg leaves680kg. Buying800kg at62 totals49600; paying40000 leaves9600supplier due. The usage form checks available stock before saving. Daily Record also has a Feed Intake field, but that field is an observation only and does NOT deduct feed stock. Enter the actual stock issue once in Feed Usage. Keep daily intake and issued stock consistent without duplicating issues. Review low-stock thresholds and compare the app balance with a physical count.
In Medicine & Vaccine add the product name, category, unit, opening stock, low-stock threshold and expiry. Keep units consistent, such as millilitres or doses. Record a purchase with supplier, quantity, rate and paid amount. Then record each treatment/usage against its batch and medicine, including quantity, reason, doctor and notes where appropriate.
Opening1000ml plus purchase1000ml minus treatment220ml leaves1780ml. A purchase is a financial liability; a treatment is stock consumption. Do not enter the same issue twice. Check expiry and remaining stock against the physical cabinet. These screens record farm activity; they do not calculate veterinary dosage, diagnose disease or prescribe treatment. Existing forms and stock formulas have been retained.
For each batch and date open Daily Record. Enter mortality, culls, average weight, feed intake, water litres, temperature and notes. Mortality and culls reduce batch birds. For1000initial birds,4mortality,1cull and20live-bird sales, current birds are975. The mortality percentage report uses mortality divided by initial birds; culls are a separate reduction. Recheck the batch and date before saving to prevent duplicate daily records.
In Egg Production select the laying batch and date. Enter total eggs and broken/spoiled eggs. Saleable eggs equal max(0,total minus broken). For560total and8broken,552are saleable. A sale of300eggs leaves252in global egg stock. Egg stock is aggregated across batches. The report does not maintain separate tray-to-piece conversion: enter quantities consistently in pieces when reconciling stock. Production alone creates stock, not sales income.
Create the customer first. In Sales enter invoice, date, category, optional batch, customer, quantity, unit, rate and paid amount. Total equals quantity times rate. Select the original Live Chicken category for bird depletion or Eggs for egg depletion. Other categories do not automatically deplete feed, medicine or live-bird stock.
Example:300eggs at12 totals3600. Paid3000leaves600due. Later collection200reduces that customer’s remaining due to400. Print the invoice and check company details, quantity and balance. The app does not automatically convert trays, kilograms or birds: for egg stock use a consistent piece quantity; for live-bird stock use bird count. A live sale entered in kilograms is not converted to birds by the original formula. Keep sale records and actual flock reductions consistent.
At day end compare initial birds minus mortality, culls and live sales with the physical flock; compare saleable production minus egg sales with physical eggs; compare feed/medicine opening plus purchases minus usage with remaining inventory. Customer due combines all sales and collections for that customer. Invoice printing shows the original sale’s total/paid/due and does not allocate later customer-level collections back to a specific invoice. Keep a receipt reference in payment notes.
Use Payments to record a customer collection or supplier payment. Select the correct party, date, amount, payment method and note. Customer due is unpaid sales minus collections, floored at zero. Supplier due combines unpaid chick, feed and medicine purchases minus supplier payments, also floored at zero. There is no separate visible credit balance for overpayment, so avoid entering more than the verified outstanding amount.
If feed purchases leave9600unpaid and you pay5000later, supplier due becomes4600. Do not also increase the original purchase’s Paid field for that same later payment: that would count payment twice. The same rule applies to customer collections. Correct a mistaken transaction by editing its existing row rather than adding a compensating duplicate without a reconciliation plan.
Record electricity, staff, transport, repairs and other running costs in Expenses. Do not repeat feed, chick or medicine purchases as Expenses, because Reports already subtracts those purchases. Payment records change debts; they are not an additional expense or additional sales revenue.
Reports summarizes all stored sales, chick purchases, feed purchases, medicine purchases and expenses. Net Result is sales minus those purchase totals minus expenses. This is a simple all-record operational result, not a stock-valued accrual profit statement, bank reconciliation or audited tax report. Opening stock values, unsold inventory and cash timing are not automatically adjusted.
Review each batch’s start birds, current birds, mortality, mortality percentage, recorded feed usage, saleable eggs and sales. Check missing or duplicated dates, negative stock, incorrect units and party selection. Print or export sales CSV for an external review. CSV contains sales only; use JSON Backup to preserve the complete farm dataset. Finish each workday with a private backup and periodic restore tests in an isolated browser profile.
Open Settings and change Farm Name, Tagline, Owner, Phone, WhatsApp, Email, Website, Trade License, Address and Invoice Note. Upload a farm logo or choose the default logo. Save and verify the header, profile and a printed invoice. Existing records remain intact. Source defaults can be changed in poultry-app.js seed(). Review sample contacts before commercial use. Replace brand-logo.webp, login-poultry.webp and brand-icon images only with assets you have rights to use. Update manifest.webmanifest names/icons, app.html title, and poultry-i18n.js title translations for complete rebranding.
Use the Bengali, English, Arabic, German and French buttons. The original translation engine and assistant language choices remain. Arabic uses RTL. Buyer-entered names and notes are not automatically translated. Some original dynamic labels, units and category values remain Bengali. Keep internal category values stable because inventory formulas compare those values. Add display translations through marketplace-labels.js using the existing five-column dictionary API.
There is no currency setting or automatic exchange conversion. Default money() in poultry-app.js prints the৳symbol and bn-BD numbers. For a dollar display, a developer may replace ONLY that formatter with const money=v=>'$ '+num(v).toLocaleString('en-US',{maximumFractionDigits:2});. If needed also change qty() and fmtDate() locale formats, and review translated unit labels. Changing a symbol does not convert stored amounts. Make a backup, decide the dataset’s currency before entering real records and test screen totals, invoice and reports after customization. Never mix currencies in one workspace without a separate conversion process.
The existing speech endpoint and five voices are retained: Bengali Nabanita, English Jenny, Arabic Zariyah, German Katja and French Denise. These are language-specific voices; Nabanita is the Bengali voice. Put the buyer’s own Azure Speech key and region in private/azure-speech.php or the corresponding server environment variables. Keep that directory private and verify HTTPS requests are permitted by the host. No author subscription key or free unlimited cloud service is included.
After selecting a language, press the assistant and allow audio playback. Test each language on the target browser. Cloud voices need internet and a valid Azure subscription. Browser speech fallback depends on locally installed system voices, and cached audio availability is limited. This package does not promise that Nabanita speaks all five languages offline. PWA installation does not create an offline Azure voice engine.
The service worker caches app assets after a successful online load. API, controller, PHP and cross-origin requests are not cached as authenticated content. Initial installation, registration, owner approval and cloud voice need connectivity. Existing preview fallback behavior remains; offline use is not a substitute for a secure restricted role or guaranteed remote revocation.
Use Backup to download the entire local JSON workspace. Store it privately: it contains farm, customer, supplier and accounting records. Restore validates basic structure and replaces the current workspace. Export a backup before restoring and test in an isolated browser first. Do not import an untrusted file or expect automatic data merging. Account and controller databases are server-side and require separate private hosting backups; the farm JSON does not include them.
For login failures check username/password, mobile format, account API responses, controller Paid policy, pending/active status and the correct device serial. Reset a token only from the owner panel when needed and retest that device. For server500 errors check PHP/PDO SQLite, directory permissions and private server logs. Do not expose logs publicly. For an old interface, back up records and update only this app’s service worker/site cache; do not clear all browser storage casually.
For wrong stock check quantities, internal sale categories, initial birds, duplicate records and the distinction between Daily Record feed observations and Feed Usage. For wrong balances check purchase/sale Paid fields and separate payment entries for double counting. Browser-profile changes do not transfer data automatically. Keep a tested backup before any update. The original farm logic, design, image assets and language/voice functionality remain; buyer-specific controller configuration and button names are the principal marketplace adaptations.
Requires Windows10/11x64, .NET Framework4.8 and Microsoft Edge WebView2 Evergreen Runtime. Extract Desktop/Windows-x64/ completely into a stable writable folder. Keep the EXE, both Microsoft WebView2 assemblies, WebView2Loader.dll, icon and desktop-settings.json together. Run Poultry-Farm-Desktop.exe. First run asks for YOUR hosted Farm HTTPS URL and Admin Panel HTTPS URL, plus window title. Save and Open loads the same farm UI. Production URLs must use HTTPS; HTTP is accepted only for localhost development. Passwords embedded in URLs are rejected. No author website is hardcoded in the desktop client.
The toolbar provides Farm, Admin Panel, Reload and Organisation Setup. Organisation Setup can change the URLs later. The portable EXE is not a signed installer. Install the Evergreen Runtime only from Microsoft’s official WebView2 website if it is missing. Do not bypass Windows security or browser certificate warnings.
Desktop records use a dedicated WebView2 profile under LocalAppData/PoultryFarmDesktop/<installation-folder-hash>/WebView2. They are separate from Chrome/Edge browser records. The original browser-generated Device ID persists with that profile; this is not a hardware-bound identifier. Moving the EXE to a different folder creates another profile and may require new device approval. Use farm JSON Backup/Restore to transfer records deliberately; there is no automatic desktop/web synchronization. Back up before moving folders or uninstalling. The hosting account/API and controller remain server-side; desktop does not bundle an independent offline authentication or cloud voice service. First run and login/approval need connectivity; cached availability follows the existing web app behavior.
The shipped desktop-settings.json has blank URLs so buyers supply their own addresses. User-selected settings are saved in the profile root. A distributor can prefill desktop-settings.json for a fresh installation without recompiling. Existing user settings take priority. No reviewer credentials or profile data are included in the sale ZIP.
For rebuilding, Desktop/Source/Program.cs is editable C# source. Restore Microsoft.Web.WebView2 version1.0.4258.31 from the official NuGet gallery into your package cache. Run build.ps1 with Windows PowerShell; its optional WebView2Package argument accepts that restored package folder. It uses the .NET Framework64 C# compiler and produces dist/. Microsoft WebView2 redistributables retain their supplied LICENSE.txt and NOTICE.txt. This package targets Windows x64; it does not provide Android, iOS or macOS binaries.
Official runtime: https://developer.microsoft.com/microsoft-edge/webview2/ · SDK: https://www.nuget.org/packages/Microsoft.Web.WebView2/1.0.4258.31