0.0.1 • Published 1 year ago

lpd-product-amadeus-leisure-platform-israel v0.0.1

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

LPD Product - Amadeus Leisure Platform Israel

js-standard-style

The project includes the application for the Amadeus Leisure Platform for the Israeli market.

Motivation

The application is to be retreaded after more than 10 years. This includes topics such as better security and a modern UI/UX.

Build status

Build status of continus integration.

Build Status Windows Build Status

Screenshots

Screen 1 Screen 2 Screen 3

Tech/framework used

Built with

Features

What makes your project stand out?

Installation

Clone the repository

git clone ssh://git@git.rnd.amadeus.net/trsc/lpd-product-amadeus-leisure-platform-israel.git

Step into the new project

cd lpd-product-amadeus-leisure-platform-israel

Prepare hosts file for development server

In case of using external services like Keycloak and use redirects to our development. Because of security external services like Keycloak are not allowed to redirect to localhost. This is why we need a fake host running on the development server. To simulate this fake host you must edit your hosts file and prepare it for the new fake domain which is using here in this project.

You can find the hosts file here:

MacOS: /etc/hosts

Windows: C:\Windows\System32\Drivers\etc

Please add to your hosts file the following line.

127.0.0.1       alp-il.local

Configure access token for Amadeus private npm registry

Apart from the packages sourced from the public NPM registry, we also use an internal NPM package (search-service) which contains the types and enumerations used in the Binoculars search service project (the Search service gateway). That package is published in a private Amadeus NPM registry. To access that registry you need to provide an access token based on you corporate Amadeus credentials. Here is how to get and provide that token to NPM:

  1. On your machine go to your $HOME directory (your user directory) and open the .npmrc file located there. It should contain the following:

    registry=https://registry.npmjs.org/

    If the contents of the file differs, delete everything and paste the above line.

  2. Add the following three lines below the above one:

    //repository.rnd.amadeus.net/api/npm/:_auth =
    always-auth = true
    email = YOUR_CORPORATE_AMADEUS_EMAIL
  3. In GitBash run the following command and provide your Amadeus username and password, when prompted, to get Amadeus registry access token:

    curl -u AMADEUS_USERNAME https://repository.rnd.amadeus.net/api/npm/auth

    If for some reason the above does not work, run the following instead:

    curl -u AMADEUS_USERNAME:AMADEUS_PASS https://repository.rnd.amadeus.net/api/npm/auth
  4. The response will consist of three lines. The one that you are interested of starts with _auth =:

    _auth = SOME_ACCESS_TOKEN_STRING

    Copy the access token from the above line and paste it after the //repository.rnd.amadeus.net/api/npm/:_auth = text in the .npmrc file you have edited. Note that the token must remain on the same line as the registry address:

    //repository.rnd.amadeus.net/api/npm/:_auth = SOME_ACCESS_TOKEN_STRING
  5. This is how the .npmrc file should look like at the end:

    registry=https://registry.npmjs.org/
    //repository.rnd.amadeus.net/api/npm/:_auth = SOME_ACCESS_TOKEN_STRING
    always-auth = true
    email = YOUR_CORPORATE_AMADEUS_EMAIL

Please, note that the the above has to be adjusted as per the Linux / MacOS location of the user .npmrc file.

Install packages

After providing the access token for the private Amadeus NPM registry, install all dependencies:

npm install

Developing

Once you've created a project and installed dependencies with npm install (or pnpm install or yarn), start a development server:

npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open

## Building

To create a production version of your app:

```bash
npm run build

You can preview the production build with npm run preview.

To deploy your app, you may need to install an adapter for your target environment.

API Reference

Depending on the size of the project, if it is small and simple enough the reference docs can be added to the README. For medium size to larger projects it is important to at least provide a link to where the API reference docs live.

Tests

Describe and show how to run the tests with code examples.

How to use?

If people like your project they’ll want to learn how they can use it. To do so include step by step guide to use your project.

Contribute

Let people know how they can contribute into your project. A contributing guideline will be a big plus.

Security

Authorization

Login

Middleware

Authentication

After every login we store the user data

{
  userName: string;
  isAuthenticated: boolean;
  token: string;
  profile: string;
  fullName: string;
  zoneInfo: string;
}

inside the application. There is no PII data stored in sessions, cookies or local storages.

By a page refresh the data will request again and stored in the running application at runtime.

By every request to our middleware the stored token from the user object will send automatically at header request.

'Authorization' = `Bearer ${user.token}`;

With this header the client will authorize at our middleware and ALP IL API. The ALP IL will use it also for authentication the right user.

License

MIT © Amadeus