Skip to content

DevCore Manager Package

The foundation of the DevCore Framework is the Manager package. This core component provides essential services necessary for mobile or desktop management applications.

The Manager package is a VueJS/Vuetify extension that provides structure for your device management application. It provide the essential authentication, routing and data management services to manage one or more devices.

The Manager package provides the following features:

  • Setup and configuration of VueJS and Vuetify frameworks
  • Application structure with navigation bars, data display panels, dashboards and widgets and data editing forms
  • User authentication, login and access control
  • Dashboards and data and graphical widgets with dynamic live updating
  • Data property editor to view and modify device data
  • User navigation and request routing
  • Collection of core VueJS UI components for management applications
  • Device claim, release and management
  • Ability to connect to local HTTP device agents or cloud services

Using the Manager as a foundation, you can elimiate countless months of developer time in creating a device management solution.

Initializing the Manager

The manager package is initialized in the app's main routine via the createManager API. For example:

js
import {createManager} from 'manager'

async function main() {
    const manager = await createManager({
        display: Display,               //  UI Display definition
        schema: Schema,                 //  Database schema
        widgets: {graph: GraphWidget},  //  Additional dashboard widgets
        router,                         //  VueJS router
        vue,                            //  Vue instance
        vuetify,                        //  Vuetify instance
    }, {
        api: '/api',                    //  Backend URL prefix
        profile: Ioto.profile,          //  Execution profile
        name: Display.name,             //  App name
        title: Display.title,           //  App display title
        version: Display.version,       //  App version (x.y.z)
    })
main()

The createManager API accepts configured VueJS, Vuetify and Vue Router instances. You can configure these as you wish, but a typical setup would look like:

js
import * as components from 'vuetify/components'
import * as directives from 'vuetify/directives'
import Display from 'display.json5'

async main() {
    let vue = createApp(Main)
    let router = createRouter({
        history: createWebHashHistory(),
        routes: [],
    })
    let vuetify = createVuetify(
        vuetifyProps({
            components: components,
            directives: directives,
            themes: Display.theme.themes,
        })
    )
    vue.use(vuetify)

The Manager is created with arguments that define the UI display, VueJS components and other configuration options. Here is a table of the createManager first parameter arguments.

PropertyDescription
componentsA map of VueJS components
displayThe display.json5 UI route definition file
schemaThe device database schema
modelsA map of REST data models
widgetsA map of additional dashboard widgets
routerA configured VueJS router instance
vueA configured VueJS instance
vuetifyA configured Vuetify instance

The Manager constructor also takes an "options" argument that supplies essential app configuration information.

The following properties should be provided via the options:

PropertyDescription
apiBackend API URL prefix. Use "/api" for local and Connect.js when cloud-based.
nameApp name. Short one word product name.
titleApp display title. Short multi-word display product title.
profileOperational profile (dev, prod)
versionApp version (x.y.z)
buildBuild version number. Single number build version.

The Ioto agent distribution contains a suite of app samples that demonstrate constructing the Manager class. Each app has a ui/main.js file that constructs the Manager.

API Endpoint

When a Manager app is hosted by the cloud, the Ioto service adds a Connect.js configuration file to the app site that can be imported from the top level of your app. The Connect.js script provides the api endpoint address and the AWS Cognito user authentication endpoint configuration. Both are required for cloud-based device managers.

Here is a sample Connect.js:

js
{
    "api": "https://xxxxxxxxxx.execute-api.ap-southeast-1.amazonaws.com",
    "builder": "https://api.admin.embedthis.com",
    "cognito": {
        "userPoolId": "ap-southeast-2_xxxxxxxxx",
        "clientId": "xxxxxxxxxxxxxxxxxxxxxxxxxx"
    }
}

This file should be imported and the "api" and "cognito" properties used in the Manager options. For example:

js
await createManager({
    ...
}, {
    ...
    api: Connect.api,                   //  Backend cloud service API
    cognito: Connect.cognito,           //  Cognito config
})

Package Exports

The Manager package exports a suite of configured service objects and support functions.

Service Objects

NameDescription
AuthPrimary authentication service
FeedbackUser UI informational feedback service
ProgressUser activity progress bar service
RestREST HTTP service
RoutesNavigational routes service
RulesInput valiation rules
StateGlobal application state service

Support Functions

NameSignatureDescription
cancan(role)Can the logged in user perform the given role
createManagercreateManager(params, options)Create and initialiate a manager instance
getVuegetVue()Return the initialized Vue instance
getModelgetModel(model)Return the schema data model definition
getModelsgetModels()Return a list of the schema data models
getRoutegetRoute()Return the Vue Router object for the current UI page
getRoutePathgetRoutePath()Return the current Vue router URL
getRoutergetRouter()Return the Vue router instance
navigatenavigate(url, query)Navigate the UI to the given URL
vuetifyPropsvuetifyProps(params)Convert the given params to Vuetify constructor args