The repository contains the code implementing IO Pay Portal frontend.
This project is the frontend for Checkout1 payment flow that interacts with the eCommerce API2.
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
In order to build and run this project are required:
The table below describes all the Environment variables needed by the application.
Variable name | Description | type |
---|---|---|
IO_PAY_PORTAL_API_HOST | api services | endpoint/string |
IO_PAY_PORTAL_API_REQUEST_TIMEOUT | request timeout | milliseconds |
- Install node packages
yarn install
- Generate api client
yarn generate
- Build
yarn build
- tests
yarn test
- Linter
yarn lint
In order to run the application on a local dev server with mock API responses:
-
yarn dev
the application is available at http://localhost:1234
To run the application on a local dev server with real API:
-
yarn dev:proxy
Files put inside the static folder will be copied to the parcel output dir 'dist' during the build.
In a development environment, if using the default parcel .proxyrc configuration, the static folder will be served alongside the dist folder, so that most change made in the static folder will be visible on a page reload during development.
The CI/CD pipelines are defined in the .devops folder. It is required to set the following variables on Azure DevOps:
- GIT_EMAIL
- GIT_USERNAME
- GITHUB_CONNECTION
- PRODUCTION_AZURE_SUBSCRIPTION
- STAGING_AZURE_SUBSCRIPTION
- PRODUCTION_RESOURCE_GROUP_NAME
- PRODUCTION_CDN_ENDPOINT
- PRODUCTION_CDN_PROFILE_NAME
- IO_PAY_PORTAL_API_HOST
- IO_PAY_PORTAL_API_REQUEST_TIMEOUT
- IO_PAY_PORTAL_PAY_WL_POLLING_INTERVAL
- IO_PAY_PORTAL_PAY_WL_POLLING_ATTEMPTS
The app uses i18n for translations, in order to add a new one follow this steps:
- Add new language folder in src/translations
- Create a new file titled: translations.ts
- Copy the content of the existing translations as template and change accordingly with new translations
export const TRANSLATIONS_<LANG> = { mainPage: { footer: { accessibility: <"Accessibilità">, ... }, }, ...
- In src/translations/lang.ts import your template
import { TRANSLATIONS_IT } from "./it/translations";
- Add the new configuration in src/translations/lang.ts
const lang: Languages = { it: { label: "Italiano", lang: "it-IT", translation: TRANSLATIONS_IT, }, en: { label: "English", lang: "en-EN", translation: TRANSLATIONS_EN, }, //here }