terminal-booking-service
v1.0.1
Published
![version](https://img.shields.io/badge/version-0.0.1-blue.svg?style=flat)
Downloads
4
Readme
LPD Frontend Service - Booking (Terminal)
The project includes the application for the LPD Frontend Services as a generic booking service for all frontend applications.
Motivation
The Terminal should be a generic booking service which helps all LPD frontend applications to align to all markets in case of booking workflow. The goal is to have one generic request which all frontend applications can contribute to and use it. That will make a switch to a different market much easier.
Build status
Build status of continuous integration.
Technology
Built with
Features
The service has a parameter to define for which market the booking workflow is triggered.
Installation
Clone the repository
git clone https://rndwww.nce.amadeus.net/git/scm/lpdfs/terminal-booking-service.git
Step into the new project
cd terminal-booking-service
Bootstrap the repo - this will install all npm
packages, and will create an .env
file which you should fill with real data. Please ask here the other contributors about the content to put in.
npm run bootstrap
Developing
Once you've created a project and installed dependencies with npm install
, start a development server:
npm run dev
Alternatively, you can use the following launch configuration for VSCode (.vscode/launch.json
) to start the server and connect VSCode's debugger to it automatically on every change:
{
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Nodemon debug",
"runtimeExecutable": "nodemon",
"runtimeArgs": ["--watch", "."],
}
]
}
Nodemon looks at the main
key from package.json
and uses that as an entry point, so no need to manually specify src/index.ts
here.
To use it, just start a debug session (no need to launch anything in advance). If you have other configurations in launch.json
, make sure to select this one in the Run and Debug pane or through the Debug: Select and Start Debugging
command.
To work on the schema generation, you can use the following launch.json
config in a similar way:
{
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Nodemon debug schema generation",
"runtimeExecutable": "nodemon",
"args": [
"${workspaceFolder}/build/model-generation/schemas.ts",
"--verbose"
]
}
]
}
When you select that debug config and start a session, the debugger will be restarted on any change to the source, the schema or the generation script itself.
Building
To start your application for production environment use the following command:
npm run start
Tests
To run tests for your application locally or at your CI/CD please use the following command:
npm run test
API Reference
The API reference or documentation you will find here:
Bitbucket
To update the documentation or reference you should use
Stoplight Studio and import the Bitbucket
repository. After starting the services you have access to a generated documentation version at
<api-url>/docs
Folder structure
- docs - folder where all documenations are located
- contracts - folder for OpenAPI documentation
- images - folder to store images or screenshots for documentation
- src - folder where all the business logic is stored for the api
- @types - folder for all type definitions
- api - folder for all parts of the api
- controllers - folder where controllers are stored
- helpers - folder for helper functions
- middleware - folder for middleware logic like authentication
- mocked - folder to store mocked data objects for testing
- models - folder for all models
- routes - folder for all routes
- v1 - folder for all routes for version 1
- schemas - folder for all schemas
- services - folder for all services to providers
- validations - folder for validation functions
- config - folder for configuration files
- constants - folder for all constants
- plugins - folder for fastify plugins
- tests - folder for all tests files
Jenkins pipeline and Isolation zone
Jenkins pipeline is executed on each push in a branch and on opening/modifying a PR. The definition of the job is available in the Jenkinsfile
in the root of the repo.
As part of the setup process, a Control tower isolation zone has been created: https://controltower.cicd.rnd.amadeus.net/isolationZones/terminal
The Jenkins folder could be found here: https://jenkins-pipeline-tchlpd.cicd.rnd.amadeus.net/job/terminal/
How to use it?
A detailed description of how the service is configured you will find here.
Contribute
How you can contribute to the project you will find here
Contributors
Team TravelScript - Confluence Page
Code of Conduct
The Code of Conduct guidelines you will find here.
License
MIT © Amadeus