Air Discount Scheme


Generates discount codes that can be used for booking domestic flights online.
There are certain precondition to be eligible for a discount. They are:
  • The person's legal domicile needs to be in a predefined set of towns outside the capital (We fetch postal codes from Þjóðskrá to validate if user is eligible).



The API is used by airlines to verify the discount code validity and get basic booking info about the user.
The airlines that have access to this api are Icelandair, Ernir and Norlandair. Historically some flights were booked for Norlandair through Icelandair, those flights are marked with the Icelandair airline but have a cooperation field with Norlandair.
yarn start air-discount-scheme-api


The admin frontend has a view over the bookings that have been registered in the system. This is mainly for Vegagerðin.
yarn start air-discount-scheme-backend


The user frontend has information about the initiative, legal terms and a way for users to get their discount codes.
yarn start air-discount-scheme-web


  • Þjóðskrá: To be able to verify the persons legal domicile, give the airlines basic information about the person and fetch a persons relations to show the discount codes for related children.


To get started developing this project, go ahead and:
  1. 1.
    Fetch the environment secrets:
yarn get-secrets air-discount-scheme-api
yarn get-secrets air-discount-scheme-backend
yarn get-secrets air-discount-scheme-web
  1. 2.
    Start the resources with docker-compose and migrate/seed the database:
docker-compose -f apps/air-discount-scheme/backend/docker-compose.yml up
yarn nx run air-discount-scheme-backend:migrate
yarn nx run air-discount-scheme-backend:seed
  1. 3.
    Start the front end:
yarn start air-discount-scheme-web
  1. 4.
    Start the graphql api:
yarn start air-discount-scheme-api
  1. 5.
    Start the backend api:
yarn start air-discount-scheme-backend
  1. 6.
    Check Contentful and AWS
Login here (Contact devops if you need access) Copy env variables as instructed here (image arrows 1,2,3) Paste env variables into terminal Run ./scripts/ from root You have success if you see Forwarding from -> 9200 in terminal
Navigate to localhost:4200 for the website or localhost:4248/api/swagger/ for the airline api.


To access the Admin UI, you'll need to add your Icelandic National ID to the comma separated environment variable DEVELOPERS (.env.secret) and restart the api.
export DEVELOPERS=1234567890


Because of the short timeline this assignment had, there were few shortcuts taken that can be improved upon:
  • The authentication is pretty primitive, the IDP is still in development at the time of this writing so we needed to use static api keys.
  • The deployment pipeline is outside of the islandis main pipeline.
  • The graphql api is separate of the main graphql api of islandis.

Project owner

Code owners and maintainers