# nersus15/mntemplate architecture

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

- Interactive diagram: https://gitdiagram.com/nersus15/mntemplate
- Repository: https://github.com/nersus15/mntemplate

## Overview

This repository is a small PHP MVC template, with visible examples of a client-facing HIPELMAS portal and registration, profile, article, and product pages. The principal workflow is an HTTP request being resolved to a controller action, which can prepare data and render views. The map also shows the template’s query and helper layer. The README describes the MVC approach, but sampled sources do not establish how every listed page or feature is wired; those links are left out.

Main entry points: [`apps/core/apps.php`](https://github.com/nersus15/mntemplate/blob/master/apps/core/apps.php) (App dispatcher), [`apps/core/controller.php`](https://github.com/nersus15/mntemplate/blob/master/apps/core/controller.php) (Controller services), [`apps/helpers/qbuilder.php`](https://github.com/nersus15/mntemplate/blob/master/apps/helpers/qbuilder.php) (Query builder), [`index.php`](https://github.com/nersus15/mntemplate/blob/master/index.php) (PHP entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Request runtime"]
  node_entry["PHP entry<br/>[index.php]"]
  node_dispatch["App dispatcher<br/>[apps.php]"]
  node_route["Route definitions<br/>[routes.php]"]
  node_hooks["Request hooks<br/>[common.php]"]
  node_controller["Example controllers<br/>[contoh.php]"]
  node_wscontroller["Web-service controller<br/>[contoh.php]"]
  node_basecontroller["Controller services<br/>[controller.php]"]
end

subgraph group_domain["Portal features"]
  node_registration["Registration handling<br/>[examp.php]"]
  node_auth["Authentication<br/>[auth.php]"]
end

subgraph group_presentation["Presentation"]
  node_pages["Portal pages<br/>[landing.php]"]
  node_profile["Profile forms<br/>[registrasi_bio.php]"]
  node_templates["Page templates<br/>[client_dore.php]"]
  node_browser["Browser interactions<br/>[main.js]"]
end

subgraph group_data["Data and services"]
  node_models["Models<br/>[models.php]"]
  node_querybuilder["Query builder<br/>[qbuilder.php]"]
  node_database["Database adapter<br/>[database.php]"]
  node_mail["Mail helper<br/>[mail_sender.php]"]
end

node_visitor(("Visitor"))
node_mailer["SMTP mail service"]
node_dbstore[("MySQL database")]

node_visitor -->|"requests"| node_entry
node_entry -->|"starts"| node_dispatch
node_dispatch -->|"registers routes"| node_route
node_dispatch -->|"runs hooks"| node_hooks
node_dispatch -->|"dispatches"| node_controller
node_dispatch -->|"dispatches"| node_wscontroller
node_controller -->|"uses services"| node_basecontroller
node_basecontroller -->|"creates"| node_querybuilder
node_basecontroller -->|"renders views"| node_pages
node_basecontroller -->|"renders views"| node_templates
node_models -->|"queries through"| node_querybuilder
node_querybuilder -->|"uses"| node_database
node_database -->|"queries"| node_dbstore
node_registration -->|"handles form"| node_profile
node_mail -->|"sends mail"| node_mailer

click node_entry "https://github.com/nersus15/mntemplate/blob/master/index.php"
click node_dispatch "https://github.com/nersus15/mntemplate/blob/master/apps/core/apps.php"
click node_route "https://github.com/nersus15/mntemplate/blob/master/apps/routes/routes.php"
click node_hooks "https://github.com/nersus15/mntemplate/blob/master/apps/hooks/common.php"
click node_controller "https://github.com/nersus15/mntemplate/blob/master/apps/controller/contoh.php"
click node_wscontroller "https://github.com/nersus15/mntemplate/blob/master/apps/controller/ws/contoh.php"
click node_basecontroller "https://github.com/nersus15/mntemplate/blob/master/apps/core/controller.php"
click node_registration "https://github.com/nersus15/mntemplate/blob/master/apps/form_handler/examp.php"
click node_auth "https://github.com/nersus15/mntemplate/blob/master/apps/library/auth.php"
click node_pages "https://github.com/nersus15/mntemplate/blob/master/apps/views/pages/landing.php"
click node_profile "https://github.com/nersus15/mntemplate/blob/master/apps/views/forms/registrasi_bio.php"
click node_templates "https://github.com/nersus15/mntemplate/blob/master/apps/views/template/client_dore.php"
click node_browser "https://github.com/nersus15/mntemplate/blob/master/public/asset/js/main.js"
click node_models "https://github.com/nersus15/mntemplate/blob/master/apps/models/models.php"
click node_querybuilder "https://github.com/nersus15/mntemplate/blob/master/apps/helpers/qbuilder.php"
click node_database "https://github.com/nersus15/mntemplate/blob/master/apps/core/database.php"
click node_mail "https://github.com/nersus15/mntemplate/blob/master/apps/helpers/mail_sender.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_entry,node_dispatch,node_route,node_hooks,node_controller,node_wscontroller,node_basecontroller toneBlue
class node_registration,node_auth,node_dbstore toneAmber
class node_pages,node_profile,node_templates,node_browser toneMint
class node_models,node_querybuilder,node_database,node_mail toneRose
class node_visitor,node_mailer toneIndigo
```

## Components

### Request runtime

- [PHP entry](https://github.com/nersus15/mntemplate/blob/master/index.php): `index.php`
- [App dispatcher](https://github.com/nersus15/mntemplate/blob/master/apps/core/apps.php): `apps/core/apps.php`
- [Route definitions](https://github.com/nersus15/mntemplate/blob/master/apps/routes/routes.php): `apps/routes/routes.php`
- [Request hooks](https://github.com/nersus15/mntemplate/blob/master/apps/hooks/common.php): `apps/hooks/common.php`
- [Example controllers](https://github.com/nersus15/mntemplate/blob/master/apps/controller/contoh.php): `apps/controller/contoh.php`
- [Web-service controller](https://github.com/nersus15/mntemplate/blob/master/apps/controller/ws/contoh.php): `apps/controller/ws/contoh.php`
- [Controller services](https://github.com/nersus15/mntemplate/blob/master/apps/core/controller.php): `apps/core/controller.php`

### Portal features

- [Registration handling](https://github.com/nersus15/mntemplate/blob/master/apps/form_handler/examp.php): `apps/form_handler/examp.php`
- [Authentication](https://github.com/nersus15/mntemplate/blob/master/apps/library/auth.php): `apps/library/auth.php`

### Presentation

- [Portal pages](https://github.com/nersus15/mntemplate/blob/master/apps/views/pages/landing.php): `apps/views/pages/landing.php`
- [Profile forms](https://github.com/nersus15/mntemplate/blob/master/apps/views/forms/registrasi_bio.php): `apps/views/forms/registrasi_bio.php`
- [Page templates](https://github.com/nersus15/mntemplate/blob/master/apps/views/template/client_dore.php): `apps/views/template/client_dore.php`
- [Browser interactions](https://github.com/nersus15/mntemplate/blob/master/public/asset/js/main.js): `public/asset/js/main.js`

### Data and services

- [Models](https://github.com/nersus15/mntemplate/blob/master/apps/models/models.php): `apps/models/models.php`
- [Query builder](https://github.com/nersus15/mntemplate/blob/master/apps/helpers/qbuilder.php): `apps/helpers/qbuilder.php`
- [Database adapter](https://github.com/nersus15/mntemplate/blob/master/apps/core/database.php): `apps/core/database.php`
- [Mail helper](https://github.com/nersus15/mntemplate/blob/master/apps/helpers/mail_sender.php): `apps/helpers/mail_sender.php`

### Other components

- **Visitor**
- **SMTP mail service**
- **MySQL database**

## Connections

- Visitor → PHP entry: requests
- PHP entry → App dispatcher: starts
- App dispatcher → Route definitions: registers routes
- App dispatcher → Request hooks: runs hooks
- App dispatcher → Example controllers: dispatches
- App dispatcher → Web-service controller: dispatches
- Example controllers → Controller services: uses services
- Controller services → Query builder: creates
- Controller services → Portal pages: renders views
- Controller services → Page templates: renders views
- Models → Query builder: queries through
- Query builder → Database adapter: uses
- Database adapter → MySQL database: queries
- Registration handling → Profile forms: handles form
- Mail helper → SMTP mail service: sends mail
