ServiceService Settings
Service

Service Settings

Reference for the ServiceSettings ontology in Mindbricks, including ServiceBasics, ServiceOptions, and supported DbTypes.

MPO Version: 1.3.0

Defines the foundational settings of the service module, including basic metadata and authentication configurations. These settings must be established before designing the service's data model. They determine the service's identity, behavior within the project, and how it handles authentication. This configuration acts as the entry point for service-level behavior, ensuring consistency and security from the outset of development.

interface ServiceSettings = {
  serviceBasics : ServiceBasics;
  serviceOptions : ServiceOptions;
}
FieldDescription
serviceBasicsDefines the basic metadata of the service, including its unique name, description, and optional custom configuration variables. These basics are used throughout code generation, routing, and documentation.
serviceOptionsDefines basic options of the service for authentication, http and data model

ServiceBasics

MPO Version: 1.3.0

Provides core identifiers and metadata for the service. Includes the service's internal ID, a unique name (used in code, routing, and service naming), a descriptive text for documentation, and any custom variables required for runtime configuration.

interface ServiceBasics = {
  id : String;
  name : String;
  description : Text;
  frontendDocument : Text;
  customVariables : DataMapSimpleItem[];
  nodejsPackages : NodeJsPackageItem[];
}
FieldDescription
idUnique identifier of the service, automatically managed within the project.
nameService name used for naming files, folders, endpoints, and routes. Use short, single-word names in camelCase if needed. This field impacts many system-level identifiers.
descriptionA clear, human-readable explanation of what the service does. This description appears in service-level documentation and interface annotations.
frontendDocumentA text based information to inform the frontend developer or frontend AI agent about the service specific UX behaviour of the service logic based on user stories and use cases. The format may be either text or markdown(recommended). Write the document as an AI prompt and describe service gneric UX behaviours. Any data object specific information should be given as a brief key sentence, since they will be detailed in their own objects. Note that this document will be given to the AI agent or human developer combined with all technical details that is generated from the servic design,so this document should only focus on service-specific behavioral UX business logic.
customVariablesA list of custom key-value pairs that will be available to all scripts and functions within the service. Useful for environment-specific settings or reusable values.
nodejsPackagesA list of npm packages to be added to the nodejs package json of the service. They will be imported in the business api context if required.

NodeJsPackageItem

MPO Version: 1.3.0

An object to define a nodejs npm package requirement to be added to the nodejs package json of the service

interface NodeJsPackageItem = {
  packageName : String;
  version : String;
  defaultImportConst : String;
}
FieldDescription
packageNameThe official import name of the package in the npm cloud. It may be a single string or a path like string
versionThe version of the package that will be imported. Use an asterix (*) if you need the latest version
defaultImportConstA const name like axios that will be the main default import of the librarry.

ServiceOptions

MPO Version: 1.3.0

Defines a configuration class for the basic options of the service for authentication, http and data model

interface ServiceOptions = {
  serviceRequiresLogin : Boolean;
  serviceAllowsUserToLogin : Boolean;
  httpPort : Integer;
  routerSuffix : String;
  dataModelName : String;
  dbType : DbTypes;
  useSoftDelete : Boolean;
  machineToMachineBlockList : String[];
  allowedM2MClients : String[];
}
FieldDescription
serviceRequiresLoginIf true, all API calls to this service require a valid login token unless explicitly marked otherwise.
serviceAllowsUserToLoginKeep this false unless you know what you are doing. If true, the service provides login endpoints for users, allowing it to act as an authentication provider. This option is used if you want to make your own auth/user service instead of the default one created with authentication module configuration.
httpPortThe port number that the service will use to listen for HTTP traffic. Recommended to use ports in the 3000-3099 range for consistency across microservices.
routerSuffixUse this in your custom deployment if you have any suffix in your service url to be removed before evaluated in express router. AI Agents should keep this null.
dataModelNameThe name identifier of the data model configuration. For current Mindbricks versions, use 'main' or 'default'. In future versions with support for multiple data models per service, this name will distinguish them.
dbTypeSpecifies the type of database engine used for storing the service's data. It must be one of the values in the DbTypes enum. Currently, PostgreSQL is fully supported; MongoDB is in beta.
useSoftDeleteIndicates whether records are soft-deleted (i.e., marked inactive using an 'isActive' flag) instead of being physically removed from the database. This setting applies globally unless overridden at the data object level.
machineToMachineBlockListAn array of service names that are blocked from accessing this service using machine-to-machine tokens. Services listed here cannot call this service's APIs with machine tokens. However, blocked services can still access public APIs (loginRequired: false) and can trigger event-based functions on behalf of users when using user tokens. This provides fine-grained control over inter-service communication while maintaining flexibility for public endpoints and user-initiated actions.
allowedM2MClientsAn array of service names that are allowed to access this service using machine-to-machine tokens. Only services listed here will be able to call this service's APIs with M2M tokens in stage and production environments. This list is written to the ALLOWED_M2M_CLIENTS environment variable as a comma-separated string. In test and dev environments, this control is not enforced.

DbTypes

Enumeration of supported database types for service-level data models.

const DbTypes = {
  postgresql: "postgresql",
  mongodb: "mongodb",
};
EnumDescription
postgresqlUse PostgreSQL for relational database management.
mongodbUse MongoDB for document-oriented data storage (currently in beta).
Was this page helpful?
Built with Documentation.AI

Last updated today