Skip to content

Knijus/public-holidays

Repository files navigation

Nest Logo Postgres Logo

Description

Small API project using Nestjs and Postgres. API has several endpoints:

  • returns list of all covered countries;
  • returns public holiday dates for given country and year.
  • return specific day status for given country.

There will be a further improvements of this API:

  • will be added one more endpoint, where it returns longest in row holidays (freedays and holidays) for given country and year
  • furher improvements for service logic, error handling and etc.

Project is deployed with swagger on heroku server publicholiday

Installation

1. Clone this repo

$ git clone https://github.com/Knijus/public-holidays

2. Install nessesary dependencies

$ npm install

3. Install Postgres database on your machine and follow the instalation process

4. Create .env file and place environmental variables:

  • Default POSTGRES_HOST = 127.0.0.1;
  • Default POSTGRES_PORT = 5432;
  • User, password and database information use same as during the Postgres instalation.

5. Add env for used API adrress:

  • ENRICO_SERVICE=https://kayaposoft.com/enrico
  • RESPONSE_TYPE=json
  • ENRICO_VERSION=v2.0
  • ACTION_GET_SUPPORTED_COUNTRIES=getSupportedCountries
  • ACTION_GET_HOLIDAYS_FOR_YEAR=getHolidaysForYear
  • ACTION_IS_WORK_DAY=isWorkDay
  • PUBLIC_HOLIDAY=public_holiday
  • WORKDAY=workday
  • FREEDAY=freeday

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Stay in touch

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published