Skip to content

kbss-cvut/fta-fmea-ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FTA and FMEA tool

This tool provides two types of reliability analyses - Fault Tree Analysis (FTA) and Failure Modes and Effects Analysis (FMEA). It is primarily focused on FTA, which offers possibilities for system partonomy definition, FTA construction and automatic conversion of the trees to FMEA tables given the unified ontological model. A detailed description of its features is described in user manual.

This repository contains the frontend of the tool. The backend is written in Java and is developed separately (its repository can be found here). A live demo of the tool is available here.

Execution

npm install
npm run build
npm run preview

Running complete tool in Docker

  1. Change the working directory using cd ./deploy/internal-auth
  2. Run docker-compose up -d to start the application.
  3. The application should be accessible at http:/localhost:8080/

Configuration

The tool also supports configuration to disable registration of new users within security, but by default, everybody can register. There are two flags which need to be set:

  • Backend - Run application with -Dspring.profiles.active=admin-registration-only profile
  • Frontend - Set FTA_FMEA_APP_ADMIN_REGISTRATION_ONLY in .env.production to true

Development

To develop the tool, the easiest way to run it is as follows:

  1. Run the complete tool as described in Running complete tool in Docker
  2. Run frontend of the tool that connects to just-started docker services:
npm install
npm run dev

Note that the guide above runs two frontends, one as a docker service from step 1 and another executed by npm run dev from step 2.

Recommended Development Approach

  • Vite setup
  • styling (css/sass)
  • routing
  • user context
  • data flow through the app
  • modules binding
  • consultation

Prettier

We use Prettier to keep the codebase formatting consistent. To simplify this process, a pre-commit Git hook is set up with Husky. This hook runs Prettier code formatting before every commit.

Pre-commit troubleshooting

If you experience issues on pre-commit using the GUI and you are using a node version manager, such as nvm, add the following script:

# ~/.config/husky/init.sh
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

For more information, follow this guide.


This repository was created within the project LTACH19032.