8b112535bb97202cfd208888fea31cc7fdc36742
howto: --> Watch out for names. Stylesheet and javascript names, will be used global!
├─ create new plugin:
│ ├─ add line to index.js: 'service.get('socketManager').add("%namespace%");'
│ ├─ add context in plugins route.js:
│ │ └─ app.post('/window/:name/index', async (req, res) => { await renderWindow(app, 'index', metadata, { user: await vUser.findOne({ where: { Benutzer: req.cookies.sAMAccountName }, raw: true } ) }, res) });
│ └─
├─ create new socket namespaces:
│ └─ service.get('socketManager').add("%namespace%");
└─ add new startmenu entries:
├─ add context object to file '/src/models/integratedStartmenuItems.js', where you can define pass through context paramters
└─ add view-template to '/public/views/integrated/'
useful global features:
├─ %plugin%/public/javascripts.main.js ** for each plugin, main.js is loading for global use ├─ eventlog │ ├─ service.get('eventManager).write(...) ** writes log entry and notifys admins on webui │ └─ service.get('eventManager).writeLog(...) ** writes log entry only without firing webui message ├─ notifyTray │ └─ service.get('notifyTray').createAndNotify ... └─
rules:
├─ filesystem: │ ├─ app descriptions, file/folder names in English; except proper names │ ├─ files and folders always lowercase; continue in uppercase instead of spaces │ ├─ files in routes folder, have to be named %name%Routes.js to generate dynamic menu │ ├─ folder names in plural, if files are included │ └─ folder names in singular, if files are excluded ├─ code: | ├─ javascript: | │ ├─ ids, classes, data-attributes (names and values) with hyphen (Bindestrich) instead of spaces; always lowercase | │ └─ functions (and parameters in it) always lowercase; continue in uppercase instead of spaces | ├─ socket.io: | │ └─ socket names with underscores instead of spaces; always lowercase | ├─ json: | │ └─ variables in strings: "${}" (e.g ${ROOTPATH}) └─ others: ├─ admin eventlog in English ├─ regions in English; first letter and proper names in capital └─ users eventlog/messaging in German
folder structur:
root/ ** server relevant files │ ├─ node_modules/ ** npm third party modules for nodejs server ├─ plugins/ ** server webapp based extensions │ └─ %plugin_name%/ ** dynamic name reservation │ ├─ views/ ** contains handlebar views │ ├─ public/ ** contains plugin specified static files │ │ ├─ helpers/ ** contains plugin specified handlebars helpers function │ │ ├─ javascript/ ** contains plugin specified javascript code │ │ ├─ others/ ** contains plugin specified files like options or templates │ │ └─ styles/ ** contains plugin specified stylesheets │ ├─ docs/ │ │ ├─ help.hbs *** helper file for webapp description │ │ └─ tutorial.hbs *** tutorial file, for webapp tutorial │ ├─ index.js *** plugin entry point │ ├─ plugin.json *** metadata basefile │ └─ sockets.js *** plugin specified sockets ├─ public/ ** contains all visible static files │ ├─ helpers/ ** javascript express handlebars helpers for client views │ ├─ images/ ** global images │ ├─ styles/ ** global stylesheets file │ │ ├─ responsive/ │ │ │ ├─ desktop.css *** responsive layout for desktops │ │ │ ├─ mobile.css *** responsive layout for smartphones │ │ │ └─ tablet.css *** responsive layout for tablets │ ├─ dark.css *** dark theme │ ├─ light.css *** light theme │ └─ default.css *** global layout for everything everywhere all at once │ └─ views/ ** contains the handlebars views │ ├─ layouts/ ** templates for views │ │ ├─ default.hbs *** main layout for everything everywhere all at once │ │ └─ stricted_area.hbs *** layout without menus and links │ └─ partials/ ** view snippets for multiple use ├─ src/ ** files for handle server inquiries │ ├─ controllers/ ** contains the business logic receiving and validating client inquiries │ ├─ models/ ** data/-base models │ │ ├─ configuration.json *** server configuration file │ │ └─ stylesheets.json *** global client stylesheet variabels │ ├─ routes/ ** handles endpoint routing │ ├─ secure/ ** contains encrypted passfiles and certificates │ ├─ services/ ** contains business logic classes │ │ ├─ authentication.js *** authenticates client connection attempts │ │ ├─ encryption.js *** de-/ encryption serialization class │ │ ├─ eventlog.js *** messaging class; client and server based │ │ ├─ pluginsystem.js *** plugin engine │ │ └─ sql.js *** microsoft sql connection and processing queries │ └─ sockets/ ** global sockets │ development.json *** development to do's │ license_internal.txt *** license text file │ package-lock.json *** npm link to node_modules │ package.json *** file for server initialization │ release_notes.json *** shows server version release notes └─ server.js *** file for handle server start
stucture of style.json:
root
│
├─ themes:
│ ├─ dark:
│ └─ light:
└─ responsive:
├─ desktop:
├─ tablet:
└─ mobile:
structure of plugin:
root/ │ ├─ plugins/ │ ├─ ${plugin}/ │ │ ├─ views/ │ │ │ └─ index.hbs (main file) │ │ ├─ styles/ │ │ │ └─ *.css (Set stylesheet as usual in header-section) │ │ ├─ scripts/ │ │ │ └─ *.js (Load file with function reloadPluginScript("/${pluginname}/javascript/${name}.js") in script-section) │ │ └─ files/ │ │ └─ *.png (Set the name exactly as it appears in the plugin.json file) │ └─ plugin.json
Description
Ein webbasierten Betriebssystems, welches auf eine flexiblen Nutzung durch Plugins ausgerichtet ist
https://demo.sowada.dev
Languages
JavaScript
77.2%
CSS
10.1%
Handlebars
8.3%
TSQL
4.1%
HTML
0.3%