Skip to content

Commit

Permalink
project init
Browse files Browse the repository at this point in the history
  • Loading branch information
Lujaec committed Dec 7, 2024
0 parents commit 8580c50
Show file tree
Hide file tree
Showing 18 changed files with 599 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
MYSQL_ROOT_PASSWORD=docker-mysql-root-pwd
MYSQL_DATABASE=dating-service-db
MYSQL_USER=lujae
MYSQL_PASSWORD=docker-mysql-user-pwd
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/gradlew text eol=lf
*.bat text eol=crlf
*.jar binary
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/
19 changes: 19 additions & 0 deletions admin/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
plugins {
id 'java'
}

group = 'org.yapp'
version = '0.0.1-SNAPSHOT'

repositories {
mavenCentral()
}

dependencies {
testImplementation platform('org.junit:junit-bom:5.10.0')
testImplementation 'org.junit.jupiter:junit-jupiter'
}

test {
useJUnitPlatform()
}
7 changes: 7 additions & 0 deletions admin/src/main/java/org/yapp/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.yapp;

public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}
6 changes: 6 additions & 0 deletions admin/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
spring:
datasource:
url: jdbc:mysql://localhost:3306/dating-service-db
username: lujae
password: docker-mysql-user-pwd
driver-class-name: com.mysql.cj.jdbc.Driver
22 changes: 22 additions & 0 deletions api/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
plugins {
id 'java'
}

group = 'org.yapp'
version = '0.0.1-SNAPSHOT'

repositories {
mavenCentral()
}

dependencies {
implementation project(':common')

testImplementation platform('org.junit:junit-bom:5.10.0')
testImplementation 'org.junit.jupiter:junit-jupiter'

}

test {
useJUnitPlatform()
}
25 changes: 25 additions & 0 deletions api/src/main/java/org/yapp/ApiApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package org.yapp;

import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class ApiApplication {
private final TestBean testBean;

@Autowired
public ApiApplication(TestBean testBean) {
this.testBean = testBean;
}

@PostConstruct
public void dependencyTest() {
testBean.dependencyTest();
}

public static void main(String[] args) {
SpringApplication.run(ApiApplication.class, args);
}
}
6 changes: 6 additions & 0 deletions api/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
spring:
datasource:
url: jdbc:mysql://localhost:3306/dating-service-db
username: lujae
password: docker-mysql-user-pwd
driver-class-name: com.mysql.cj.jdbc.Driver
64 changes: 64 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.4.0'
id 'io.spring.dependency-management' version '1.1.6'
}

group = 'org.yapp'
version = '0.0.1-SNAPSHOT'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}


bootJar.enabled = false

repositories {
mavenCentral()
}

subprojects {
sourceCompatibility = '21'

apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

test {
useJUnitPlatform()
}
}

tasks.named('test') {
useJUnitPlatform()
}
22 changes: 22 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
plugins {
id 'java'
}

group = 'org.yapp'
version = '0.0.1-SNAPSHOT'

bootJar.enabled = false
jar.enabled = true

repositories {
mavenCentral()
}

dependencies {
testImplementation platform('org.junit:junit-bom:5.10.0')
testImplementation 'org.junit.jupiter:junit-jupiter'
}

test {
useJUnitPlatform()
}
10 changes: 10 additions & 0 deletions common/src/main/java/org/yapp/TestBean.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.yapp;

import org.springframework.stereotype.Component;

@Component
public class TestBean {
public void dependencyTest() {
System.out.println("common module loading success ");
}
}
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3.8'
services:
db:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
ports:
- "3306:3306"
volumes:
- mysql-data:/var/lib/mysql

volumes:
mysql-data:
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 8580c50

Please sign in to comment.