تخطَّ إلى المحتوى
نخيلاند
الآن

Data Architecture

One governed data model behind every module

Data is treated as an enterprise asset rather than a by-product of software. Every entity below has one authoritative source, a permanent identifier, documented relationships and a defined lifecycle — so evidence remains reliable as the platform expands.

Principles

Four governing data principles

Applied to every table, relationship and integration across the ecosystem.

Single source of truth

Every business entity has one authoritative record. Modules read from it rather than keeping private copies.

Explicit relationships

Relationships are declared, documented and enforced so consistency, accuracy and traceability survive growth.

Master & reference data

Varieties, counterparties and lookup values are centralized. Hard-coded values are treated as defects.

Auditability & soft delete

Critical records carry creation, modification and version history, and are logically retired rather than erased.

Data dictionary

Documented enterprise entities

Each entity records its owning function, purpose, permanent identifier, key attributes, relationships and lifecycle position.

Master data

User Identity & Preferences

Owner · Identity

One enterprise identity per person: contact details, account type, language, currency, location, privacy and notification preferences.

Identifier · id (uuid, matches the authentication record)

Key attributes

  • account_type · app_roleDeclared type; administrative types are never self-selectable
  • language / currency · textArabic and EGP by default
  • profile_visibility · textPrivate by default
  • deleted_at · timestamptzSoft delete preserves history

Relationships

  • One person has many roles, favorites, activities, calculations, farms, orders and documents

Registered → active → suspended → retired (retained)

Master data

Organizations

Owner · Enterprise Accounts

Companies, farms, suppliers, partners, research bodies and government entities, with memberships that grant organisational access.

Identifier · organization_id (uuid), unique slug

Key attributes

  • type · enumcompany, farm, supplier, partner, research, government
  • member_role · textowner, manager, member, viewer
  • status · enumControlled status; pending until verified

Relationships

  • One organization has many members, documents, farms and orders

Requested → verified → active → archived

Master data

Palm Varieties

Owner · Agronomy

The authoritative encyclopedia record for each cultivar: origin, climate, soil, water, fertilisation, planting, growth, production, fruit characteristics and economic value in both languages.

Identifier · variety_id (uuid), unique slug

Key attributes

  • scientific_name · textBotanical reference
  • yield_kg_min / max · numericValidated, non-negative, max ≥ min
  • cover_media_id · uuidForeign key → media library
  • status · enumDraft until reviewed; only live records are public

Relationships

  • One variety relates to many products, articles and palm trees
  • Varieties ground the enterprise AI assistant's agronomy answers

Draft → expert review → active → archived

Master data

Products & Services

Owner · Commercial

Every sellable item and service with bilingual naming, specifications, explicit price and currency, inventory, availability and related variety — never hard-coded into pages.

Identifier · product_id / service_id (uuid), unique slug and SKU

Key attributes

  • price / currency · numeric / textNon-negative; currency always stored
  • unit_code · textReference data — pricing unit
  • inventory_quantity · numericNon-negative stock position
  • pricing_model · textfixed, hourly, per feddan, per palm, quotation, subscription

Relationships

  • Product → palm variety; product/service → order items; service → projects and knowledge

Draft → approved → active → inactive → archived

Master data

Knowledge Categories & Articles

Owner · Knowledge

Hierarchical categories and versioned bilingual articles with author, source, references, SEO metadata, reading level and expert review flag.

Identifier · article_id / category_id (uuid), unique slug

Key attributes

  • parent_id · uuidSelf-referencing category tree
  • version · integerIncremented on substantive change; snapshots kept
  • expert_reviewed · booleanAuthority signal, never assumed
  • published_at · timestamptzPublication date, distinct from creation

Relationships

  • Article → category, variety, product, service and project through the relationship graph
  • Authors always read their own drafts; visitors read only published records

Draft → review → published → updated (new version) → archived

Master data

Land Opportunities & Projects

Owner · Investment

Land offers with area, type, ownership status, price, payment and instalment options and suitability; projects with land, establishment and operating costs, expected production, revenue, profit, return and payback.

Identifier · land_opportunity_id / project_id (uuid), unique slug

Key attributes

  • area / area_unit · numeric / textFeddan by default, convertible centrally
  • investment_path · textPath A owns land · Path B acquires land
  • accuracy_label · textVerified, operational or illustrative — always disclosed
  • roi_percent / payback_years · numericModelled, non-negative payback

Relationships

  • Project → land opportunity, location, products, services and investments

Draft → approved → active → completed → archived

Master data

Media Library

Owner · Brand

One library for images, video, documents, audio and infographics with alternative text, caption, author, copyright and the entity each asset belongs to.

Identifier · media_id (uuid)

Key attributes

  • type · enumimage, video, document, audio, infographic
  • alt_ar / alt_en · textAccessibility and image search in both languages
  • entity_type / entity_id · text / uuidPolymorphic attachment

Relationships

  • Referenced as cover media by varieties, products, services, land, projects and farms

Uploaded → active → archived (soft delete)

Operational data

Farms & Palm Trees

Owner · Estate Operations

Owner-scoped estates with area, land type, irrigation system, water source and soil information, down to individual palm records with variety, planting date, height, health, block position and coordinates.

Identifier · farm_id / palm_id (uuid); palm tag unique within a farm

Key attributes

  • owner_id · uuidNon-nullable owner; row access derives from it
  • palm_count · integerNon-negative
  • health_status · enumexcellent → dead, controlled values only
  • deleted_at · timestamptzSoft delete keeps operating history

Relationships

  • One farm has many palm trees, production records and expense records
  • Palm tree → variety (master data)

Registered → active → inactive → archived

Operational data

Production & Expense Records

Owner · Estate Operations

Season-by-season harvest quantity, quality grade and revenue, and categorised operating expenses — each with its own unit and currency.

Identifier · record_id (uuid)

Key attributes

  • season_year · smallintValidated calendar range
  • quantity / quantity_unit · numeric / textNon-negative, kilogram by default
  • amount / currency · numeric / textNon-negative, EGP by default

Relationships

  • Production and expenses roll up to farm, variety and analytics

Recorded → verified → archived

Operational data

Calculations & Investments

Owner · Investment

Persistent calculator runs with their inputs, outputs, currency and engine version, and investor records carrying capital, costs, revenue, profit, return, cash flow, payback and risk notes.

Identifier · calculation_id / investment_id (uuid)

Key attributes

  • inputs / outputs · jsonbReproducible result, tied to an engine version
  • engine_version · textResults remain interpretable after model changes
  • cash_flow · jsonbPeriod-by-period projection

Relationships

  • Calculation → project; investment → project and land opportunity

Draft → saved → superseded by a new version

Operational data

Orders, Order Items & Payment Intents

Owner · Commercial

Commerce-ready records with reference number, line items, totals, currency, order and payment status, and shipping details. Payment intents store provider references only.

Identifier · order_id (uuid), human reference NKL-ORD-YYYY-XXXXXXXX

Key attributes

  • order_status / payment_status · enumControlled transitions
  • name_snapshot / unit_price · text / numericLine item history is immutable to later catalogue edits
  • provider_reference · textNo card numbers, tokens or gateway secrets are ever stored

Relationships

  • Order → customer, items, payment intents; item → product or service

Draft → placed → confirmed → delivered → completed / refunded

Operational data

Notifications, Threads & Messages

Owner · Customer Experience

Per-person notifications with type, priority, read state and action target; message threads for support, projects, agronomy and investment consultation.

Identifier · notification_id / thread_id / message_id (uuid)

Key attributes

  • priority · enumlow, normal, high, critical
  • topic · textControlled consultation topics
  • body · textLength validated between 1 and 10,000 characters

Relationships

  • Thread → messages; both scoped to their participants

Created → read / replied → closed → archived

Operational data

Documents, Reviews & Favorites

Owner · Governance

Versioned documents with owner, visibility and related entity; moderated reviews with rating, verification and moderation state; saved items across every public entity type.

Identifier · document_id / review_id / favorite_id (uuid)

Key attributes

  • visibility · textprivate, organization or public — private by default
  • rating · smallintValidated 1–5, one review per person per entity
  • moderation_status · enumPublic only after approval

Relationships

  • All three attach to any entity through type and identifier

Created → moderated → published → archived

Reference data

Currencies

Owner · Finance

Central currency register. Every financial amount in the platform stores its currency explicitly; EGP is the default, never an assumption.

Identifier · code (ISO 4217, stable)

Key attributes

  • code · textPrimary key — EGP, USD, SAR, AED, EUR, GBP
  • name_ar / name_en · textBilingual label, no duplicate tables
  • symbol · textDisplay symbol for formatted output
  • is_default · booleanEGP is the platform default

Relationships

  • Referenced by products, services, projects, land opportunities, farms, orders, investments and calculations

Registered → active → deactivated (never deleted)

Reference data

Measurement Units

Owner · Agronomy

Centralized agricultural units and conversion factors — feddan, acre, hectare, square metre, kilogram, ton, metre, litre, cubic metre and palm count.

Identifier · code (stable text)

Key attributes

  • code · textPrimary key
  • dimension · textarea, mass, length, volume or count
  • base_unit · textCanonical unit for the dimension
  • factor_to_base · numericSingle conversion source; 1 feddan = 4,200.83 m²

Relationships

  • Referenced by land opportunities, projects, farms and production records
  • Conversion is performed centrally, never re-derived per page

Registered → active → deactivated

Reference data

Countries · Regions · Locations

Owner · Market Development

Scalable geographic hierarchy — country, region, governorate, city, area, coordinates — carrying an explicit market tier so Egypt is served first and expansion needs no restructuring.

Identifier · country_id / region_id / location_id (uuid)

Key attributes

  • iso2 · textUnique country code
  • market_tier · smallint1 Egypt · 2 Arab world · 3 Africa · 4 global
  • parent_id · uuidSelf-referencing region hierarchy
  • latitude / longitude · numericValidated coordinate ranges

Relationships

  • One country has many regions; one region has many child regions and locations
  • Organizations, land opportunities, projects and farms reference geography rather than free text

Created → active → archived (soft delete)

Reference data

Permissions & Role Permissions

Owner · Security

Access rights are stored separately from personal identity. Roles carry permissions; identity never does.

Identifier · permission_id (uuid), unique permission key

Key attributes

  • key · texte.g. catalog.manage, audit.view
  • module · textOwning module for resource-level access
  • role · app_roleTwelve account types from visitor to super administrator

Relationships

  • Role permissions join roles to permissions; user roles live in their own table
  • Row-level rules are evaluated in the database, never in the interface

Defined → granted → revoked

Governance data

Analytics Events

Owner · Analytics

One append-only event stream for page views, searches, call-to-action clicks, product and project views, calculator use, form submissions, purchases, investment enquiries and AI interactions.

Identifier · event_id (uuid)

Key attributes

  • event_type · textIndexed with the timestamp for efficient reporting
  • properties · jsonbEvent-specific payload, no personal identifiers required
  • country_id / language / currency · uuid / textMarket and localisation dimensions

Relationships

  • Optional link to a person; readable only by administrators

Recorded → aggregated → retained per policy

Governance data

Audit Log

Owner · Security

Administrative and sensitive actions recorded with actor, action, entity, previous state, new state and technical metadata. Never edited, never deleted.

Identifier · audit_id (uuid)

Key attributes

  • previous_state / new_state · jsonbBefore-and-after evidence
  • technical_metadata · jsonbCaptured only where legally appropriate

Relationships

  • Attaches to any entity by type and identifier; administrator read access only

Written once → retained → never modified

Governance data

Version History

Owner · Knowledge

Snapshots of critical business and knowledge records so prior published statements remain reconstructable.

Identifier · version_id (uuid); unique per entity and version number

Key attributes

  • snapshot · jsonbFull record state at that version
  • change_note · textWhy the record changed

Relationships

  • Applies to articles, varieties, projects and any versioned entity

Captured on change → retained

Governance data

Relationship Graph

Owner · Architecture

Explicit, queryable links between entities — variety to product, variety to article, project to land, project to service — so relationships are modelled once instead of repeated per page.

Identifier · relation_id (uuid); unique per source, relation and target

Key attributes

  • source_type / source_id · text / uuidIndexed for fast traversal
  • relation · textNamed relationship rather than an implied join
  • sort_order · integerDeterministic presentation order

Relationships

  • Powers related-content blocks, internal linking and AI grounding

Declared → maintained → removed when no longer true

Standards

Audit columns and centralized reference data

Applied uniformly so history, ownership and lookup values never diverge between modules.

Standard audit columns

  • created_atWhen the record entered the platform — set by the database, never the client.
  • updated_atMaintained by a database trigger on every table that changes.
  • deleted_atSoft deletion. Records leave operational use while history is preserved.
  • statusControlled lifecycle value: draft, pending, active, inactive, archived, rejected, approved, completed.
  • versionVersion number on knowledge and other critical records, with snapshots retained.
  • owner_id / user_idNon-nullable ownership on personal records; row access is derived from it, never supplied by the caller.

Centralized reference sets

  • CurrenciesEGP default, with USD, EUR, SAR, AED and GBP. Every amount stores its currency explicitly.
  • Measurement unitsFeddan, acre, hectare, square metre, kilogram, ton, metre, litre, cubic metre and palm — one conversion factor each.
  • GeographyCountry, region hierarchy and location with coordinates, tiered Egypt → Arab world → Africa → global.
  • Account typesVisitor, customer, investor, farmer, company, supplier, engineer, consultant, researcher, government, administrator, super administrator.
  • Status valuesOne shared status vocabulary across every major entity.
  • PermissionsModule-scoped permission keys granted to roles, never to individual identities.

Units & currency

Agricultural units and money, converted centrally

Every financial record stores its currency explicitly with EGP as the default, and every measurement resolves through one conversion table rather than page-level arithmetic.

Measurement units and their conversion factors
UnitDimensionBase unitFactor
Square metre · متر مربعaream21
Feddan · فدانaream24,200.83
Acre · أكرaream24,046.86
Hectare · هكتارaream210,000
Kilogram · كيلوجرامmasskg1
Ton · طنmasskg1,000
Metre · مترlengthm1
Litre · لترvolumel1
Cubic metre · متر مكعبvolumel1,000
Palm · نخلةcountpalm1

Lifecycle

From creation to retirement

Every record moves through the same six governed stages, with retention decisions documented rather than implied.

01

Create

Validated at entry: required fields, ranges, relationships and duplicate prevention are enforced by the database, not only the form.

02

Classify

The record joins its ecosystem, category and geography so it is discoverable and never orphaned.

03

Operate

Modules read the single authoritative record instead of holding private copies.

04

Version

Substantive changes to critical and knowledge records are snapshotted with a change note.

05

Retire

Soft deletion removes the record from operational use while preserving history and prior disclosures.

06

Retain

Retention, backup and recovery are governed decisions with documented periods.

Questions

Data governance questions answered

Identifiers, deletion policy, validation and integration readiness.

Next step

Review the data model with the enterprise team

Data ownership, retention periods and integration mappings are confirmed during enterprise qualification. Ownership names shown here are placeholders pending confirmation of accountable functions.