Skip to content

paulbrejla/ferien-api

Repository files navigation

License: MIT ferien-api

This is where the code for ferien-api.de lives.

Table of Contents

Built With

This project is built with Spring Boot and Kotlin, using an embedded h2 database as its data store.

Getting Started

To get a local copy up and running follow these simple steps.

Installation

  1. Clone the repo
git clone https://github.com/paulbrejla/ferien-api.git
  1. Add .ics calendar files to /main/resources/holidays
  • Filenames need to conform to the following format:
    ferien_{state}.ics
    e.g. ferien_Bremen.ics
    
  1. Configure environment variables to load .ics files from the classpath or from a git repo
Property filesystem (classpath) git
source filesystem git
remoteURL Not needed Git URL e.g. https://github.com/paulbrejla/ferien-api.git
branch Not needed Branch e.g. master
filePath Not needed Path to look up ics files e.g. src/test/resources/holidays/
  1. Run
./gradlew bootRun

Build with Docker

  1. Build Docker Image
docker build -t holidays-api .
  1. Tag Docker Image
docker tag holidays-api:latest remote-repo/holidays-api:latest 
  1. Push Docker Image to remote repo
docker push remote-repo/holidays-api:latest 

FAQ

I am running into rate limits when calling the API - can you fix this?

As the API is heavily abused, aggressive rate limiting is in place. If you need higher rate limits, you need to self-host it.

Some dates are wrong - can you fix them?

The source ics files are here: https://github.com/paulbrejla/ferien-api-data. To change a holiday date, open the ics file for the state and year and find the holiday entry. Change the entry and create a pull request against main.

Dates are missing - can you add them?

The source ics files are here: https://github.com/paulbrejla/ferien-api-data. To add a holidays for a given state and year, provide an ics file and create a PR against main.

Data is unreliable - can you fix data issues?

The source ics files are here: https://github.com/paulbrejla/ferien-api-data. To change a holiday date, open the ics file for the state and year and find the holiday entry. Change the entry and create a pull request against main.

License

Distributed under the MIT License. See LICENSE for more information.

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a build.
  2. Update the README.md with details of changes, this includes new environment variables, exposed ports, useful file locations and container parameters.

Contact

Paul Brejla - paul(at)paulbrejla.com

Project Link: https://github.com/paulbrejla/ferien-api