Kora/developer documentation/Template Module

Template Module

A starter module with one of everything, ready to copy.

Kora-Template is a working module with a model, handler, route, clock, event, config, languages and a custom dashboard page. Copy it and rename things.

git clone https://github.com/zerodev-ca/Kora-Template modules/example

Files

modules/example/
├── main.js
├── resources/
│   ├── config/
│   │   └── settings.js
│   ├── dashboard/
│   │   └── pages/
│   │       └── template/
│   │           ├── page.js
│   │           └── view.tsx
│   └── lang/
│       ├── en/
│       │   ├── common.json
│       │   └── messages.js
│       └── es-ES/
│           └── common.json
└── src/
    ├── clocks/
    │   └── cleanup.js
    ├── events/
    │   └── licenseCreated.js
    ├── handlers/
    │   └── Items.js
    ├── models/
    │   └── Item.js
    └── routes/
        └── items/
            └── route.js

After Cloning

  1. Change name in main.js to your folder name.
  2. Rename the model, handler and route to what your module stores.
  3. Start Kora. The module shows up under Modules and its page in the sidebar.
  4. Add a common.json for each locale you support. See Languages.

Where Things Go

You want toPut it inSee
Store datasrc/models/Models
Write the logicsrc/handlers/Handlers
Add API endpointssrc/routes/Routes
Run something on a schedulesrc/clocks/Clocks
React to licenses and validationssrc/events/Events
Add Discord commandssrc/commands/Commands
Add settingsresources/config/Configuration
Add dashboard pagesresources/dashboard/pages/Pages
Add text and translationsresources/lang/Languages