Architecture overview
Presentation
The REGARDS frontend contains three differents interfaces:
- The
Portal interface, fully configurable (layout, theme and modules displayed), that lists projects. - The
User interface, fully configurable (layout, theme and modules displayed), that lets users browse project content. - The
Administrator interface, that allows Instance admin creating Projects and Project Admin configuring them.
For the Portal and User interfaces, REGARDS UI defines Dynamic modules to bring UI features that the administrator can control (options, layout, menus....).
Structure
The REGARDS frontend is divided in several NPM modules. Each one has a package.json file defining the name of the module. It allows us to import a module using that name instead of module relative path.
import { configureStore } from '@regardsoss/store' // Good
import { configureStore } from '../web_modules/data/store/src/main.js' // Bad practice
Before further explanation about the role of each module and folders, let's have a look on the global rs-frontend/webapp folder structure.
├── webapp # REGARDS Frontend webapp folder
├── dist # transpiled code for dev and prod
├── eslint-config-es6-rules # Eslint configuration for project (as a module)
├── mocks # Holds mock servers for features development
├── plugins # REGARDS plugins
├── reports # Local reports
| ├── coverage # Coverage report
| ├── mocha # Test report
├── resources # Some demo resources
├── scripts # Some helper scripts for installing, building... Mainly for plugins usage
├── src # frontend starter source code, common to user, portal and admin applications
| ├── main.jsx # Starter React file
| ├── rootReducer.js # Loads the Redux tree
| └── rootRouter.js # Loads the react-router logic
├── tests # Tests corresponding to src folder
├── web_modules # Contains all @regardsoss modules, except builder and lint ones
| ├── business-common # Reusable business logic, often shared between admin and user app
| ├── business-modules # Application static modules and specific applications starters `admin`, `portal` and `user`
| ├── components # Reusable React components
| ├── data # data related reusable elements
| | ├── api # module holding normalizer configurations for backend API
| | ├── client # module holding redux client to fetch data from backend
| | ├── domain # module holding business domain enumerations and constants
| | ├── shape # React PropTypes related with backend data and normalized data
| | └── store # Redux store helpers and configurators
| ├── modules # Dynamic modules
| ├── utils # REGARDS "generic" toolkit
| └── vendors # External libraries forks
├── webpack-config-front # Module holding plugins and modules webpack transpiler and defining dev and prod build constants
├── yeoman # Yeoman templates (cli to generate frontend modules and plugins)
├── package.json # Define npm scripts and list all dependencies
├── webpack.*.config.js # Various webpack configuration files, corresponding to similar NPM task
Common businness modules (business-common)
This folder contains business related modules, shared accross many REGARDS modules and/or applications
admin-data-entities-attributes-management: Shared React component to handle entities attributes configurationadmin-error-user-config-module: Shared React component to validate modules configurationattributes-common: Shared React components to configure and display attributes valuesendpoints-common: Shared data fetcher and storage for endpoint access rightsentities-common: Shared React components for entities related UI services (like displaying entity detail)global-system-error: Shared React components to display errors in REGARDS interfacesmicroservice-plugin-configurator: Shared React component to configure a REGARDS backedn microservice pluginorder-common: Shared React components to display orders in REGARDSproject-handler: Shared React High Order Component to fetch and publish in Redux store (see later sections) the current projecttoponym-common: Shared React components to work with toponymsuser-metadata-common: Shared project user metadata definition and edition React components
Business modules
This folder contains all applications modules that are not dynamic - ie that cannot be configured and set up in user nor in portal applications. Therefore it contains application starters (admin, user, portal) plus all administration interface modules.
Note: The administration application is structured in a thematic tree, like seen in the tree below. Each module at a given tree level imports and setup the modules below (reducers, routers,...)
├── portal # Portal app starter
├── user # User app starter
├── authenticate # Authenticate app starter
├── admin # Admin app starter
├── admin-accessright-accessgroup-management # Data access groups
├── admin-accessright-dataaccess-management # Data access rights per group
├── admin-account-management # Account (rs-admin instance)
├── admin-board-account # Account (rs-admin instance)
├── admin-board-acquisition # Acquisition
├── admin-board-collections # Data (rs-dam tenant)
├── admin-board-commands # Commands
├── admin-board-dataaccess # Data access rights (rs-dam tenant)
├── admin-board-models # Modelisation (rs-dam tenant)
├── admin-dashboard-management # Dashboard
├── admin-data-attribute-plugins-management
├── admin-data-attributemodel-management # Attribute model
├── admin-data-collection-management # Collection
├── admin-data-connection-management # Connection
├── admin-data-dataset-management # Dataset
├── admin-data-datasource-management # Datasource
├── admin-data-fragment-management # Fragment
├── admin-data-model-management # Model
├── admin-data-modelattribute-management # Model attribute association
├── admin-data-provider-management
├── admin-dataaccess-searchengines-management
├── admin-dataaccess-services-management
├── admin-datapreparation-management
├── admin-delivery-management
├── admin-feature-management
├── admin-ingest-processing-chain-management
├── admin-lta-management
├── admin-microservice-management # Java Plugins and microservice lifecycle
├── admin-oais-management
├── admin-order-management
├── admin-processing-management
├── admin-project-management # Project (rs-admin instance)
├── admin-storage-management
├── admin-ui-layout-management # UI Layout
├── admin-ui-management # User interface (rs-access-*)
├── admin-ui-module-management # UI Modules configuration
├── admin-ui-plugin-management # UI Plugin
├── admin-ui-service-management # UI Plugin services
├── admin-ui-settings-management
├── admin-ui-theme-management # UI Theme
├── admin-user-authentication-plugins-management
├── admin-user-management # User configuration (rs-admin tenant)
├── admin-user-projectuser-management # Project User
├── admin-user-role-management # Role
├── admin-user-role-resource-access-management # REST resource authorisation per role