mirror of
https://github.com/andwati/cymelle.git
synced 2026-11-27 18:28:46 +00:00
spring and intellij setup
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
|||||||
|
.gradle/
|
||||||
|
build/
|
||||||
|
out/
|
||||||
|
*.class
|
||||||
|
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
|
||||||
|
.idea/
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
logs/
|
||||||
|
*.log
|
||||||
Generated
+11
@@ -1,5 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<annotationProcessing>
|
||||||
|
<profile name="Gradle Imported" enabled="true">
|
||||||
|
<outputRelativeToContentRoot value="true" />
|
||||||
|
<processorPath useClasspath="false">
|
||||||
|
<entry name="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-configuration-processor/4.1.0/c3e27f93b579220e4e18fe941321525200eb36b/spring-boot-configuration-processor-4.1.0.jar" />
|
||||||
|
</processorPath>
|
||||||
|
<module name="orders.main" />
|
||||||
|
</profile>
|
||||||
|
</annotationProcessing>
|
||||||
|
</component>
|
||||||
<component name="JavacSettings">
|
<component name="JavacSettings">
|
||||||
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
|
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
|
||||||
<module name="orders" options="-parameters" />
|
<module name="orders" options="-parameters" />
|
||||||
|
|||||||
Generated
+3
@@ -1,6 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<component name="FrameworkDetectionExcludesConfiguration">
|
||||||
|
<file type="web" url="file://$PROJECT_DIR$/orders-backend" />
|
||||||
|
</component>
|
||||||
<component name="KubernetesApiProvider"><![CDATA[{}]]></component>
|
<component name="KubernetesApiProvider"><![CDATA[{}]]></component>
|
||||||
<component name="ProjectRootManager" version="2">
|
<component name="ProjectRootManager" version="2">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
|
|||||||
Generated
+1
@@ -4,6 +4,7 @@
|
|||||||
<modules>
|
<modules>
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/cymelle.iml" filepath="$PROJECT_DIR$/.idea/cymelle.iml" />
|
<module fileurl="file://$PROJECT_DIR$/.idea/cymelle.iml" filepath="$PROJECT_DIR$/.idea/cymelle.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/orders.iml" filepath="$PROJECT_DIR$/.idea/modules/orders.iml" />
|
<module fileurl="file://$PROJECT_DIR$/.idea/modules/orders.iml" filepath="$PROJECT_DIR$/.idea/modules/orders.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/modules/orders.main.iml" filepath="$PROJECT_DIR$/.idea/modules/orders.main.iml" />
|
||||||
</modules>
|
</modules>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@@ -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 ###
|
### VS Code ###
|
||||||
.vscode/
|
.vscode/
|
||||||
|
.env
|
||||||
|
|||||||
@@ -14,14 +14,28 @@ java {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
gradlePluginPortal()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
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.springframework.boot:spring-boot-starter-test")
|
||||||
|
testImplementation("org.mockito:mockito-core")
|
||||||
|
runtimeOnly("org.postgresql:postgresql")
|
||||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
||||||
|
|
||||||
|
// dotenv
|
||||||
|
implementation("io.github.cdimascio:dotenv-java:3.2.0")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<Test> {
|
tasks.withType<Test> {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.andwati.orders;
|
package com.andwati.orders;
|
||||||
|
|
||||||
|
import io.github.cdimascio.dotenv.Dotenv;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
@@ -7,6 +8,9 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||||||
public class OrdersBackendApplication {
|
public class OrdersBackendApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
Dotenv dotenv = Dotenv.configure().ignoreIfMissing().systemProperties().load();
|
||||||
|
|
||||||
SpringApplication.run(OrdersBackendApplication.class, args);
|
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}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import babel from '@rolldown/plugin-babel'
|
|||||||
import tailwindcss from '@tailwindcss/vite'
|
import tailwindcss from '@tailwindcss/vite'
|
||||||
import { nitro } from 'nitro/vite'
|
import { nitro } from 'nitro/vite'
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
const config = defineConfig({
|
const config = defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
devtools(),
|
devtools(),
|
||||||
|
|||||||
Reference in New Issue
Block a user