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
-
domain/- Pure Kotlin: domain model, ports (interfaces) and use-cases
- No Spring / no JPA annotations
-
infrastructure/- Spring Boot application
- Adapters:
adapter/web: REST controllersadapter/persistence: JPA + Spring Data implementations of domain ports
- JDK 17+
- (Optional) PostgreSQL if you want to run against a real DB. By default it runs on H2 in-memory.
From the repo root:
./gradlew clean buildcd infrastructure
../gradlew bootRun- Health:
http://localhost:8080/actuator/health - Example API:
GET http://localhost:8080/api/operators
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
- JPA DDL is set to
validateso 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.