1System components
One Laravel app serves every web portal and every mobile app. All of them share one MySQL database.
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.cssandnamisite-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.
| Address | What it is | Who uses it |
|---|---|---|
| cda.namisite.com | Static landing page: features, pricing, free trial buttons | Visitors, sales |
cda.namisitehosting.net/ | Gateway with all sign-in options | Everyone |
/fds/login → /fds/dashboard | Mill admin portal (masters, planting, seed, stock, staff, reports) | Mill admin, zone, block, circle staff |
/atsp/login → /atsp/dashboard | ATSP portal (tools, services, rates, requests) | ATSP admin |
/trial, /trial/thank-you | Free trial request form | Visitors |
superadmin-cda.namisitehosting.net → /master | Superadmin site (mills, subscriptions, trials, ads, settings, reports) | Namisite team |
/api, /growerapi, /atspapi | JSON endpoints for the three mobile apps | FDS, 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
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
| Role | Mills, plans, trials | Masters | Staff and roles | Planting and seed | Stock | ATSP services | Reports |
|---|---|---|---|---|---|---|---|
| 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.
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.
| Step | Screens (web) | App endpoints | Main tables |
|---|---|---|---|
| Masters | Mills, Zone, Block, Circle, Society, Centre, Village, Grower, Grower Plots; sub-masters (variety, planting method, seed type and source, treatments, land type, season…); Import CSV | fetchAllmaster, fetchVillage, fetchGrower | factory, zone, block, circle, village, grower, plots, variety, season |
| Indent target | Cane Planting Indent Target | getTarget, target_status | grw_field_target |
| Planting indent | Cane Planting Indent | caneindentarea | cane_planting_indent_areas |
| Seed plan | Seed Management, Seed Mapping, Seed Nursery, Seed Distribution | seedreservation, seedmapping, seednursery, seeddistribution | seed_reservations, seed_mappings, seed_nursery, seed_dist |
| Soil test | Soil Testing | soiltestreport | soil, soil_analysis |
| Plantation entry | Plantation Entry | caneplanting | cane_planting |
| Plot activity | Plots Activity against Plantation | add_plot_activity, agripractices, add_foiler_spray | plot_activity, agri_practices, foiler_sprays |
| Survey + MIS | Dashboard, MIS Report, Unit wise area and rainfall | addCanesurvey, dashboard, report | cane_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.
- 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:
addGrowerStocksends an OTP to the grower's phone, andgrowerOtpMatchmarks it given (grower_stocks). The grower app can also confirm withagriItemRecieved. - Loans against inputs are kept in
loansand 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.
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
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.
| Part | Where |
|---|---|
| Form and thank-you page | TrialController, resources/views/trial/ |
| Review list (approve, reject, resend login, disable) | /master/trial-requests, side menu Service Management → Trial Requests |
| Emails | TrialRequestedMail (to support), TrialReceivedMail (copy to visitor), TrialLoginMail (login details) |
| Table | trial_requests: status pending, approved, rejected or disabled; user_id; trial_ends_at |
| Settings | config/cda.php: CDA_TRIAL_DAYS (14), CDA_TRIAL_MILL (200), CDA_TRIAL_ROLE_ID (50), CDA_TRIAL_NOTIFY |
| Abuse limit | 5 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.
