Skip to content

Backend application that fixes stuff like macgyver for team sykmelding

License

Notifications You must be signed in to change notification settings

navikt/macgyver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deploy to dev and prod

macgyver

Application that fixes stuff like Macgyver for team sykmelding frontend application is located here README.md

Technologies used

Backend:

  • Kotlin
  • Ktor
  • Gradle
  • Junit

Frontend:

  • React
  • Vite

Requirements

  • JDK 21
  • Node 20

FlowChart

This the high level flow of the application

  graph LR
;
    web["web (vite)"] --> wonderwall --> macgyver["macgyver (ktor)"]
    macgyver --- azure-ad;
    macgyver --- id1[(syfosmregister)];
    macgyver --- PDL;
    macgyver --- oppgave;
    macgyver --- narmesteleder;
    macgyver --- saf;
Loading

Getting started

Pre-requisites

Install these using mise/asdf or any other package manager (not brew)

  • JDK 21
  • Node 20

Enable corepack:

corepack enable

Running the application

Run the backend

For local development the application runs in two parts, the ktor app and the vite development server. The Ktor-app is best to run in IntelliJ so you can do partial builds and get hot swapping.

Go to Application.kt and run the main function, edit the run-configuration in IntelliJ and add the following "VM Option":

-Dio.ktor.development=true

You can now use this to run the application in development mode. Using the "build" feature in IntelliJ on a single file will (usually) hot-swap it without requiring a full server reboot when developing.

Run the frontend

While the backend is running, cd into the web folder and run the following commands:

yarn
yarn dev

You will now have a development server on http://localhost:5173 that uses the Ktor-backend. You're not ready to develop new MacGyver features!

Note: Vite automatically hot-reloads.

Build and run tests

To build locally and run the integration tests you can simply run

./gradlew shadowJar

or on windows gradlew.bat shadowJar

Creating a docker image should be as simple as

docker build -t macgyver .

💾 Running a docker image

docker run --rm -it -p 8080:8080 macgyver

Upgrading the gradle wrapper

Find the newest version of gradle here: https://gradle.org/releases/ Then run this command:

./gradlew wrapper --gradle-version $gradleVersjon

Swagger api doc

The Swagger api doc is available here https://macgyver.intern.dev.nav.no/docs

Contact

This project is maintained by navikt/teamsykmelding

Questions and/or feature requests? Please create an issue

If you work in @navikt you can reach us at the Slack channel #team-sykmelding

About

Backend application that fixes stuff like macgyver for team sykmelding

Resources

License

Security policy

Stars

Watchers

Forks

Packages