# ghaithalmomani/landregistrysystem architecture

> Architecture diagram of the GitHub repository ghaithalmomani/landregistrysystem, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ghaithalmomani/landregistrysystem
- Repository: https://github.com/ghaithalmomani/landregistrysystem

## Overview

##### Project type and purpose
- This is a monolithic full-stack web application built on a custom PHP MVC framework.
- Its purpose is to manage land property lifecycles: registering, transferring, viewing and auditing transactions with enhanced security (hashing, QR codes, optional blockchain integration).

##### File structure
- public/
- Entry point (index.php), static assets (CSS, JS, images, videos), .htaccess for URL rewriting.
- src/core/
- Framework core: App bootstrap, AutoLoader, Router, Request/Response, View renderer, Session handler, Hash utility, Logging, Validation, configuration and route definitions.
- src/controller/
- Controllers (e.g., HomeController) that handle incoming requests, coordinate with core services and prepare data for views.
- src/view/
- Templated views for each feature (home pages, property operations, auth, admin portal, error pages) plus layout templates.
- storage/
- Writable directories for logs and sessions.
- wise.sql
- Database schema for MySQL.

##### README for additional insights
- Confirms MVC pattern and outlines core classes (Router, Request, Response, View, Session, Hash, Validation, Log).
- Mentions integration points for QR-code generation and blockchain transactions.
- Deployment uses Apache + PHP8, PDO/MySQLi, .htaccess-based rewriting.

##### Detailed coverage
- Front Controller → Router → HomeController
- Core utility modules (Validation, Hash, Session, Log)
- View rendering pipeline
- Database schema/service
- File-based storage for logs/sessions
- External endpoints for QR/blockchain

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Client Layer"
        Client["Web Browser<br>(HTTP Client)"]:::client
    end

    subgraph "Web Server Layer"
        AP["Apache 2.4 + mod_rewrite"]:::server
        HTACCESS[".htaccess URL Rewriting"]:::server
    end

    subgraph "Application Layer"
        FC["Front Controller"]:::frontend
        App["App Bootstrap"]:::core
        Auto["AutoLoader"]:::core
        Router["Router"]:::core

        subgraph "Controllers"
            BaseC["Base Controller"]:::controller
            HomeC["HomeController"]:::controller
        end

        subgraph "Core Services"
            Req["Request"]:::core
            Res["Response"]:::core
            SessionI["Session Interface"]:::core
            SessionH["Session Handler"]:::core
            Hash["Hash Utility"]:::core
            Log["Logging Utility"]:::core
            Val["Validation"]:::core
        end

        subgraph "Views"
            ViewSrv["View Service"]:::view
            LayoutNav["navbar.tpl.php"]:::view
            LayoutMain["main.tpl.php"]:::view
            LayoutFoot["footer.tpl.php"]:::view
            FeatureViews["Feature Views"]:::view
        end
    end

    subgraph "Data Layer"
        DB["MySQL Database"]:::database
        FileStore["File Storage"]:::storage
        Schema["Database Schema"]:::storage
    end

    subgraph "External Services"
        QR["QR Code Service"]:::external
        BC["Blockchain API"]:::external
    end

    Client -->|"HTTP GET/POST"| AP
    AP -->|"Rewrite"| HTACCESS
    HTACCESS -->|"Front Controller"| FC

    FC -->|"bootstrap"| App
    FC -->|"autoload"| Auto
    App -->|"route init"| Router

    Router -->|"dispatch"| BaseC
    Router -->|"dispatch"| HomeC

    HomeC -->|"parse input"| Req
    HomeC -->|"validate"| Val
    HomeC -->|"session I/O"| SessionI
    HomeC -->|"session handler"| SessionH
    HomeC -->|"hash data"| Hash
    HomeC -->|"log event"| Log

    HomeC -->|"SQL query"| DB
    DB -->|"result"| HomeC

    HomeC -->|"render"| ViewSrv
    ViewSrv --> LayoutNav
    ViewSrv --> LayoutMain
    ViewSrv --> LayoutFoot
    ViewSrv --> FeatureViews

    HomeC -->|"prepare response"| Res
    Res -->|"HTTP Response"| AP
    AP -->|"HTTP"| Client

    HomeC -->|"generate QR"| QR
    HomeC -->|"blockchain tx"| BC

    SessionH -->|"file I/O"| FileStore
    Log -->|"write log"| FileStore
    Schema -.-> DB

    click FC "https://github.com/ghaithalmomani/landregistrysystem/blob/main/public/index.php"
    click HTACCESS "https://github.com/ghaithalmomani/landregistrysystem/blob/main/public/.htaccess"
    click App "https://github.com/ghaithalmomani/landregistrysystem/blob/main/src/core/App.php"
    click Auto "https://github.com/ghaithalmomani/landregistrysystem/blob/main/src/core/AutoLoader.php"
    click Router "https://github.com/ghaithalmomani/landregistrysystem/blob/main/src/core/Router.php"
    click Req "https://github.com/ghaithalmomani/landregistrysystem/blob/main/src/core/Request.php"
    click Res "https://github.com/ghaithalmomani/landregistrysystem/blob/main/src/core/Response.php"
    click BaseC "https://github.com/ghaithalmomani/landregistrysystem/blob/main/src/controller/Controller.php"
    click HomeC "https://github.com/ghaithalmomani/landregistrysystem/blob/main/src/controller/HomeController.php"
    click ViewSrv "https://github.com/ghaithalmomani/landregistrysystem/blob/main/src/core/View.php"
    click LayoutNav "https://github.com/ghaithalmomani/landregistrysystem/blob/main/src/view/layouts/navbar.tpl.php"
    click LayoutMain "https://github.com/ghaithalmomani/landregistrysystem/blob/main/src/view/layouts/main.tpl.php"
    click LayoutFoot "https://github.com/ghaithalmomani/landregistrysystem/blob/main/src/view/layouts/footer.tpl.php"
    click SessionI "https://github.com/ghaithalmomani/landregistrysystem/blob/main/src/core/session/Session.php"
    click SessionH "https://github.com/ghaithalmomani/landregistrysystem/blob/main/src/core/session/SessionHandler.php"
    click Hash "https://github.com/ghaithalmomani/landregistrysystem/blob/main/src/core/Hash.php"
    click Log "https://github.com/ghaithalmomani/landregistrysystem/blob/main/src/core/Log.php"
    click Val "https://github.com/ghaithalmomani/landregistrysystem/blob/main/src/core/validations/Validation.php"

    classDef client fill:#E0F7FA,stroke:#00796B,color:#004D40
    classDef server fill:#CFD8DC,stroke:#455A64,color:#263238
    classDef frontend fill:#BBDEFB,stroke:#1E88E5,color:#0D47A1
    classDef core fill:#90CAF9,stroke:#1976D2,color:#0D47A1
    classDef controller fill:#C8E6C9,stroke:#388E3C,color:#1B5E20
    classDef view fill:#FFF9C4,stroke:#FBC02D,color:#F57F17
    classDef database fill:#FFE0B2,stroke:#F57C00,color:#E65100,shape:cylinder
    classDef storage fill:#D7CCC8,stroke:#6D4C41,color:#3E2723,shape:folder
    classDef external fill:#E1BEE7,stroke:#8E24AA,color:#4A148C,shape:cloud
```
