Consistency Rules
To prevent chaos among plugins, there's a list of specific rules that should be followed. Without them, building a unified and stable ecosystem would be a bit challenging, so let's agree that all plugin developers will adhere to them.
- SCF_ Prefix - If you need to specify a value that must be replaced by the developer, for example, configuration parameters in .env files, use the "SCF_" prefix followed by the name of the entity that should be there (also in uppercase). Example:
AUTH0_ID="SCF_AUTH0_ID"
AUTH0_SECRET="SCF_AUTH0_SECRET"
AUTH0_ISSUER="SCF_AUTH0_ISSUER"
AUTH0_AUDIENCE="https://auth/api"
- Naming Conventions - All plugin names to be referenced in the configuration should be written in lowercase, with words separated by hyphens (kebab-case). Example:
// Svelte Dashboard Plugin:
public string Name => "svelte-crud";
// Grafana-Prometheus Global Worker Plugin:
public string Name => "grafana-prometheus";
// AspNet Framework Plugin:
public string Name => "aspnet-ddd";
- API Specification - If you're developing a Framework plugin, please follow this specification so that all other plugins (e.g., Dashboard) have a unified place to access CRUD Endpoints:
GET: /api/modelName
Behavior: Returns a page of model objects according to the specified query parameters.
Query Parameters:
Page (number) - The requested pagination page
Count (number) - The number of items to return
SortColumn (string) - The column to sort the result by
IsAscending (boolean) - Whether to sort in ascending or descending order
SearchTerm (string) - The field to search
SearchContent (string) - The value of the field to search
Response Content:
{
"totalPages": X, // Total number of pages according to the current specified Count parameter
"totalCount": Y, // Total count of objects
"results": [
// Objects...
]
}
GET: /api/modelName/{id}
Behavior: Returns a single object specified by the id.
Response Content:
{
// Object fields...
}
POST: /api/modelName/
Behavior: Creates a new object.
Body Parameters:
{
// Object fields...
}
Response Content: Code only.
PUT: /api/modelName/{id}
Behavior: Modifies the fields of the object specified by id with those specified in the body parameters.
Body Parameters:
{
// Model fields...
}
Response Content: Code only.
DELETE: /api/modelName/{id}
Behavior: Deletes the object specified by id.
Response Content: Code only.