Skip to content

What’s in a plugin ​

A raclette plugin is a directory with a fixed contract to the framework: one metadata file, then optional frontend/ and backend/ trees. The loader uses that layout to register HTTP routes, frontend widgets, generated config, and more.

  • The frontend side exposes frontend/index.ts (plugin API), routes, and widgets for the UI.
  • The backend side exposes backend/index.ts and typically routes, models, and services β€” see Backend overview.

This page stays short on purpose. The same layout is also documented from a repository perspective in Directory structure β€” plugins/.

Canonical folder layout ​

The diagram below is the usual shape for a plugin that has both frontend and backend (names like examplePlugin are placeholders):

exampleCreator__examplePlugin/
β”œβ”€β”€ raclette.plugin.ts            # Main plugin configuration 
β”œβ”€β”€ frontend/                     # Frontend-side code (if frontendDir specified)
β”‚   β”œβ”€β”€ [...]                     # See plugin metadata for more
β”‚   └── widgets/                  # Plugin widgets
β”‚       β”œβ”€β”€ Example/           # Your custom Widget folder name 
β”‚       β”‚   β”œβ”€β”€ ExampleWidget.vue    # The widget File. Needs to follow this structure "[CustomName]Widget.vue"
β”‚       β”‚   β”œβ”€β”€ setup.ts          # Contains details and config for the widget
β”‚       β”‚   └── [...] 
β”‚       └── [...] 
└── backend/                      # Server-side code (if backendDir specified)
    β”œβ”€β”€ index.ts                  # Server entry point
    β”œβ”€β”€ example.model.ts     # The model for your dataType. Currently mongoose
    β”œβ”€β”€ example.schema.ts    # The schema for your dataType. Fastify schema, validations etc
    β”œβ”€β”€ example.service.ts   # The services for your dataType ie the actuall backend business logic         
    β”œβ”€β”€ routes/                   # API routes
    └── helpers/                  # Business logic helpers and utils

Details of raclette.plugin.ts

Required configuration ​

Every plugin needs raclette.plugin.ts (plugin metadata: name, author, entry paths, …). See Plugin metadata for fields and examples.

Optional parts ​

  • No backend/ β€” frontend-only plugins are valid (widgets + client-only behavior).
  • No frontend/ β€” backend-only plugins are valid (APIs without custom UI).

See also ​