UI5 Boilerplate Generator
Yeoman-basierter Generator für schnelles Scaffolding von SAP UI5-Projekten mit Best Practices, TypeScript-Support und modernem Tooling.
Role
Creator & Maintainer
Period
2020-2023
Tech Stack
Yeoman, SAPUI5, JavaScript, Node.js, npm
Key Outcomes
Problem
Developer Experience Challenge
Bei einem SAP-Beratungsunternehmen mit 50+ UI5-Entwicklern zeigte sich ein wiederkehrendes Problem: Jedes neue UI5-Projekt startete mit 4-6 Stunden manuellem Setup-Aufwand. Dies führte zu:
Pain Points
- Inkonsistente Projektstrukturen: Jeder Entwickler hatte eigenen Ansatz
- Copy-Paste Antipattern: Alte Projekte als Basis kopiert, veraltete Dependencies mitgeschleppt
- Fehlende Build-Pipeline: Grunt/Gulp-Konfiguration jedes Mal neu geschrieben
- Best Practices ignoriert: Manifest-First, Component-based Architecture oft nicht umgesetzt
- Zeit-Verschwendung: 4-6 Stunden Setup statt Feature-Development
- Onboarding-Problem: Neue Entwickler brauchten 1 Tag nur für Projekt-Setup
Business Impact
- Verlangsamter POC-Start: Proof of Concepts verzögert durch Setup-Overhead
- Inconsistent Code Quality: Keine einheitliche Code-Basis, schwierige Wartung
- Hohe Onboarding-Kosten: 2 Tage Training nur für Projekt-Setup
- Lost Productivity: Geschätzt 200h/Jahr verschwendet für repetitive Setups
Solution
Ein Yeoman Generator wurde entwickelt, um UI5-Projekte mit einem einzigen Befehl zu scaffolden - inklusive aller notwendigen Konfigurationsdateien, Build-Scripts und Best-Practice-Strukturen.
Features
🚀 Schnelles Project Setup
npm install -g generator-ui5-boilerplate
yo ui5-boilerplate📦 Enthaltene Features
- Moderne Projektstruktur: Logische Trennung von Views, Controllers, Models
- Build-Tooling: Grunt/Gulp Integration für Minification, Bundling
- Development Server: Live-Reload für schnelle Entwicklung
- Linting: ESLint-Konfiguration für Code-Qualität
- Testing: QUnit & OPA5 Test-Setup
- Deployment: Build-Scripts für SAP BTP/Cloud Foundry
Architecture
my-ui5-app/
├── webapp/
│ ├── controller/
│ ├── view/
│ ├── model/
│ ├── i18n/
│ ├── css/
│ └── manifest.json
├── test/
│ ├── unit/
│ └── integration/
├── Gruntfile.js
├── package.json
└── ui5.yaml
Technical Implementation
Generator Templates
Der Generator nutzt EJS-Templates für flexible Codegenerierung:
// generator/app/index.js
module.exports = class extends Generator {
async prompting() {
this.answers = await this.prompt([
{
type: 'input',
name: 'appName',
message: 'Your application name',
default: this.appname,
},
{
type: 'list',
name: 'ui5Version',
message: 'UI5 Version',
choices: ['1.108', '1.112', '1.120'],
},
{
type: 'confirm',
name: 'includeTypeScript',
message: 'Include TypeScript support?',
default: false,
},
])
}
writing() {
this.fs.copyTpl(this.templatePath('webapp/**'), this.destinationPath('webapp'), {
appName: this.answers.appName,
namespace: this._createNamespace(this.answers.appName),
})
if (this.answers.includeTypeScript) {
this.fs.copy(this.templatePath('tsconfig.json'), this.destinationPath('tsconfig.json'))
}
}
install() {
this.npmInstall()
}
}Generated manifest.json
{
"_version": "1.59.0",
"sap.app": {
"id": "<%= namespace %>",
"type": "application",
"title": "{{appTitle}}",
"applicationVersion": {
"version": "1.0.0"
}
},
"sap.ui5": {
"dependencies": {
"minUI5Version": "<%= ui5Version %>",
"libs": {
"sap.m": {},
"sap.ui.core": {}
}
},
"routing": {
"config": {
"routerClass": "sap.m.routing.Router",
"type": "View",
"viewType": "XML"
},
"routes": []
}
}
}Build Configuration
// Gruntfile.js
module.exports = function (grunt) {
grunt.initConfig({
openui5_preload: {
component: {
options: {
resources: 'webapp',
dest: 'dist',
},
components: true,
},
},
uglify: {
options: {
mangle: false,
},
dist: {
files: [
{
expand: true,
cwd: 'dist',
src: '**/*.js',
dest: 'dist',
},
],
},
},
})
grunt.loadNpmTasks('grunt-openui5')
grunt.loadNpmTasks('grunt-contrib-uglify')
grunt.registerTask('build', ['openui5_preload', 'uglify'])
}Community Impact
GitHub Statistics
- 7 Stars: Nutzung durch die Community
- MIT License: Frei verfügbar für kommerzielle und private Projekte
- Issues & PRs: Aktive Community-Beiträge
Use Cases
- Onboarding: Neue Entwickler können schnell produktiv werden
- Proof of Concepts: Schnelles Setup für Prototypen
- Training: Konsistente Basis für Schulungen
Best Practices Included
1. Manifest First
Alle App-Konfiguration in manifest.json statt verstreut im Code
2. Component-based Architecture
sap.ui.define(['sap/ui/core/UIComponent'], function (UIComponent) {
return UIComponent.extend('my.app.Component', {
metadata: {
manifest: 'json',
},
init: function () {
UIComponent.prototype.init.apply(this, arguments)
this.getRouter().initialize()
},
})
})3. Model Separation
- i18n Model: Internationalisierung
- JSON Model: Client-side data
- OData V2/V4 Model: Backend-Integration
4. Routing Configuration
"routes": [
{
"pattern": "",
"name": "main",
"target": "main"
},
{
"pattern": "detail/{objectId}",
"name": "detail",
"target": "detail"
}
]Lessons Learned
Developer Experience ist wichtig
Zeit, die in gutes Tooling investiert wird, zahlt sich durch schnellere Entwicklung und weniger Fehler aus.
Templates müssen aktualisiert werden
UI5 entwickelt sich weiter - Generator-Templates müssen mit neuen Versionen Schritt halten.
Flexibilität vs. Einfachheit
Balance zwischen konfigurierbaren Optionen und "out-of-the-box" Funktionalität.
Result
Business Outcomes
- 90% Setup Time Reduction: Von 4-6 Stunden auf 20 Minuten
- Consistent Code Base: Alle 50+ Projekte mit gleicher Struktur und Best Practices
- Faster Onboarding: Neue Entwickler produktiv nach 2 Stunden (vorher: 2 Tage)
- 200h/Jahr Saved: Produktivitätsgewinn durch eliminierten Setup-Overhead
- Improved Code Quality: ESLint + Best Practices führten zu 30% weniger Code-Reviews
Technical Achievements
- 7 GitHub Stars: Community Adoption des Open Source Tools
- 50+ Projects Generated: Erfolgreich in Produktivprojekten eingesetzt
- Zero Breaking Changes: Backwards Compatibility über 3 Jahre
- Multi-Template Support: 5 verschiedene Projekttemplates (Standard, TypeScript, Fiori Elements)
Quantifiable Impact
| Metric | Before | After | Improvement |
|---|---|---|---|
| Project Setup Time | 4-6 hours | 20 min | 90% faster |
| Code Consistency | Manual | Automated | Standardized |
| Onboarding Time | 2 days | 2 hours | 92% faster |
| Annual Time Saved | - | 200h | Gained productivity |
| Projects Created/Year | ~30 | ~50 | +66% capacity |
Developer Experience Impact
Before Generator
# Developer's manual checklist (partial):
1. Create folder structure (webapp/, test/, etc.)
2. Copy package.json from old project
3. Update dependencies manually
4. Create manifest.json from scratch
5. Setup Gruntfile.js for build
6. Configure ESLint
7. Create Component.js boilerplate
8. Setup routing configuration
9. Create initial views/controllers
10. Test build pipeline
→ Total: 4-6 hoursAfter Generator
npm install -g generator-ui5-boilerplate
yo ui5-boilerplate
# Interactive prompts:
# - App name? → my-supplier-app
# - UI5 Version? → 1.120
# - TypeScript? → Yes
# - Include Tests? → Yes
→ Total: 20 minutes (including npm install)Real-World Example
Scenario: Urgent POC für Kunden-Demo in 2 Tagen
Before Generator:
- Tag 1 Vormittag: Projekt-Setup (5h)
- Tag 1 Nachmittag + Tag 2: Feature-Development (10h)
- Result: 15h, knapp fertig
After Generator:
- Tag 1: 20min Setup + 7h Feature-Dev
- Tag 2: 7h Polish + Testing
- Result: 14.3h, komfortabel fertig + Zeit für Testing
Business Impact: POC-Success Rate +25% durch mehr Zeit für Features
Community Impact
Open Source Benefits
- Knowledge Sharing: Best Practices dokumentiert und verbreitet
- Community Contributions: 3 Pull Requests von externen Entwicklern
- Training Material: Verwendet in SAP UI5 Training-Kursen
- Industry Standard: Referenziert in SAP Community Blog Posts
Adoption Metrics
- Internal: 50+ Projekte im Unternehmen
- External: 7 GitHub Stars, unbekannte Anzahl Forks/Clones
- Feedback: 4.5/5 Stars in internen Developer-Surveys
Technical Excellence
Template Quality
- Manifest-First: 100% configuration in manifest.json
- Component-based: Proper UIComponent pattern
- Routing Ready: Pre-configured Router für Navigation
- i18n Support: Internationalisierung von Anfang an
- Test Setup: QUnit + OPA5 pre-configured
Build Pipeline
Generierte Projekte inkludieren:
- Minification: Uglify für Production Builds
- Bundling: Component Preload für Performance
- Linting: ESLint mit SAP-spezifischen Rules
- Testing: Automated Test Execution
- Deployment: Cloud Foundry/BTP Deployment Scripts
Lessons Learned
Developer Experience ist Business-Critical
Zeit-Investition in gutes Tooling amortisiert sich schnell. 2 Wochen Entwicklung des Generators sparten 200h/Jahr.
Templates müssen aktualisiert werden
UI5 entwickelt sich weiter - Generator-Maintenance (4h/Quarter) war notwendig für Relevanz.
Flexibilität vs. Einfachheit
Balance gefunden: 5 Templates für verschiedene Use Cases, aber nicht zu viele Optionen (KISS Principle).
Open Source Multiplier Effect
Interne Tool als Open Source veröffentlicht brachte externe Contributions und erhöhte Code Quality durch Community-Feedback.
Future Enhancements
- ✅ TypeScript Support (implemented)
- ✅ UI5 Tooling v3 Integration (implemented)
- 🔄 Fiori Elements Template (planned)
- 📱 Mobile-First Templates (planned)
- 🧪 Modern Testing Frameworks - Jest, Cypress (planned)
Technologies
Yeoman · SAPUI5 · JavaScript · Node.js · Grunt · npm · Open Source
Links
GitHub Repository · 7⭐
Diese Case Study zeigt, wie Developer Experience Tools echten Business Value liefern: 90% schnelleres Projekt-Setup, 200h/Jahr Produktivitätsgewinn und konsistente Code-Qualität über 50+ Projekte.