Giter Club home page Giter Club logo

product-traceability-foss-frontend's Introduction

Veracode Workflow Tests Workflow

Alt text

Trace-FOSS User Interface

Trace-FOSS is a system for tracking parts along the supply chain.

A high level of transparency across the supplier network enables faster intervention based on a recorded event in the supply chain. This saves costs by seamlessly tracking parts and creates trust through clearly defined and secure data access by the companies and persons involved in the process.

Application

This application serves as a user entry point to the Catena-X network.

It's written in Typescript based on the Angular framework.
We decided on using Angular because of two important aspects.
Firstly, Angular comes with strict guidelines, which makes it harder to start working on for new developers, but for established developers it is easy to start working with.
Secondly, Angular scales perfectly in the long run. Because of the restricted possibilities and stricted guidelines it is hard to implement multiple solutions for the same problem. e.g. Storing data or routing.
With that in mind it made sense it chose Angular for an open source project.

Source files are exposed statically through the NGINX web server.

Challenges and solutions

"Visualisation of traceability" is one of our most important feature, but once was one of our biggest problems.
We wanted to achieve something that is visually pleasing, is easy to use and performs very good in a browser application.
Our first approach was to use HTML canvas. But it turned out it is hard to perform accurate actions inside a canvas. That is why we decided on using the D3 library.
D3.js is a JavaScript library for manipulating documents based on data. D3 helps you bring data to life using HTML, SVG, and CSS.
Because it uses SVGs, we knew it will perform great. And we are able to have pinpoint accuracy when it comes to user actions.

Getting started

Clone the source locally:

$ git clone ${path}
$ cd product-traceability-foss-frontend

Configurations

If you're using angular for the first time, run npm install -g @angular/cli to install the angular command-line interface.

This project was generated with Angular CLI version 13.3.6.

Angular CLI is the official tool for initializing and working with Angular projects. It saves you from the hassle of complex configurations and building tools like TypeScript, Webpack, and so on.

After installing Angular CLI, you'll need to run one command to generate a project and another to serve it using a local development server to play with your application.

Find here documentation to support you during the development and configuration of the app.

Setup changelog generation

Follow these instructions: GIT-CHGLOG
You can generate a changelog when running git-chglog -o CHANGELOG.md

Application authentication

Please find here some important information about the app authentication.

Application architecture & patterns

This architecture gives you a roadmap and best practices to follow when building an application so that you end up with a well-structured app.

Angular security best practices

These are the best practices recommended to avoid vulnerabilities in your application.

Development guidelines

These guidelines are defined to maintain homogeneous code quality and style. It can be adapted as the need arises.

New and old developers should regularly review this guide to update it as new points emerge and to sync themselves with the latest changes.

User guide

A detailed explanation of how to use the application.

Conventions

Angular Template Attribute Convention

Attributes in Angular template should be properly ordered by groups:

  1. * - Structural Directives
  2. [] - Attribute Directives or Input parameters
  3. () - Event listeners
  4. All other attributes

Bonus: VSCode extensions

Some VSCode extensions that might improve your coding experience :)

  • Angular files
  • Angular language service
  • Angular schematics
  • Auto rename tag
  • Color info
  • Color picker
  • CSS peek
  • Code spell checker
  • Debugger for firefox
  • Document this
  • ESlint
  • HTML CSS support
  • Import cost
  • Indent-rainbow
  • JavaScript code snippets
  • Material icon theme
  • npm
  • Open browser preview
  • Path intellisense
  • Prettier
  • Stylelint
  • Tailwind CSS intellisense
  • TODO highlight
  • TODO tree
  • Version lens
  • Visual Studio IntelliCode
  • Yaml

Local Keycloak

Prerequisites

  • Docker with docker-compose

How to run local Keycloak?

Keycloak can be started through:

yarn env:mock

Keycloak First Configuration

On the first Keycloak start it should be properly configured.

By default, it would be available at http://localhost:8080

To get to the configuration section please click on Administration Console.

Default user/password is admin/admin.

Now you can start the configuration.

Create a new Realm mock and select one.

In Realm Settings (from sidebar) -> Security Defenses: Clear X-Frame-Options Set Content-Security-Policy to frame-src 'self'; object-src 'none’;

In Clients (from sidebar)

  1. Create a new client catenax-portal
  2. Edit catenax-portal
    1. Set Valid Redirect URIs to *
    2. Web Origins to *

In Roles (from sidebar):

  1. Add next roles:
  • user
  • admin
  • supervisor

In Users (from sidebar):

  1. Create user default-user with email, first name and last name, then assign to it user role for catenax-portal client and set a password (disable temp password option)
  2. Create user default-admin with email, first name and last name, then assign to it admin role for catenax-portal client and set a password (disable temp password option)
  3. Create user default-supervisor with email, first name and last name, then assign to it supervisor role for catenax-portal client and set a password (disable temp password option)

All done!

How to contribute

TBD
For now, we are following the angular guidelines which can be found here: Angulars how to contribute

Branching system and release workflow

We are using the GitHub Flow for our branching system.

The general idea behind this approach is that you keep the main code in a constant deployable state.
You start off with the main branch, then a developer creates a feature branch directly from main.
After the feature is developed the code is reviewed and tested on the branch.
Only after the code is stable it can be merged to main.

License

Apache License 2.0

product-traceability-foss-frontend's People

Contributors

anacin avatar blazkepa avatar cxkreuz avatar dblankevia avatar ds-ext-akononenko avatar ds-ext-bkepa avatar ds-ext-jserwa avatar fbedarf avatar scherersebastian avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.