# janpol141414/landsurvey architecture

> Architecture diagram of the GitHub repository janpol141414/landsurvey, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/janpol141414/landsurvey
- Repository: https://github.com/janpol141414/landsurvey

## Overview

This is a PHP/MySQL land-surveying services portal for clients, engineers, and administrators. The principal client workflow is browsing providers, booking an appointment against availability, tracking survey progress, submitting payment, and communicating or leaving feedback. Engineer and admin workspaces manage appointments, schedules, progress, payments, and platform records. The graph preserves the README’s AI assistance and email-notification capabilities. Some subsystem connections are documented only in the README; unsampled implementation details are not inferred.

Main entry points: [`client/book-appointment.php`](https://github.com/janpol141414/landsurvey/blob/main/client/book-appointment.php) (Appointment booking), [`config/database.php`](https://github.com/janpol141414/landsurvey/blob/main/config/database.php) (MySQL database), [`models/Appointment.php`](https://github.com/janpol141414/landsurvey/blob/main/models/Appointment.php) (Appointment records), [`api/messages.php`](https://github.com/janpol141414/landsurvey/blob/main/api/messages.php) (Client messaging)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Portal experience"]
  node_landing["Service discovery<br/>[index.php]"]
  node_identity["Account access<br/>[login.php]"]
  node_client_portal["Client workspace<br/>[dashboard.php]"]
  node_provider_browse["Provider browsing<br/>[engineers.php]"]
  node_company_browse["Company browsing<br/>[companies.php]"]
end

subgraph group_work["Survey workflow"]
  node_booking["Appointment booking"]
  node_availability["Availability scheduling<br/>[Schedule.php]"]
  node_tracking["Progress tracking<br/>[progress.php]"]
  node_payment["Payment submission<br/>[payment.php]"]
  node_feedback["Ratings feedback<br/>[feedback.php]"]
  node_messaging["Client messaging<br/>[messages.php]"]
end

subgraph group_operations["Role operations"]
  node_engineer_ops["Engineer workspace<br/>[appointments.php]"]
  node_admin_ops["Admin workspace<br/>[appointments.php]"]
end

subgraph group_services["Shared services"]
  node_chatbot["AI assistance<br/>[AIHelper.php]"]
  node_notifications["Notifications<br/>[Notification.php]"]
  node_email["Email delivery<br/>[EmailHelper.php]"]
end

subgraph group_data["Domain data"]
  node_users["User records<br/>[User.php]"]
  node_engineers["Engineer records<br/>[Engineer.php]"]
  node_appointments["Appointment records<br/>[Appointment.php]"]
  node_payments["Payment records<br/>[Payment.php]"]
  node_messages["Message records<br/>[Message.php]"]
  node_companies["Company records<br/>[Company.php]"]
  node_mysql[("MySQL database<br/>[database.php]")]
end

node_client(("Client"))
node_engineer(("Engineer"))
node_admin(("Administrator"))

node_client -->|"explores services"| node_landing
node_client -->|"signs in"| node_identity
node_engineer -->|"signs in"| node_identity
node_admin -->|"signs in"| node_identity
node_client -->|"browses engineers"| node_provider_browse
node_client -->|"browses companies"| node_company_browse
node_client -->|"books appointment"| node_booking
node_booking -->|"checks slots"| node_availability
node_booking -->|"creates booking"| node_appointments
node_booking -->|"assigns engineer"| node_engineers
node_booking -->|"notifies engineer"| node_notifications
node_booking -->|"sends confirmation"| node_email
node_engineer -->|"manages work"| node_engineer_ops
node_engineer_ops -->|"updates appointments"| node_appointments
node_admin -->|"manages system"| node_admin_ops
node_admin_ops -->|"manages bookings"| node_appointments
node_admin_ops -->|"verifies payments"| node_payments
node_client -->|"tracks progress"| node_tracking
node_engineer -->|"updates progress"| node_tracking
node_tracking -->|"reads progress"| node_appointments
node_client -->|"submits payment"| node_payment
node_payment -->|"records payment"| node_payments
node_client -->|"messages engineer"| node_messaging
node_engineer -->|"replies to client"| node_messaging
node_messaging -->|"stores messages"| node_messages
node_client -->|"leaves rating"| node_feedback
node_client -->|"asks questions"| node_chatbot
node_messaging -->|"uses auto-reply"| node_chatbot
node_appointments -->|"reads and writes"| node_mysql
node_engineers -->|"reads and writes"| node_mysql
node_messages -->|"reads and writes"| node_mysql
node_payments -->|"reads and writes"| node_mysql
node_users -->|"reads and writes"| node_mysql
node_companies -->|"reads and writes"| node_mysql
node_availability -->|"reads and writes"| node_mysql

click node_landing "https://github.com/janpol141414/landsurvey/blob/main/index.php"
click node_identity "https://github.com/janpol141414/landsurvey/blob/main/auth/login.php"
click node_client_portal "https://github.com/janpol141414/landsurvey/blob/main/client/dashboard.php"
click node_provider_browse "https://github.com/janpol141414/landsurvey/blob/main/client/engineers.php"
click node_company_browse "https://github.com/janpol141414/landsurvey/blob/main/client/companies.php"
click node_booking "https://github.com/janpol141414/landsurvey/blob/main/client/book-appointment.php"
click node_availability "https://github.com/janpol141414/landsurvey/blob/main/models/Schedule.php"
click node_tracking "https://github.com/janpol141414/landsurvey/blob/main/engineer/progress.php"
click node_payment "https://github.com/janpol141414/landsurvey/blob/main/client/payment.php"
click node_feedback "https://github.com/janpol141414/landsurvey/blob/main/client/feedback.php"
click node_messaging "https://github.com/janpol141414/landsurvey/blob/main/api/messages.php"
click node_engineer_ops "https://github.com/janpol141414/landsurvey/blob/main/engineer/appointments.php"
click node_admin_ops "https://github.com/janpol141414/landsurvey/blob/main/admin/appointments.php"
click node_chatbot "https://github.com/janpol141414/landsurvey/blob/main/helpers/AIHelper.php"
click node_notifications "https://github.com/janpol141414/landsurvey/blob/main/models/Notification.php"
click node_email "https://github.com/janpol141414/landsurvey/blob/main/helpers/EmailHelper.php"
click node_users "https://github.com/janpol141414/landsurvey/blob/main/models/User.php"
click node_engineers "https://github.com/janpol141414/landsurvey/blob/main/models/Engineer.php"
click node_appointments "https://github.com/janpol141414/landsurvey/blob/main/models/Appointment.php"
click node_payments "https://github.com/janpol141414/landsurvey/blob/main/models/Payment.php"
click node_messages "https://github.com/janpol141414/landsurvey/blob/main/models/Message.php"
click node_companies "https://github.com/janpol141414/landsurvey/blob/main/models/Company.php"
click node_mysql "https://github.com/janpol141414/landsurvey/blob/main/config/database.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_landing,node_identity,node_client_portal,node_provider_browse,node_company_browse,node_client toneBlue
class node_booking,node_availability,node_tracking,node_payment,node_feedback,node_messaging toneAmber
class node_engineer_ops,node_admin_ops toneMint
class node_chatbot,node_notifications,node_email toneRose
class node_users,node_engineers,node_appointments,node_payments,node_messages,node_companies,node_mysql,node_engineer,node_admin toneIndigo
```

## Components

### Portal experience

- [Service discovery](https://github.com/janpol141414/landsurvey/blob/main/index.php): `index.php`
- [Account access](https://github.com/janpol141414/landsurvey/blob/main/auth/login.php): `auth/login.php`
- [Client workspace](https://github.com/janpol141414/landsurvey/blob/main/client/dashboard.php): `client/dashboard.php`
- [Provider browsing](https://github.com/janpol141414/landsurvey/blob/main/client/engineers.php): `client/engineers.php`
- [Company browsing](https://github.com/janpol141414/landsurvey/blob/main/client/companies.php): `client/companies.php`

### Survey workflow

- [Appointment booking](https://github.com/janpol141414/landsurvey/blob/main/client/book-appointment.php): `client/book-appointment.php`
- [Availability scheduling](https://github.com/janpol141414/landsurvey/blob/main/models/Schedule.php): `models/Schedule.php`
- [Progress tracking](https://github.com/janpol141414/landsurvey/blob/main/engineer/progress.php): `engineer/progress.php`
- [Payment submission](https://github.com/janpol141414/landsurvey/blob/main/client/payment.php): `client/payment.php`
- [Ratings feedback](https://github.com/janpol141414/landsurvey/blob/main/client/feedback.php): `client/feedback.php`
- [Client messaging](https://github.com/janpol141414/landsurvey/blob/main/api/messages.php): `api/messages.php`

### Role operations

- [Engineer workspace](https://github.com/janpol141414/landsurvey/blob/main/engineer/appointments.php): `engineer/appointments.php`
- [Admin workspace](https://github.com/janpol141414/landsurvey/blob/main/admin/appointments.php): `admin/appointments.php`

### Shared services

- [AI assistance](https://github.com/janpol141414/landsurvey/blob/main/helpers/AIHelper.php): `helpers/AIHelper.php`
- [Notifications](https://github.com/janpol141414/landsurvey/blob/main/models/Notification.php): `models/Notification.php`
- [Email delivery](https://github.com/janpol141414/landsurvey/blob/main/helpers/EmailHelper.php): `helpers/EmailHelper.php`

### Domain data

- [User records](https://github.com/janpol141414/landsurvey/blob/main/models/User.php): `models/User.php`
- [Engineer records](https://github.com/janpol141414/landsurvey/blob/main/models/Engineer.php): `models/Engineer.php`
- [Appointment records](https://github.com/janpol141414/landsurvey/blob/main/models/Appointment.php): `models/Appointment.php`
- [Payment records](https://github.com/janpol141414/landsurvey/blob/main/models/Payment.php): `models/Payment.php`
- [Message records](https://github.com/janpol141414/landsurvey/blob/main/models/Message.php): `models/Message.php`
- [Company records](https://github.com/janpol141414/landsurvey/blob/main/models/Company.php): `models/Company.php`
- [MySQL database](https://github.com/janpol141414/landsurvey/blob/main/config/database.php): `config/database.php`

### Other components

- **Client**
- **Engineer**
- **Administrator**

## Connections

- Client → Service discovery: explores services (evidence: `README.md`)
- Client → Account access: signs in (evidence: `README.md`)
- Engineer → Account access: signs in (evidence: `README.md`)
- Administrator → Account access: signs in (evidence: `README.md`)
- Client → Provider browsing: browses engineers (evidence: `README.md`)
- Client → Company browsing: browses companies (evidence: `README.md`)
- Client → Appointment booking: books appointment (evidence: `README.md`)
- Appointment booking → Availability scheduling: checks slots (evidence: `README.md`)
- Appointment booking → Appointment records: creates booking (evidence: `README.md`)
- Appointment booking → Engineer records: assigns engineer (evidence: `README.md`)
- Appointment booking → Notifications: notifies engineer (evidence: `README.md`)
- Appointment booking → Email delivery: sends confirmation (evidence: `README.md`)
- Engineer → Engineer workspace: manages work (evidence: `README.md`)
- Engineer workspace → Appointment records: updates appointments (evidence: `engineer/appointments.php`)
- Administrator → Admin workspace: manages system (evidence: `README.md`)
- Admin workspace → Appointment records: manages bookings (evidence: `admin/appointments.php`)
- Admin workspace → Payment records: verifies payments
- Client → Progress tracking: tracks progress (evidence: `README.md`)
- Engineer → Progress tracking: updates progress (evidence: `README.md`)
- Progress tracking → Appointment records: reads progress (evidence: `engineer/progress.php`)
- Client → Payment submission: submits payment (evidence: `README.md`)
- Payment submission → Payment records: records payment (evidence: `client/payment.php`)
- Client → Client messaging: messages engineer (evidence: `README.md`)
- Engineer → Client messaging: replies to client (evidence: `README.md`)
- Client messaging → Message records: stores messages (evidence: `api/messages.php`)
- Client → Ratings feedback: leaves rating (evidence: `README.md`)
- Client → AI assistance: asks questions (evidence: `README.md`)
- Client messaging → AI assistance: uses auto-reply (evidence: `README.md`)
- Appointment records → MySQL database: reads and writes (evidence: `models/Appointment.php`)
- Engineer records → MySQL database: reads and writes (evidence: `models/Engineer.php`)
- Message records → MySQL database: reads and writes (evidence: `models/Message.php`)
- Payment records → MySQL database: reads and writes (evidence: `models/Payment.php`)
- User records → MySQL database: reads and writes (evidence: `models/User.php`)
- Company records → MySQL database: reads and writes (evidence: `models/Company.php`)
- Availability scheduling → MySQL database: reads and writes (evidence: `models/Schedule.php`)
