π AppML Folder Structure Best Practices β Organize Your AppML Projects Smartly
π§² Introduction β Why Folder Organization Matters in AppML Projects
Even though AppML is a lightweight, no-build framework, maintaining a well-organized folder structure is essential for scalability, clarity, and debugging efficiency. A clean directory layout allows you to separate models, views, controllers, and assets, making it easier to manage data-driven applicationsβespecially as your project grows.
π― In this article, youβll learn:
- The ideal folder structure for AppML projects
- How to organize models, controllers, and views
- Folder naming conventions for better readability
- Real examples for single-page and multi-page AppML apps
- Tips to future-proof your file organization
ποΈ Recommended Folder Structure for AppML Projects
Here is a modular folder structure that works for most small to medium AppML applications:
/appml-project/
βββ index.html
βββ /data/
β βββ products.json
βββ /controller/
β βββ appml-controller.js
βββ /model/
β βββ schema.json
βββ /views/
β βββ product-view.html
βββ /css/
β βββ styles.css
βββ /js/
β βββ custom-scripts.js
βββ /assets/
βββ /images/
βββ /icons/
π‘ Tip: Place reusable HTML blocks or templates inside
/views, and API-returned models inside/data.
π¦ Folder Breakdown and Naming Best Practices
| π Folder | π Description |
|---|---|
/data/ | Stores JSON, XML, or server-returned data files |
/controller/ | Contains custom controller logic (JavaScript) |
/model/ | Holds static schema definitions (optional) |
/views/ | Stores modular HTML templates or AppML-rendered views |
/css/ | Stylesheets for layout, theme, responsiveness |
/js/ | Custom JS not managed by AppML (optional) |
/assets/ | Static resources like images, icons, fonts |
π§ͺ Example: Connecting Folder Paths in HTML
Letβs say you’re loading a product list with AppML using this structure:
<!-- index.html -->
<div appml-data="data/products.json" appml-controller="controller/appml-controller.js">
<h3>{{name}}</h3>
<p>Price: ${{price}}</p>
</div>
β Make sure relative paths are correct so AppML can load the model and apply controller logic.
π Reusable Views and Modular HTML Blocks
Use the /views/ folder to maintain reusable HTML templates. For example, product cards or form components:
<!-- views/product-view.html -->
<div>
<h2>{{title}}</h2>
<p>{{description}}</p>
</div>
Then you can include this inside your main page with AppML includes:
<div appml-include-html="views/product-view.html"></div>
π§° Tips for Organizing Multi-Page AppML Projects
If youβre building a larger site or admin dashboard:
- πΉ Create subfolders for each module or feature.
- πΉ Group models and controllers by feature.
- πΉ Keep all AppML-related files in a dedicated root folder (
/appml/).
/admin-dashboard/
βββ /appml/
β βββ /products/
β β βββ data.json
β β βββ controller.js
β βββ /orders/
β β βββ order-data.json
β β βββ order-controller.js
β βββ shared/
β βββ view-header.html
π Summary β Recap & Next Steps
Creating a well-structured AppML project folder enhances code readability, simplifies updates, and enables collaborative development. Itβs a best practice that pays off as your app scales.
π Key Takeaways:
- Store data in
/data/, logic in/controller/, and views in/views/ - Use consistent naming and relative paths for easier maintenance
- Organize by feature for large, multi-module applications
- Keep custom JavaScript and styles in separate folders (
/js/and/css/)
βοΈ Whether you’re building a small product list or a large admin panel, clean folder structure is your foundation for success.
β FAQs β AppML Project Folder Organization
β Do I need to follow a specific folder structure in AppML?
β
No, but following a modular structure helps keep your project maintainable and scalableβespecially for larger apps.
β Where should I place my JSON data files?
β
Place them in a /data/ or /model/ folder to keep them organized and easily referenced using appml-data.
β Can I load AppML views from other HTML files?
β
Yes! Use appml-include-html="views/filename.html" to dynamically include HTML templates or fragments.
β Whatβs the best place to store controller files?
β
Store all logic scripts in a /controller/ folder. Reference them using appml-controller="controller/logic.js".
β How do I organize multi-feature apps?
β
Create subfolders inside /appml/ or /modules/ for each feature (e.g., /users/, /products/, /reports/) and group their data and controllers inside them.
Share Now :
