mirror of
https://github.com/andwati/cymelle.git
synced 2026-11-14 12:35:12 +00:00
spring and intellij setup
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
DATABASE_URL=
|
||||
DATABASE_USERNAME=
|
||||
DATABASE_PASSWORD=
|
||||
|
||||
LOW_STOCK_THRESHOLD=10
|
||||
|
||||
FARE_BASE_FARE=100.00
|
||||
FARE_PER_KM_RATE=50.00
|
||||
FARE_MINIMUM_FARE=150.00
|
||||
FARE_DEFAULT_SURGE_MULTIPLIER=1.0
|
||||
FARE_CURRENCY=KES
|
||||
|
||||
SEED_DATA=true
|
||||
@@ -35,3 +35,4 @@ out/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
.env
|
||||
|
||||
@@ -14,14 +14,28 @@ java {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.springframework.boot:spring-boot-starter")
|
||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
||||
implementation("org.springframework.boot:spring-boot-starter-validation")
|
||||
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
|
||||
|
||||
|
||||
runtimeOnly("com.h2database:h2")
|
||||
|
||||
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
||||
testImplementation("org.mockito:mockito-core")
|
||||
runtimeOnly("org.postgresql:postgresql")
|
||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
||||
|
||||
// dotenv
|
||||
implementation("io.github.cdimascio:dotenv-java:3.2.0")
|
||||
}
|
||||
|
||||
tasks.withType<Test> {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.andwati.orders;
|
||||
|
||||
import io.github.cdimascio.dotenv.Dotenv;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@@ -7,6 +8,9 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
public class OrdersBackendApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
Dotenv dotenv = Dotenv.configure().ignoreIfMissing().systemProperties().load();
|
||||
|
||||
SpringApplication.run(OrdersBackendApplication.class, args);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:h2:mem:orderfaretestdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
|
||||
driver-class-name: org.h2.Driver
|
||||
username: sa
|
||||
password:
|
||||
|
||||
jpa:
|
||||
hibernate:
|
||||
ddl-auto: create-drop
|
||||
open-in-view: false
|
||||
show-sql: false
|
||||
|
||||
inventory:
|
||||
low-stock-threshold: 10
|
||||
|
||||
fare:
|
||||
base-fare: 100.00
|
||||
per-km-rate: 50.00
|
||||
minimum-fare: 150.00
|
||||
default-surge-multiplier: 1.0
|
||||
currency: KES
|
||||
|
||||
app:
|
||||
seed-data: false
|
||||
@@ -1 +1,23 @@
|
||||
spring.application.name=orders-backend
|
||||
server.port=8080
|
||||
|
||||
spring.application.name=orders
|
||||
|
||||
spring.datasource.url=${DATABASE_URL}
|
||||
spring.datasource.username=${DATABASE_USERNAME}
|
||||
spring.datasource.password=${DATABASE_PASSWORD}
|
||||
spring.datasource.driver-class-name=org.postgresql.Driver
|
||||
|
||||
spring.jpa.hibernate.ddl-auto=update
|
||||
spring.jpa.open-in-view=false
|
||||
spring.jpa.properties.hibernate.format_sql=true
|
||||
spring.jpa.show-sql=false
|
||||
|
||||
inventory.low-stock-threshold=${LOW_STOCK_THRESHOLD:10}
|
||||
|
||||
fare.base-fare=${FARE_BASE_FARE:100.00}
|
||||
fare.per-km-rate=${FARE_PER_KM_RATE:50.00}
|
||||
fare.minimum-fare=${FARE_MINIMUM_FARE:150.00}
|
||||
fare.default-surge-multiplier=${FARE_DEFAULT_SURGE_MULTIPLIER:1.0}
|
||||
fare.currency=${FARE_CURRENCY:KES}
|
||||
|
||||
app.seed-data=${SEED_DATA:true}
|
||||
|
||||
Reference in New Issue
Block a user