NamisiteNAMISITE CDAGuides
Architecture

CDA architecture

How the Cane Development Application is put together: who uses it, which screens and apps they use, how a cane season moves through the system, and where the data lives.

Laravel 8 · PHP 8.2MySQLWeb portals + 3 mobile appsSession login on web, JWT on mobilecPanel hosting
cda.namisitehosting.net · v1.0.1 · docs updated 4 Nov 2026

1System components

One Laravel app serves every web portal and every mobile app. All of them share one MySQL database.

PEOPLEHOW THEY REACH CDASERVEROUTSIDE SERVICESTrial visitorfrom cda.namisite.comSuperadminNamisite teamMill admincane manager, officeZone, block, circlefield managersFDSfield development staffGrowercane farmerATSP partnertractor and service ownerWeb browser/trialfree trial form/mastersuperadmin site/fdsmill admin portal/atspATSP portalMobile apps (JWT)FDS app/apiGrower app/growerapiATSP app/atspapicPanel hosting · PHP 8.2 · ApacheLaravel 8 app (one codebase)Routes + checksweb.php, atsp.php, api, growerapi, atspapirole · permission · MasterOnly · jwt.verifyControllersAdmin · ATSP · master · TrialAPI · GrowerApi · AtspAPIScreensBlade pages, jQuery, DataTablesExcel import/export, PDF (mPDF)MessagesMail classes (trial, OTP)SmsUtility (OTP SMS)MySQL95 tables + trialone shared DBFilespublic/imagesstorage, uploads.env settingsDB, mail, SMS keys, JWT secret, trial daysHTTPSJSONSMS CountryOTP text messagesSMTP mailboxtrial and OTP emailPhones, inboxesgrowers, staff, millscda.namisite.comlanding page, linksto /trial and /fds/login
Web pages (browser, HTTPS)Mobile app calls (JSON + JWT token)Text messages and emailDashed: link or optional path

The parts

  • Laravel 8 app. PHP 8.2 on cPanel. Packages in use: tymon/jwt-auth (app tokens), maatwebsite/excel (CSV and Excel import/export), mpdf/mpdf (PDF), yajra/laravel-datatables (list screens), aws/aws-sdk-php (S3 file storage, optional).
  • Web screens. Server-rendered Blade pages with jQuery and DataTables. The Namisite look comes from public/css/namisite-theme.css and namisite-auth.css, loaded last in each layout.
  • Mobile apps. Three apps (FDS, Grower, ATSP) call JSON endpoints. They sign in with a phone OTP or email and password, and then send a JWT token with every call.
  • MySQL. One database for every mill. Each row carries the mill code (user_ft_code, mill_id, *_FACTID), and every screen filters by the signed-in user's mill.
  • Outside services. SMS Country sends OTP texts (app/Helpers/SmsUtility.php). An SMTP mailbox sends the trial and OTP emails. Both are set in .env; the demo has them blank, so nothing is sent from the demo.

2Sites and front doors

Two web addresses point at the same folder and the same database. The landing page is a separate static site.

AddressWhat it isWho uses it
cda.namisite.comStatic landing page: features, pricing, free trial buttonsVisitors, sales
cda.namisitehosting.net/Gateway with all sign-in optionsEveryone
/fds/login → /fds/dashboardMill admin portal (masters, planting, seed, stock, staff, reports)Mill admin, zone, block, circle staff
/atsp/login → /atsp/dashboardATSP portal (tools, services, rates, requests)ATSP admin
/trial, /trial/thank-youFree trial request formVisitors
superadmin-cda.namisitehosting.net → /masterSuperadmin site (mills, subscriptions, trials, ads, settings, reports)Namisite team
/api, /growerapi, /atspapiJSON endpoints for the three mobile appsFDS, grower, ATSP apps
/docs/These guides (plain HTML files, no sign in)Everyone

On the superadmin- address, the home page sends you straight to the superadmin sign in (AuthController::landing_Page).

3Sign in and roles

Web portals use a normal session. Mobile apps use a token. Both read the same users and roles tables.

🖥️

Mill admin (web)

Pick state, then sugar mill (loaded by /fds/fetch-mill), then email and password. The login must belong to that mill (user_ft_code). Mill details are kept in the session as loggedIn.

🛠️

ATSP and superadmin (web)

Email and password. /master only lets in the masteradmin role (MasterOnly middleware); any other role is signed out again.

📱

Mobile apps

Growers and ATSPs sign in with their phone and a 6-digit OTP (grower-send-otp, atsp-send-otp). FDS staff sign in with mill, email, password and the app build number (/api/login); the login is refused if the user's subscription is off or the app is out of date. Every later call needs the JWT token (jwt.verify).

⏳

Trial logins

At every web sign in the app checks trial_requests. An ended or disabled trial is refused with a clear message.

Roles in the database

0 · masteradmin (superadmin)1 · superadmin (mill group)50 · admin (mill admin)52 · zonal-manager53 · block-incharge59 · circle-incharge54 · fds-incharge55 · grower56 · atsp57 · executive-president

Users link to roles through users_roles. Each role has permissions such as view-grower, add-zone or edit-seed_distribution (roles_permissions, users_permissions, grouped by modules). The permission:… middleware checks one permission per screen; the superadmin role passes every check.

4Who can do what

full access   own area, or as set in Roles & Permissions   – no access

RoleMills, plans, trialsMastersStaff and rolesPlanting and seedStockATSP servicesReports
Superadmin (Namisite)–––––
Mill admin–
Zonal / block / circle–––
FDS (app)––––
Grower (app)–––––
ATSP (portal + app)–––––

A mill admin can make new roles and tick their permissions under FDS, Roles & Permissions, so what a zone or circle user sees depends on the mill.

5Cane season workflow

The core of CDA: from setting up the mill's map of villages and growers to the GPS survey of each plot.

SET UPMastersmill, zone, block, circle,village, grower, varietyPLANIndent targetarea target per FDSand seasonPLANPlanting indentgrower asks to plantarea, variety, methodPLANSeed planreservation, mapping,nursery, distributionFIELDSoil testreport per plotsoil, micro nutrientsFIELDPlantation entryplot, variety, method,seed, area in acre / haFIELDPlot activityagri practices, foliarspray, pest, diseaseREPORTCane survey + MISGPS corners per plot,dashboards and reports

Blue steps are planned in the office (web). Green steps are mostly done in the field by FDS staff on the app, and can also be entered on the web.

StepScreens (web)App endpointsMain tables
MastersMills, Zone, Block, Circle, Society, Centre, Village, Grower, Grower Plots; sub-masters (variety, planting method, seed type and source, treatments, land type, season…); Import CSVfetchAllmaster, fetchVillage, fetchGrowerfactory, zone, block, circle, village, grower, plots, variety, season
Indent targetCane Planting Indent TargetgetTarget, target_statusgrw_field_target
Planting indentCane Planting Indentcaneindentareacane_planting_indent_areas
Seed planSeed Management, Seed Mapping, Seed Nursery, Seed Distributionseedreservation, seedmapping, seednursery, seeddistributionseed_reservations, seed_mappings, seed_nursery, seed_dist
Soil testSoil Testingsoiltestreportsoil, soil_analysis
Plantation entryPlantation Entrycaneplantingcane_planting
Plot activityPlots Activity against Plantationadd_plot_activity, agripractices, add_foiler_sprayplot_activity, agri_practices, foiler_sprays
Survey + MISDashboard, MIS Report, Unit wise area and rainfalladdCanesurvey, dashboard, reportcane_surveys, cane_survey_details, area_statics, rain_falls

Daily work for staff

Mill admins give tasks from templates (To-Do Manager, Assign Template, Task Report). Staff see and close them in the FDS app (todo_list, user_task_status). Growers send queries and the app assigns them to their FDS (growerQuery, fdsQueryChat). Mills publish suggestions, which growers like and rate.

6Agri-input stock chain

Fertiliser, pesticide and other inputs move from the mill store down to the grower. Each level accepts what it receives, and the grower confirms with an OTP.

1 · MILLMill stockitem, qty, unit, ratemill_stocks2 · ZONEZone stockissued to zone,zone accepts · zone_stocks3 · FDSFDS stockissued to FDS,FDS accepts · fds_stocks4 · GROWERGrower receivesOTP sent to grower phone,match = handed over
  • Items, units and sources are masters (agri_items, agri_unit, agri_source).
  • Each move keeps opening and closing quantity, rate and amount, plus a ledger row (mill_transactions, zone_transactions, fds_transactions).
  • Pending lists let the receiver accept or refuse (pendingZoneStockList, statusUpdateFdsStock).
  • Hand-over to the grower: addGrowerStock sends an OTP to the grower's phone, and growerOtpMatch marks it given (grower_stocks). The grower app can also confirm with agriItemRecieved.
  • Loans against inputs are kept in loans and shown to growers in the app (loanlist).

7ATSP services

ATSP means Agriculture Technical Service Provider: a partner with tractors or tools who does land work for growers at the partner's own rates.

GROWER APPGrower bookspicks plot, service,nearby ATSP · pendingATSP APPATSP acceptsstatus accepted,start date setATSP APPWork sessionsstart and end times,total hours add upATSP APPCompletedend date set,shows in historyBOTHPayment statusmarked paid bygrower or ATSPGROWER APPRatinggrower rates theservice · rate_atsp_servicesANY TIMEQueriesgrower to ATSP chat,with video if needed

Set up in the ATSP portal

Assets, prices, tools (tool_masters), activities and services (services, atsp_services), service rates (service_rate_masters), capacity and ATSP users (atsp_user_services). The portal also shows plantation entries, seed nursery plots, ratoon, foliar spray, suggestions, grower queries and MIS reports.

Request statuses

pendingacceptedcompletedpayment_status

All of it lives in request_atsp_services (grower, plot, service, ATSP user, dates, times, total hours, payment status). Ratings go to rate_atsp_services.

8Free trial

Lets a mill try CDA on the demo mill without anyone setting it up by hand.

VISITORTrial form/trial: name, company,email, plan, growersAPPRequest savedtrial_requests · pending,emails to visitor + supportSUPERADMINSuperadmin review/master/trial-requestsapprove or rejectAPPLogin madeadmin role on demo mill 200,login emailedVISITORTrial sign in/fds/login, state UP,mill 200APPExpiry checkat every sign in: endedor disabled = refused
PartWhere
Form and thank-you pageTrialController, resources/views/trial/
Review list (approve, reject, resend login, disable)/master/trial-requests, side menu Service Management → Trial Requests
EmailsTrialRequestedMail (to support), TrialReceivedMail (copy to visitor), TrialLoginMail (login details)
Tabletrial_requests: status pending, approved, rejected or disabled; user_id; trial_ends_at
Settingsconfig/cda.php: CDA_TRIAL_DAYS (14), CDA_TRIAL_MILL (200), CDA_TRIAL_ROLE_ID (50), CDA_TRIAL_NOTIFY
Abuse limit5 form posts per 10 minutes per visitor (throttle:5,10)

9Superadmin site

Namisite's own control room for all mills. Reached at superadmin-cda.namisitehosting.net, role masteradmin only.

Mills and users

Master management, users, manage credentials and reset passwords. Mill settings per sugar mill.

Subscriptions

Per mill: one-time charge, hosting plan, and number and rate of FDS, ATSP and grower logins (subscriptions, hostings).

Trials and services

Trial Requests with a pending count in the menu. Manage services.

Advertisements

Ad creation, campaigns and orders. Apps fetch ads from /api/advertisement (advertisement_*, campaign_images).

Reports

State, mill, user, subscription, hosting and service wise reports, with CSV download.

Preview screens

ICANN and Azure hosting, email and WhatsApp settings, customer and limit settings, agreement documents. These show the layout only and do not save yet.