Skip to content

Web service for the CodeListHub project

License

Notifications You must be signed in to change notification settings

openpotato/codelisthub

Repository files navigation

GitHub

CodeListHub

The service behind CodeListHub. Build with .NET 9.

Technology stack

Getting started

The following instructions show you how to set up a development environment on your computer.

Prerequisites

  • Set up a local PosgreSQL 17 (or higher) instance.
  • Clone or download the repository CodeListHub.Data.
  • Clone or download this repository.
  • Open the solution file CodeListHub.sln in Visual Studio 2022.

Configure the CodeListHub CLI

  • Switch to the project CodeListHub.CLI.

  • Make a copy of the the appsettings.json file and name it appsettings.Development.json.

  • Exchange the content with the following JSON document and adjust the values to your needs. This configures the root folder for the csv data sources (the src folder in your local OpenHolidaysApi.Data repository) and the database connection.

    "Sources": {
      "RootFolderName": "c:\\codelisthub.data\\src"
    },
    "Database": {
      "Server": "localhost",
      "Database": "CodeListHub",
      "Username": "postgres",
      "Password": "qwertz"
    }

Create and populate the database

  • Build the CodeListHub.CLI project.
  • Run the CodeListHub.CLI project with parameter initdb --import. This will create and populate the PostgreSQL database.

Configure the CodeListHub WebService

  • Switch to the CodeListHub.WebService.

  • Make a copy of the the appsettings.json file and name it appsettings.Development.json.

  • Exchange the content with the following JSON document and adjust the values to your needs. This configures the database connection.

    "Database": {
      "Server": "localhost",
      "Database": "CodeListHub",
      "Username": "postgres",
      "Password": "qwertz"
    }

Build and test the API

  • Build the CodeListHub.WebService project.
  • Run the CodeListHub.WebService project and play with the Swagger UI.

Can I help?

Yes, that would be much appreciated. The best way to help is to post a response via the Issue Tracker and/or submit a Pull Request.