This project is currently in development.

CI Built with onborder-starter

πŸ¦Έβ€β™€οΈ Onborder

onborder is the official platform to expose how we do merchant onboarding @ Forter.

onborder

πŸ‘¨β€πŸ­ Installing

Clone from the current repo and then run the following command inside the root folder:

npm i

πŸ§™β€β™‚οΈ CLI

npm are included as follows:

  • build runs build command to pack onborder
  • start runs client using rollup in the root directory
  • test runs the unit and e2e test suites
  • lint runs ESLint with –fix flag to fix problematic patterns in code. Ignore warnings.
  • format runs prettier with –fix flag to auto format code.
  • coverage runs nyc to produce a test coverage report
  • check-outdated runs david which check if package npm dependencies are out of date
  • check-vulnerabilities" runs nsp which check if package npm dependencies have security issues

πŸ‘¨β€πŸ­ Installing

Clone from the current repo and then run the following command inside the root folder:

npm i

🀡 Directory Layout

β”œβ”€ images/
β”œβ”€ patches/
β”œβ”€ server/
β”œβ”€ client/
β”‚  β”œβ”€ components/
β”‚  β”‚  └─ Β·Β·Β·
β”‚  β”œβ”€ helpers/
β”‚  β”‚  β”œβ”€ page-element.js
β”‚  β”‚  └─ Β·Β·Β·
β”‚  β”œβ”€ pages/
β”‚  β”‚  β”œβ”€ page-home.js
β”‚  β”‚  └─ Β·Β·Β·
β”‚  β”œβ”€ router/
β”‚  β”‚  └─ routes.js
β”‚  └─ config.js
β”œβ”€ app.js
β”œβ”€ app.css
β”œβ”€ index.html
β”œβ”€ manifest.webmanifest
β”œβ”€ package.json
β”œβ”€ robots.txt
β”œβ”€ rollup.config.js
└─ tsconfig.json

πŸ‘©β€πŸ’» Using locally

This command serves the app at http://localhost:8000:

    npm start

πŸ‘¨β€βš•οΈ Linting

ESLint comes already installed, extending eslint-recommanded. Don’t forget to install the appropriate plugin for your editor.

 npm run fix-lint

πŸ‘¨β€πŸ”¬ Testing

Testing is done using mocha and chai. chai-as-promised is included to test promise-based code. Mocks, stubs, etc. can be done using sinon. nock is used to test HTTP requests. Nock also disables your app from performing any HTTP requests during tests (see test/setup.js).

There are examples for each library in test/foo.spec.js.

npm test

πŸš€ Deployment

The service knows to auto-deploy itself using firebase automatically. If you still need to manually deploy, run the following commands:

  1. Globally install firebase tools:
npm install -g firebase-tools
  1. Run in root folder:
npm run build
  1. Run in root folder:
firebase deploy

Alternatively to 3, you could also make a preview, which is parralel to the production deploy and will be auto-deleted.: Note this is a beta feature and will later on be automatically created in PRs.

firebase hosting:channel:deploy YOUR_PREVIEW_NAME_HERE

πŸ’‚ Coverage

Istanbul is used to produce a test coverage report. Look inside the coverage folder after running npm run coverage to see the results.

npm run coverage

πŸ‘¨β€πŸš€ Deploying

The app will be deployed to Github pages once merged to main branch

GitHub

View Github