Introduction
Welcome to Demo App — a simple demonstration application designed specifically for developers learning the InviCMS App Module structure.
Learning Purpose
Perfect For
How It Works
Basic Functionality
Input Field
Enter your name
Say Hello
Updates greeting with your name
Reset
Clears input and resets greeting
Code Structure
Frontend Architecture
js/apps/demo-app/
├── demo-app.js ← Entry point
└── modules/
├── DemoApp.js ← Main coordinator
├── DemoAppDisplay.js ← Display updates
└── DemoAppHandlers.js ← Event handlers
Styling Architecture
css/apps/demo-app/
├── demo-app.css ← Main import file
├── _container.css ← Container styles
├── _greeting.css ← Greeting section
├── _controls.css ← Controls (input, buttons)
├── _info.css ← Info box
└── _responsive.css ← Mobile adjustments
Key Features
- Separation of Concerns: Display logic separate from event handling
- Multilingual Support: All text uses
__d()function - Input Validation: Shows alert if name is empty
- Keyboard Support: Press Enter to greet
For Developers
Using as a Template
Copy Structure
Duplicate the controller, view, CSS, and JavaScript files from Demo App.
Rename Files
Replace "DemoApp" with your app name throughout all files and classes.
Add Logic
Implement your app's specific functionality in the modules.
Customize Styles
Update colors, layout, and responsive breakpoints for your design.
Best Practices Demonstrated
CSS Best Practices
- Main file imports all partials with
@import - Each component in separate file (e.g.,
_controls.css) - Responsive styles in dedicated
_responsive.css - BEM-like naming convention:
.demo-app-container,.demo-btn
JavaScript Best Practices
- ES6 modules with
import/exportstatements - Main class coordinates sub-modules
- Display logic separate from event handlers
- Clear method naming:
handle*(),init(),bind*()
Multilingual Implementation
- All text wrapped in
__d()function - Proper key prefixing:
app.demo.key - Default values provided for fallback