Pages and navigation
Its own pages with menu entries and counters, quick actions on the home page and sections in the organization settings.
Modules · For developers
Assessments and Expenses are modules themselves: plugins that bring pages, endpoints, tables and texts without the core changing. Yours is built the same way – also in a separate, private repository.
A plugin is a folder under plugins/<id>. The core finds it when it builds and when it starts. A small, complete example is open in the repository: plugins/notes, personal notes.
The manifest in package.json describes the module: its id, the plugin API version, its permissions and the module an organization switches on or off.
plugins/demo/package.json
{
"name": "@acme/demo",
"apensum": {
"id": "demo",
"apensumApi": 2,
"dbSchema": "demo",
"permissions": [
{ "id": "nav.demo", "kind": "nav",
"scopes": ["own", "all"], "caption": "nav.demo" }
],
"module": { "id": "demo", "caption": "modules.demo",
"defaultEnabled": false, "objects": ["nav.demo"] },
"api": "dist/api/index.js",
"web": "web/index.tsx"
}
}
NestJS controllers and services, declared with defineApiPlugin. Every request checks permissions with the same building blocks as the core.
// plugins/demo/api/index.ts
import { defineApiPlugin } from '@worktime3/api/plugin';
import { DemoController } from './demo.controller';
export default defineApiPlugin({
id: 'demo',
controllers: [DemoController],
});
Pages, navigation, settings and texts in four languages, declared with defineWebPlugin. The module uses the core’s components, so it looks like the rest of the app.
// plugins/demo/web/index.tsx
import { defineWebPlugin, FolderSharedIcon } from '@worktime3/web/plugin';
export default defineWebPlugin({
id: 'demo',
texts: DEMO_TEXTS, // en, de, fr, it
pages: [{
section: 'demo', hash: '#/demo', object: 'nav.demo',
nav: { group: 'myWork', label: 'nav.demo', icon: <FolderSharedIcon /> },
render: (ctx) => <DemoPage orgId={ctx.orgId} authHeaders={ctx.authHeaders} />,
}],
});
Its own tables, in a Postgres schema of its own if you like, with its own Liquibase changelog. It runs after the core’s; the table definitions for the code are generated from it.
plugins/demo/changelog/db.changelog-master.xml
plugins/demo/changelog/001-demo-schema.sql
npm run dev:migrate # the core's changelog, then every plugin's
npm run dev:introspect # writes plugins/demo/api/db/schema.ts
Clone the plugin repository into plugins/<id>, build, start: the core loads it, and npm test runs its tests too.
git clone <your repository> plugins/demo
npm run build --workspace=@worktime3/api
npm run dev:api # log: "Loaded plugins: ..., demo"
npm run dev:web
npm test # the core's tests, then the plugin's
If the plugin is in plugins/<id> when the app is built, it is part of the app’s images. Without it the core keeps working as before – CI checks that on every change.
plugins/demo/ -> built into the API and web images
the core keeps working without it
The core offers fixed extension points. A module declares what it brings; navigation, permissions and reporting pick it up.
Its own pages with menu entries and counters, quick actions on the home page and sections in the organization settings.
Its own tables and migrations, its own permissions with default grants per role, and its own demo data.
Its own approvals in the workflow, sent to the person’s manager if you like – even when the manager changes.
Its own reports with grouping, Excel, PDF and scheduled delivery, and its own tables in the Team tab for managers and HR.
Files on the person’s Documents page and amounts in the payroll export.
AI calls through the core’s budget: Azure in Switzerland, with a monthly limit per organization and for the whole instance.
Ground rules
So that the core and modules can evolve independently, a few rules apply. The core checks names and version when it starts.
The demo runs with the sample data of a fictitious company. Pick a demo account on the login page and click through – no registration needed.