π Case β Suppliers and Shippers Use Case in AppML: Manage Logistics Data Without JavaScript
π§² Introduction β Why Build a Suppliers & Shippers App in AppML?
Suppliers and shippers are crucial entities in any inventory or logistics system. Managing this data efficientlyβwhether it’s supplier contact info or shipping detailsβis a common need. AppML lets you create fully functional supplier and shipper management apps with zero JavaScript coding, using only HTML + AppML directives.
π― In this use case, youβll learn:
- How to structure data and models for suppliers and shippers
- How to create two independent modules using AppML
- How to load, display, and validate supplier/shipper data
- How to use models and optional controller logic
π Recommended Project Structure
π File | π Description |
---|---|
suppliers.html | UI for supplier management |
shippers.html | UI for shipper management |
data/suppliers.json | Supplier data records |
data/shippers.json | Shipper data records |
models/supplier-model.json | Model for supplier input/validation |
models/shipper-model.json | Model for shipper input/validation |
π€ Sample Data β data/suppliers.json
[
{ "id": 1, "company": "Global Parts Co", "contact": "Mike Jones", "location": "Boston" },
{ "id": 2, "company": "SpeedTech Inc", "contact": "Linda Wells", "location": "Chicago" }
]
π¦ Sample Data β data/shippers.json
[
{ "id": 1, "company": "Express Delivery", "phone": "555-1234" },
{ "id": 2, "company": "Fast Freight", "phone": "555-9876" }
]
π§© Supplier Model β models/supplier-model.json
{
"key": "id",
"orderby": "company",
"fields": [
{ "name": "company", "required": true },
{ "name": "contact" },
{ "name": "location" }
]
}
π Shipper Model β models/shipper-model.json
{
"key": "id",
"orderby": "company",
"fields": [
{ "name": "company", "required": true },
{ "name": "phone" }
]
}
π₯οΈ UI β suppliers.html
<div
appml-model="models/supplier-model.json"
appml-data="data/suppliers.json"
appml-message>
<h2>Suppliers</h2>
<p>{{company}} β {{contact}} β {{location}}</p>
<h3>Add / Edit Supplier</h3>
<input name="company" placeholder="Company Name">
<input name="contact" placeholder="Contact Person">
<input name="location" placeholder="Location">
<button appml-submit>Save</button>
</div>
π₯οΈ UI β shippers.html
<div
appml-model="models/shipper-model.json"
appml-data="data/shippers.json"
appml-message>
<h2>Shippers</h2>
<p>{{company}} β π {{phone}}</p>
<h3>Add / Edit Shipper</h3>
<input name="company" placeholder="Shipper Company">
<input name="phone" placeholder="Phone Number">
<button appml-submit>Save</button>
</div>
π§ Optional Controller Logic (for validation)
β
supplier-controller.js
myAppML.onvalidate = function() {
if (myAppML.data.company === "") {
myAppML.message = "Company name is required.";
return false;
}
return true;
};
Use similar validation in a shipper-controller.js
if needed.
π§° Real-World Use Cases
Use Case | Why AppML Works Well |
---|---|
Supplier database for warehouses | Quick setup with no backend needed |
Shipper contact directory | Display + update data in one HTML file |
Offline inventory systems | JSON files can be hosted statically |
Admin dashboards | Low-code and easy to maintain |
π Summary β Recap & Key Takeaways
With AppML, you can quickly build modular supplier and shipper apps using plain HTML and structured data files. You donβt need React, Angular, or even JavaScript to create a maintainable CRUD application.
π Key Takeaways:
- Use separate models and JSON data for modular structure
- Add validation and sorting via AppML model files
- Use
appml-submit
for saving data through a form - Ideal for low-code dashboards and static deployments
βοΈ This approach scales well for inventory systems, logistics apps, and ERP extensions.
β FAQs β Suppliers & Shippers Use Case in AppML
β Can I connect supplier/shipper data to a database?
β
Yes. Replace appml-data
with a server endpoint that queries your DB and returns JSON.
β Do I need separate HTML pages for suppliers and shippers?
β
Not necessarily. You can use tabs or sections in the same file, but separating improves modularity.
β Can I search/filter suppliers or shippers dynamically?
β
Yes. Add an input and filter with myAppML.filter = 'company.includes(...)'
.
β Can I merge suppliers and shippers into one model?
β οΈ Technically yes, but it’s better to use separate models for different entities.
β Are JSON files writable by default?
β No. For full CRUD, use PHP or Node.js scripts to handle POST/PUT/DELETE.
Share Now :