Skip to content

ChristianPacifici/graph-manager-svc

Repository files navigation

Kotlin Microservice with Spring Boot

Java 21 Kotlin Spring Boot Gradle jOOQ

Introduction

Technology Stack

Technology Version Purpose
Spring Boot 3.3.4 Application framework
Kotlin 2.1.21 Programming language
Java 21 Runtime platform
Gradle 8.13 Build tool
JOOQ 3.20.1 database-mapping class Generator

Quick Start

Prerequisites

  • Java 21 or higher
  • Gradle 8.31 (or use the wrapper inside)
  • Docker for containerization
  • Postman for testing

Running the Application

  1. Clone the repository
git clone https://github.com/ChristianPacifici/graph-manager-svc.git
cd graph-manager-svc
  1. build with gradle wrapper/docker
./gradlew build

this will also generate the JOOQ classes starting from the SQL file

or alternatively

./build-docker.sh

this will create the docker-container for the service, or you can do this via command line

docker build -t graph-manager-svc .
  1. Run the service if you want to immediately start testing the service, and you have docker installed, you can directly lunch
./run-docker.sh

or using the following on CLI

docker-compose up
  1. Access the application

API Documentation

Person Management Endpoints

Method Endpoint Description
POST /v1/graph-manager/edges Create and Edge
GET /v1/graph-manager/edges/tree/{Id} Get a tree of the edges, passing the desired root id using BFS
DELETE /v1/graph-manager/edges/{fromId}/{toId} Delete edge by id from and id to

Testing

A postman collection in available in /src/test/postman

Monitoring & Observability

curl http://localhost:8080/actuator/health
curl http://localhost:8080/actuator/metrics
curl http://localhost:8080/actuator/prometheus

Development Setup

IntelliJ IDEA

  1. Import as Gradle project
  2. Install Kotlin plugin
  3. Set Project SDK to Java 21
  4. Enable annotation processing

Project Structure

graph-manager-svc/
├── gradle/
├── src/
│   ├── main/kotlin/com/prewave/nodemager/configuration
│   ├── main/kotlin/com/prewave/nodemager/controller
│   ├── main/kotlin/com/prewave/nodemager/dto
│   ├── main/kotlin/com/prewave/nodemager/exception
│   ├── main/kotlin/com/prewave/nodemager/interceptor
│   ├── main/kotlin/com/prewave/nodemager/services
│   ├── main/resources/db/changelog
│   ├── main/resources/db/migration
│   ├── main/resources/db/application.yaml
│   ├── test/kotlin/com/prewave/nodemager/controller
│   ├── main/kotlin/postman
├── build.gradle.kts
├── build-docker.sh
├── docker-compose.yml
├── Dockerfile
├── gradle.properties
├── gradlew
├── gradlew
├── gradlew.bat
├── README.md
├── run-docker.sh
├── settings.gradle.kts

About

Graph Manager Service in Kotlin and JOOQ

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published