Skip to content

markuczy/onecx-shell-ui

This branch is 2 commits behind onecx/onecx-shell-ui:main.

Folders and files

NameName
Last commit message
Last commit date
Oct 22, 2024
Jan 3, 2025
Oct 11, 2024
Jun 14, 2024
Feb 21, 2025
Jan 3, 2025
Jan 3, 2025
Sep 5, 2024
Sep 5, 2024
Jan 3, 2025
Sep 5, 2024
Sep 5, 2024
Feb 18, 2025
Feb 22, 2024
May 6, 2024
Apr 3, 2024
Jan 3, 2025
Sep 5, 2024
Aug 21, 2024
Jul 29, 2024
Apr 3, 2024
Jan 22, 2025
Jan 22, 2025
Jan 3, 2025
Sep 5, 2024
Jan 3, 2025
Apr 3, 2024
Apr 3, 2024
Apr 3, 2024
Apr 3, 2024
Jan 22, 2025

Repository files navigation

Onecx Shell UI

Start base services

docker-compose up -d postgresdb traefik keycloak-app pgadmin

Start bff and svc containers required for shell ui

Basic local database setup

alternatively you can go to adminer and export the latest data

Start the shell ui

  • npm i
  • npm run start

Start specific product in the shell ui

  • start the required bff and svc containers of the product
  • Before you can start a UI in the shell, please do Option 1 or Option 2 first and then you can
  • start the ui on a port of your choice: ng serve --port <port-number>
  • Example onecx-workspace-ui: ng serve --port 4201
  • open with: http://localhost:4300/admin/workspace

Option 1

Configure proxy.conf.js

  • add property to const PROXY_CONFIG = {} like in the example below with correct mappings
  • Example for onecx-workspace-ui:

you can find the other paths of other microfrontends by going to pgadmin to the table microfrontend of onecx-product-store in the column remote_base_url

/**
 * Used in local environment:
 *   Request proxy to rewrite URLs and prevent CORS errors
 */
const logFn = function (req, res) {
  console.log(
    new Date().toISOString() + `: bypassing ${req.method} ${req.url} `
  );
};
const bypassFn = function (req, res) {
  logFn(req, res);
  if (req.method.toUpperCase() === 'OPTIONS') {
    res.setHeader('Allow', 'GET, POST, HEAD, PUT, DELETE, OPTIONS');
    res.setHeader('Access-Control-Allow-Origin', '*');
    res.setHeader('Access-Control-Allow-Methods', '*');
    res.setHeader('Access-Control-Allow-Headers', '*');
    return res.send('');
  } else {
    return null;
  }
};

const PROXY_CONFIG = {
  '/shell-bff': {
    target: 'http://onecx-shell-bff',
    pathRewrite: { '^.*/shell-bff': '' },
    secure: false,
    changeOrigin: true,
    logLevel: 'debug',
    bypass: bypassFn,
  },
  // example mapping for workspace
  '/mfe/workspace': {
    target: 'http://localhost:4201',
    pathRewrite: { '^.*/mfe/workspace': '' },
    secure: false,
    changeOrigin: true,
    logLevel: 'debug',
    bypass: bypassFn,
  },
};

module.exports = PROXY_CONFIG;

Option 2

Change it directly in the DB

About

OneCx shell UI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages

  • TypeScript 88.7%
  • JavaScript 3.5%
  • HTML 3.4%
  • SCSS 1.8%
  • Shell 1.8%
  • Dockerfile 0.8%