Configuring a kApp
Backend side
kApp backend configuration is based on Feathers so the same guidelines are applicable, the default configuration can be found in the api/config
folder. The main properties are the following:
- apiPath: the API path prefix
- port: the server port
- domain: the web application domain name (eg https://app.kalisio.xyz)
- apiLimiter: the API rate limiting configuration
- http: for HTTP REST clients, compliant with express-rate-limit options
- websocket: for Websocket clients, compliant with node-rate-limiter options
- authentication : object configuring Feathers authentication plus custom options
- passwordPolicy: password policy configuration
- minLength: minimum length
- maxLength: maximum length
- uppercase: boolean indicating if the password requires at least an uppercase letter
- lowercase: boolean indicating if the password requires at least an uppercase letter
- digits: boolean indicating if the password requires at least a digit
- symbols: boolean indicating if the password requires at least a symbol
- prohibited: array of prohibited common passwords
- history: number of passwords to look for in history to avoid keeping a similar one when changing
- defaultUsers: the array of default users to be created on launch (format
{ email, password }
)- note: will not be exposed on staging/production environments for security concerns
- limiter: the authentication API rate limiting configuration
- http: for HTTP REST clients, compliant with express-rate-limit options
- websocket: for Websocket clients, compliant with node-rate-limiter options
- passwordPolicy: password policy configuration
- logs: object configuring the winston loggers to be used - each key is a transport name which value is associated configuration options
- db: database configuration
- storage: storage service configuration used by core
- accessKeyId: AWS S3 access key
- secretAccessKey: AWS S3 secret access key
- bucket: AWS S3 bucket to be used
- mailer: e-mail service configuration, compliant with nodemailer options plus custom Kalisio options, e.g.
- service: e-mail service to be used (like
gmail
) - auth: user login and password
- templateDir: directory containing the e-mails templates to be used
- service: e-mail service to be used (like
- push: feathers-webpush configuration
- subject: VAPID server contact information
- publicKey: VAPID public key.
- privateKey: VAPID private key
- proxyTable: a set of proxy rules typically used for scaling
Environment variables (will override defaults in config file):
- PORT / HTTPS_PORT: backend port for HTTP and HTTPS modes
- CLIENT_PORT / HTTPS_CLIENT_PORT: frontend port for HTTP and HTTPS modes (only used in development)
- DB_URL: database URL to access the app database
Frontend side
kApp frontend configuration is based on the same underlying tool that powers Feathers so the same guidelines are applicable, the default configuration can be found in the config
folder. The main properties are the following:
- apiPath: the API path prefix
- apiTimeout: the API timeout
- apiJwt: name of the local storage key used to store the JWT used by the internal API
- gatewayJwt: name of the local storage key used to store the JWT used by the API gateway
- version: the web application version number
- flavor: the web application flavor
- domain: the web application domain name (eg https://kapp.dev.kalisio.xyz)
- gateway: the API gateway domain name (eg https://api.dev.kalisio.xyz)
- transport : the transport to be used between frontend and backend, could be
http
for standard REST orwebsocket
for WebSockets - appName: the name of the app
- appLogo: the image to be used as logo for the app
- theme: the theme to be used
- logs
- level: log level to be used
- screens: connection screens configuration
- extraLinks: extra links displayed at the bottom of all screens,
- banner: displayed application banner,
- login: login screen configuration
- providers: array of OAuth2 providers to be used (like
['google', 'github']
), - links: links displayed at the bottom of the screen,
- providers: array of OAuth2 providers to be used (like
- logout: logout screen configuration
- links: links displayed at the bottom of the screen,
- changeEndpoint: change endpoint screen configuration (only useful for mobile apps)
- links: links displayed at the bottom of the screen,
- layout: layout configuration, see Quasar docs for details
- myActivity: configuration of the activity named
my-activity
in the application- topPane: application bar components configuration for this activity
- content: list of components to be displayed according to current mode of the activity (if any),
- filter: component filter using any expression supported by sift,
- leftPane: left pane (i.e. main menu) components configuration for this activity
- content: list of components to be displayed according to current mode of the activity (if any),
- filter: component filter using any expression supported by sift,
- bottomPane: bottom pane components configuration for this activity
- content: list of components to be displayed according to current mode of the activity (if any),
- filter: component filter using any expression supported by sift,
- rightPane: right pane components configuration for this activity
- content: list of components to be displayed according to current mode of the activity (if any),
- filter: component filter using any expression supported by sift,
- page: additional page components configuration for this activity
- content: list of components to be displayed according to current mode of the activity (if any),
- filter: component filter using any expression supported by sift,
- window: window (i.e. widgets) configuration for this activity
- widgets: list of widgets to be displayed,
- filter: component filter using any expression supported by sift,
- fab: floating action button (FAB) configuration for this activity
- actions: list of actions to be displayed,
- filter: action filter using any expression supported by sift
- topPane: application bar components configuration for this activity
TIP
The main difference with the backend configuration is that the actual frontend configuration is generated by WebPack at build time from the config files, so you will need to rebuild the app to see your changes applied
WARNING
Althought we use JS objects en environment variables in the frontend configuration to ease writing it please note that the resulting configuration file will be a static JSON file so don't store complex JS objects like functions in the config as it will not work
Environment variables for the frontend development server (will override defaults):
- PORT / HTTPS_PORT: backend port for HTTP and HTTPS modes (used to configure proxy)
- CLIENT_PORT / HTTPS_CLIENT_PORT: frontend port for HTTP and HTTPS modes