Skip to content

uouake/mastation

Repository files navigation

MaStation (backend)

MaStation is a Kotlin/Spring Boot backend for managing gas stations operations: operators, stations, employees, fuel inventory, orders, sales and price governance.

This repository is a Kotlin rewrite of the original Java project, using:

  • Hexagonal architecture (Domain + Ports + Adapters)
  • Liquibase for database migrations
  • Spring Boot 3 / Java 17

Modules

  • domain/

    • Pure Kotlin: domain model, ports (interfaces) and use-cases
    • No Spring / no JPA annotations
  • infrastructure/

    • Spring Boot application
    • Adapters:
      • adapter/web: REST controllers
      • adapter/persistence: JPA + Spring Data implementations of domain ports

Prerequisites

  • JDK 17+
  • (Optional) PostgreSQL if you want to run against a real DB. By default it runs on H2 in-memory.

Build & test

From the repo root:

./gradlew clean build

Run locally

cd infrastructure
../gradlew bootRun

Useful endpoints

  • Health: http://localhost:8080/actuator/health
  • Example API: GET http://localhost:8080/api/operators

Database & migrations

Liquibase changelog is located at:

  • infrastructure/src/main/resources/db/changelog/db.changelog-master.yaml

Default local configuration uses H2 in PostgreSQL compatibility mode:

  • jdbc:h2:mem:stationmanagement;MODE=PostgreSQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=TRUE

To use PostgreSQL instead, update in:

  • infrastructure/src/main/resources/application.yml

Notes

  • JPA DDL is set to validate so Liquibase remains the single source of truth for the schema.
  • Current code includes a minimal vertical slice (Operators) to demonstrate the hexagonal wiring end-to-end.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages