AppML Installation — Setting Up Your Development Environment
In this tutorial, you will learn about AppML Installation. We cover key concepts, practical examples, and best practices to help you master this topic.
Setting up AppML requires a web server with PHP or Node.js, the AppML runtime files, and a database connection so your models can read and write data.
What You'll Learn
You will install the AppML runtime on your local development machine, configure a database connection, and serve your first AppML model in the browser.
Why It Matters
Proper installation ensures your AppML models render correctly, connect to your data sources, and take advantage of all built-in features without configuration errors later.
Real-World Use
DodaZIP's internal reporting tool was prototyped with AppML in under two hours. The installation and database configuration were the first steps, and the generated reporting UI was live within the same afternoon.
flowchart LR
A[Download AppML] --> B[Extract to Server]
B --> C[Configure Database]
C --> D[Set Data Source]
D --> E[Create Model File]
E --> F[Run in Browser]
style A fill:#1e293b,color:#fff
style F fill:#0f172a,color:#fff
System Requirements
AppML runs on any standard web hosting environment. The requirements are minimal.
PHP environment requires PHP 7.4 or higher with PDO extensions for your database. MySQL, PostgreSQL, or SQLite support is needed depending on your data source.
Node.js environment requires Node.js 14 or higher with the AppML npm package installed globally.
A web server like Apache, Nginx, or the built-in PHP development server is needed to serve files.
PHP Installation
Download the AppML runtime from the official Repository and extract it to your web server directory.
wget https://github.com/appml/appml/releases/latest/download/appml.zip
unzip appml.zip -d /var/www/html/appml
Expected output: The appml directory contains the runtime with index.php, lib folder, and configuration files.
Configure the database connection in config.php.
<?php
$config = [
'db_type' => 'mysql',
'db_host' => 'localhost',
'db_name' => 'appml_demo',
'db_user' => 'root',
'db_pass' => '',
'appml_path' => '/appml'
];
?>
Expected output: AppML reads this configuration and uses the MySQL connection for all data operations.
Node.js Installation
Install AppML via npm and initialize a new project.
npm install -g appml
mkdir my-appml-app
cd my-appml-app
appml init
Expected output: The init command creates a project structure with appml.config.json, a models directory, and a public folder.
Configure the data source in appml.config.json.
{
"server": {
"port": 3000
},
"database": {
"type": "sqlite",
"path": "./data/appml.db"
},
"models": "./models"
}
Expected output: AppML starts a web server on port 3000 and connects to the SQLite database at the specified path.
Verifying the Installation
Create a test model file to confirm everything works.
<!-- models/test.xml -->
<appml>
<datasource type="sqlite">
<table name="test">
<field name="id" type="integer" key="true"/>
<field name="message" type="string"/>
</table>
</datasource>
<view type="list" table="test">
<column field="message" header="Message"/>
</view>
</appml>
Expected output: Opening http://localhost:3000/test in your browser shows an empty data table with a Message column and an Add button.
Common Mistakes
Forgetting to enable PDO extensions in PHP: AppML uses PDO for database connectivity. Without the correct PDO driver, the connection fails with a class not found error.
Using incorrect file paths in the model reference: The model file path in the URL must match the location of your XML files relative to the AppML runtime.
Not setting proper file permissions: The AppML runtime needs write access to temporary directories for Caching and session management.
Running AppML on an unsupported PHP version: PHP versions below 7.4 lack features that AppML depends on. Always check the version requirement.
Configuring the database with wrong credentials: Double-check the host, port, username, and password. A typo in the database name also causes silent failures.
Practice Questions
- What are the two runtime environments supported by AppML?
PHP 7.4+ with PDO extensions and Node.js 14+.
- Which configuration file stores the database connection in a PHP installation?
The config.php file in the AppML root directory.
- How do you create a new AppML project using Node.js?
Run
appml initin the project directory after installing the AppML CLI globally with npm.
- What should you see when you access a valid AppML model in the browser?
A generated HTML page with a data table, form controls, and CRUD buttons based on the model definition.
- Why must PDO extensions be enabled for PHP AppML?
AppML uses PDO for database connectivity. Without the correct PDO driver, database operations fail.
Challenge
Install AppML using both the PHP and Node.js methods. Create the same test model in both environments and verify both produce the same generated UI.
Frequently Asked Questions
Mini Project
Set up AppML with a SQLite database on Node.js. Create a model for a contacts table with fields for name, email, phone, and address. Verify the generated CRUD interface works by adding three test contacts.
What's Next
Now that AppML is installed, continue to AppML Model to learn how to define your application data structures in XML.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro