πŸ–₯️ AppML Server-Side Integration
Estimated reading: 4 minutes 369 views

AppML – Server Overview: How AppML Integrates with Backend Technologies

Introduction – Why Use AppML with a Server?

AppML is powerful on its own in the browser, but when connected to a backend, it becomes a full-stack low-code framework. With server-side integration (PHP, ASP, or Node), AppML can read and write real-time data, support authentication, and manage database-driven applications securely.

In this article, you’ll learn:

  • How AppML works with backend servers
  • Server-side components: AppML PHP and ASP support
  • How AppML handles database CRUD operations via server scripts
  • Differences between static and server-based AppML setups

How AppML Communicates with Servers

When used with a server, AppML sends HTTP requests from the client side (via appml-data) to a server script like customers.php or products.asp. That script processes the requestβ€”fetching, updating, inserting, or deleting data from the databaseβ€”and returns JSON back to the AppML client.

This enables dynamic, secure, and persistent web apps.


Basic AppML Server Architecture

HTML Page (with AppML)
     ↓
appml-data = "customers.php"
     ↓
PHP Script accesses MySQL Database
     ↓
Returns JSON to AppML Client

Supported Server Environments

Server LanguageSupported AppML ComponentCommon Use Case
PHPappml.php, customers.phpLAMP stack apps, shared hosting
ASP.NETappml.asp, data.aspEnterprise apps with IIS
Node.js (custom)Custom API endpointsModern SPAs, hybrid apps

Example – Using AppML with PHP

HTML Page

<div 
  appml-model="models/customer-model.json" 
  appml-data="customers.php" 
  appml-message>
  
  <h2>Customer Directory</h2>
  <p>{{name}} – {{email}}</p>
</div>

Explanation:

  • appml-data="customers.php" sends AJAX calls to the server
  • customers.php is a PHP script that connects to a database and returns results

Sample PHP Script – customers.php

<?php
include("appml.php");
$appml = new AppML();
$appml->model = "models/customer-model.json";
$appml->run();
?>

Explanation:

  • appml.php is the main AppML server library
  • The script loads the model, handles HTTP requests, and outputs data in JSON

CRUD Operations via AppML Server

AppML supports Create, Read, Update, and Delete operations automatically if:

  • A valid model file is provided
  • The server script (.php or .asp) uses the AppML class
  • Data is submitted via appml-submit

You don’t need to write SQL manually. AppML’s backend handles queries based on the model file’s key and fields.


Folder Structure for AppML + Server Setup

Path Contents
/models/customer-model.jsonField structure and validation rules
/customers.phpAppML server logic
/index.htmlAppML-powered frontend form or view
/appml.phpCore AppML PHP class (from W3Schools)

Server-Side Model Example

models/customer-model.json

{
  "key": "id",
  "table": "customers",
  "database": "appml",
  "fields": [
    { "name": "name", "required": true },
    { "name": "email", "required": true },
    { "name": "country" }
  ]
}

Explanation:

  • "table": "customers" tells AppML to use the customers table
  • "database": "appml" defines the target DB
  • Fields define the input rules and data structure

Can AppML Handle Login and Sessions?

Yes. AppML provides built-in support for:

  • User Authentication
  • Role-Based Access
  • Session Management

You can define login forms using appml-login, and AppML will check against user tables.


When to Use Server-Side AppML

ScenarioBest Setup
Static pages, demos, prototypesUse appml-data="data.json"
Dynamic apps, large datasetsUse appml-data="products.php"
Secure backend access (auth)Use AppML with PHP/ASP server
Multi-user CRUD systemsUse models + server API

Summary – Recap & Key Takeaways

AppML becomes a powerful full-stack solution when integrated with server-side scripts. It automates communication with databases, processes CRUD requests, and allows secure data handlingβ€”all while keeping your frontend HTML clean and low-code.

Key Takeaways:

  • appml-data="file.php" connects your app to backend logic
  • Use PHP or ASP to return real-time JSON from SQL databases
  • Server-side models define database tables and validation
  • AppML handles most backend logicβ€”no manual SQL needed
  • Ideal for dashboards, CMS, HR tools, and student portals

Server-backed AppML apps are scalable, maintainable, and production-ready.


FAQs – AppML Server Overview


Does AppML support MySQL only?
Primarily, yes. AppML server classes are built for MySQL. You can adapt them for other DBs with some PHP knowledge.


Do I need to write SQL queries?
No. AppML generates SQL based on the model file automatically.


Is AppML secure for production use?
With proper server setup and validation, yes. Always sanitize inputs and use HTTPS.


Can I return data as XML instead of JSON?
AppML expects JSON as the primary format. XML would require customization.


How do I host AppML with PHP?
Upload files to a PHP-enabled server (e.g., XAMPP, Apache, cPanel) and access via browser.


Share Now :
Share

AppML – Server Overview

Or Copy Link

CONTENTS
Scroll to Top