# shubhamgunjkar64-lang/tree-plantation-management-system architecture

> Architecture diagram of the GitHub repository shubhamgunjkar64-lang/tree-plantation-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shubhamgunjkar64-lang/tree-plantation-management-system
- Repository: https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system

## Overview

TPMS is an administrator-facing campus tree-plantation management system. The main workflow is to maintain species, sites, plantation drives and volunteers; register tagged trees against drives; record follow-up inspections; and review survival and audit reports. The graph preserves documented capabilities such as administrator management, event details and the academic guide. Some pages were not sampled, so their internal calls and links are omitted rather than inferred; the database relationship is shown only where SQL is visible.

Main entry points: [`public/events.php`](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/events.php) (Plantation events), [`public/guide.php`](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/guide.php) (Project guide), [`public/reports.php`](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/reports.php) (Reports and analytics), [`includes/auth.php`](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/includes/auth.php) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and shared UI"]
  node_login["Login<br/>[login.php]"]
  node_auth["Authentication<br/>[auth.php]"]
  node_csrf["CSRF protection<br/>[csrf.php]"]
  node_helpers["Shared helpers<br/>[functions.php]"]
  node_layout["Navigation layout<br/>[header.php]"]
  node_admins["Admin management<br/>[admins.php]"]
end

subgraph group_operations["Plantation operations"]
  node_species["Species catalog<br/>[species.php]"]
  node_sites["Campus sites<br/>[sites.php]"]
  node_volunteers["Volunteer registry<br/>[volunteers.php]"]
  node_events["Plantation events<br/>[events.php]"]
  node_event_detail["Event details<br/>[event_detail.php]"]
  node_trees["Tree records<br/>[trees.php]"]
end

subgraph group_oversight["Health and reporting"]
  node_inspections["Health inspections<br/>[maintenance.php]"]
  node_reports["Reports and analytics<br/>[reports.php]"]
  node_dashboard["Executive dashboard<br/>[index.php]"]
  node_guide["Project guide<br/>[guide.php]"]
end

subgraph group_platform["Persistence and runtime"]
  node_db_provider["PDO connection provider<br/>[database.php]"]
  node_database[("Relational database<br/>[schema.sql]")]
  node_api_router["Serverless router<br/>[index.php]"]
end

node_admin(("Administrator"))

node_admin -->|"signs in"| node_login
node_login -->|"authenticates"| node_auth
node_auth -->|"gets connection"| node_db_provider
node_admin -->|"manages catalog"| node_species
node_admin -->|"manages sites"| node_sites
node_admin -->|"manages volunteers"| node_volunteers
node_admin -->|"manages drives"| node_events
node_events -->|"opens event"| node_event_detail
node_admin -->|"records trees"| node_trees
node_admin -->|"logs care"| node_inspections
node_inspections -->|"reads and writes"| node_database
node_trees -->|"reads and writes"| node_database
node_reports -->|"queries records"| node_database
node_admin -->|"reviews analytics"| node_reports
node_admin -.->|"views KPIs"| node_dashboard
node_admin -->|"opens guide"| node_guide
node_events -->|"validates forms"| node_csrf
node_events -->|"uses helpers"| node_helpers
node_events -->|"renders layout"| node_layout
node_guide -->|"requires access"| node_auth
node_guide -->|"uses helpers"| node_helpers
node_guide -->|"renders layout"| node_layout
node_reports -->|"renders layout"| node_layout
node_api_router -->|"routes request"| node_dashboard

click node_login "https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/login.php"
click node_auth "https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/includes/auth.php"
click node_csrf "https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/includes/csrf.php"
click node_helpers "https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/includes/functions.php"
click node_layout "https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/includes/header.php"
click node_admins "https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/admins.php"
click node_species "https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/species.php"
click node_sites "https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/sites.php"
click node_volunteers "https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/volunteers.php"
click node_events "https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/events.php"
click node_event_detail "https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/event_detail.php"
click node_trees "https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/trees.php"
click node_inspections "https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/maintenance.php"
click node_reports "https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/reports.php"
click node_dashboard "https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/index.php"
click node_guide "https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/guide.php"
click node_db_provider "https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/config/database.php"
click node_database "https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/database/schema.sql"
click node_api_router "https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/api/index.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_login,node_auth,node_csrf,node_helpers,node_layout,node_admins toneBlue
class node_species,node_sites,node_volunteers,node_events,node_event_detail,node_trees toneAmber
class node_inspections,node_reports,node_dashboard,node_guide toneMint
class node_db_provider,node_database,node_api_router toneRose
class node_admin toneIndigo
```

## Components

### Access and shared UI

- [Login](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/login.php): `public/login.php`
- [Authentication](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/includes/auth.php): `includes/auth.php`
- [CSRF protection](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/includes/csrf.php): `includes/csrf.php`
- [Shared helpers](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/includes/functions.php): `includes/functions.php`
- [Navigation layout](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/includes/header.php): `includes/header.php`
- [Admin management](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/admins.php): `public/admins.php`

### Plantation operations

- [Species catalog](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/species.php): `public/species.php`
- [Campus sites](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/sites.php): `public/sites.php`
- [Volunteer registry](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/volunteers.php): `public/volunteers.php`
- [Plantation events](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/events.php): `public/events.php`
- [Event details](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/event_detail.php): `public/event_detail.php`
- [Tree records](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/trees.php): `public/trees.php`

### Health and reporting

- [Health inspections](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/maintenance.php): `public/maintenance.php`
- [Reports and analytics](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/reports.php): `public/reports.php`
- [Executive dashboard](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/index.php): `public/index.php`
- [Project guide](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/public/guide.php): `public/guide.php`

### Persistence and runtime

- [PDO connection provider](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/config/database.php): `config/database.php`
- [Relational database](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/database/schema.sql): `database/schema.sql`
- [Serverless router](https://github.com/shubhamgunjkar64-lang/tree-plantation-management-system/blob/main/api/index.php): `api/index.php`

### Other components

- **Administrator**

## Connections

- Administrator → Login: signs in (evidence: `README.md`)
- Login → Authentication: authenticates (evidence: `public/login.php`)
- Authentication → PDO connection provider: gets connection (evidence: `includes/auth.php`)
- Administrator → Species catalog: manages catalog
- Administrator → Campus sites: manages sites
- Administrator → Volunteer registry: manages volunteers
- Administrator → Plantation events: manages drives
- Plantation events → Event details: opens event (evidence: `public/events.php`)
- Administrator → Tree records: records trees
- Administrator → Health inspections: logs care
- Health inspections → Relational database: reads and writes (evidence: `public/maintenance.php`)
- Tree records → Relational database: reads and writes (evidence: `public/trees.php`)
- Reports and analytics → Relational database: queries records (evidence: `public/reports.php`)
- Administrator → Reports and analytics: reviews analytics
- Administrator → Executive dashboard: views KPIs (evidence: `README.md`)
- Administrator → Project guide: opens guide
- Plantation events → CSRF protection: validates forms (evidence: `public/events.php`)
- Plantation events → Shared helpers: uses helpers (evidence: `public/events.php`)
- Plantation events → Navigation layout: renders layout (evidence: `public/events.php`)
- Project guide → Authentication: requires access (evidence: `public/guide.php`)
- Project guide → Shared helpers: uses helpers (evidence: `public/guide.php`)
- Project guide → Navigation layout: renders layout (evidence: `public/guide.php`)
- Reports and analytics → Navigation layout: renders layout (evidence: `public/reports.php`)
- Serverless router → Executive dashboard: routes request (evidence: `api/index.php`)
