Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
59 changes: 0 additions & 59 deletions backend/api_gateway/build.gradle

This file was deleted.

41 changes: 41 additions & 0 deletions backend/api_gateway/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("org.springframework.boot")
id("io.spring.dependency-management")
kotlin("jvm")
kotlin("plugin.spring")
kotlin("plugin.jpa")
}

group = "com.linkedout"
version = "1.0.0-SNAPSHOT"

java {
sourceCompatibility = JavaVersion.VERSION_17
}

repositories {
mavenCentral()
}

dependencies {
implementation("org.springframework.boot:spring-boot-starter-actuator:3.1.5")
implementation("org.springframework.boot:spring-boot-starter-oauth2-resource-server:3.1.5")
implementation("org.springframework.boot:spring-boot-starter-security:3.1.5")
implementation("org.springframework.boot:spring-boot-starter-validation:3.1.5")
implementation("org.springframework.boot:spring-boot-starter-web:3.1.5")
developmentOnly("org.springframework.boot:spring-boot-devtools")
testImplementation("org.springframework.boot:spring-boot-starter-test")
}

tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs += "-Xjsr305=strict"
jvmTarget = "17"
}
}

tasks.withType<Test> {
useJUnitPlatform()
}
4 changes: 0 additions & 4 deletions backend/api_gateway/settings.gradle

This file was deleted.

2 changes: 2 additions & 0 deletions backend/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
kotlin.code.style=official
#org.gradle.warning.mode=all
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
File renamed without changes.
File renamed without changes.
47 changes: 47 additions & 0 deletions backend/jobs/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("org.springframework.boot")
id("io.spring.dependency-management")
kotlin("jvm")
kotlin("plugin.spring")
kotlin("plugin.jpa")
}

group = "com.linkedout"
version = "1.0.0-SNAPSHOT"

java {
sourceCompatibility = JavaVersion.VERSION_17
}

repositories {
mavenCentral()
}

dependencies {
implementation("org.springframework.boot:spring-boot-starter-actuator:3.1.5")
implementation("org.springframework.boot:spring-boot-starter-data-r2dbc:3.1.5")
implementation("org.springframework.boot:spring-boot-starter-validation:3.1.5")
implementation("org.springframework.boot:spring-boot-starter-webflux:3.1.5")
implementation("org.springframework.boot:spring-boot-starter-web:3.1.5")
implementation("org.springframework:spring-jdbc:6.0.13")
implementation("org.flywaydb:flyway-core:9.22.3")
implementation("org.postgresql:r2dbc-postgresql:1.0.2.RELEASE")
implementation("jakarta.validation:jakarta.validation-api:3.0.2")
implementation("org.jetbrains.kotlin:kotlin-reflect:1.9.20")
developmentOnly("org.springframework.boot:spring-boot-devtools")
runtimeOnly("org.postgresql:postgresql")
testImplementation("org.springframework.boot:spring-boot-starter-test")
}

tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs += "-Xjsr305=strict"
jvmTarget = "17"
}
}

tasks.withType<Test> {
useJUnitPlatform()
}
15 changes: 15 additions & 0 deletions backend/jobs/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
services:
postgresql:
image: bitnami/postgresql:15
ports:
- 5432:5432
environment:
- POSTGRESQL_PASSWORD=job
- POSTGRESQL_USERNAME=job
- POSTGRESQL_DATABASE=job
volumes:
- "postgresql_data:/bitnami/postgresql"

volumes:
postgresql_data:

11 changes: 11 additions & 0 deletions backend/jobs/src/main/kotlin/com/linkedout/jobs/JobsApplication.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.linkedout.jobs

import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication

@SpringBootApplication
class JobsApplication

fun main(args: Array<String>) {
runApplication<JobsApplication>(*args)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.linkedout.jobs.controller
import com.linkedout.jobs.model.Job
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import com.linkedout.jobs.service.JobService
import reactor.core.publisher.Flux

@RestController
@RequestMapping("/jobs")
class JobsController(private val jobService: JobService) {
@GetMapping
fun getJobs(): Flux<Job>{
return jobService.findAll()
}
}
14 changes: 14 additions & 0 deletions backend/jobs/src/main/kotlin/com/linkedout/jobs/model/Job.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.linkedout.jobs.model

import org.springframework.data.annotation.Id
import org.springframework.data.relational.core.mapping.Column
import org.springframework.data.relational.core.mapping.Table
import java.util.UUID

@Table(name = "job")
data class Job(
@Id
val id: UUID,
val title: String,
val category: UUID
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.linkedout.jobs.model

import org.springframework.data.annotation.Id
import org.springframework.data.relational.core.mapping.Column
import org.springframework.data.relational.core.mapping.Table
import java.util.UUID

@Table(name = "jobCategory")
data class JobCategory(
@Id
@Column("category_id")
val id: UUID,
val title: String,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.linkedout.jobs.repository
import com.linkedout.jobs.model.Job
import org.springframework.data.repository.reactive.ReactiveCrudRepository;
import java.util.UUID

interface JobRepository : ReactiveCrudRepository<Job, UUID>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.linkedout.jobs.service

import com.linkedout.jobs.model.Job
import com.linkedout.jobs.repository.JobRepository
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service
import reactor.core.publisher.Flux

@Service
class JobService(@Autowired private val jobRepository: JobRepository) {
fun findAll(): Flux<Job>{
return jobRepository.findAll()
}
}
13 changes: 13 additions & 0 deletions backend/jobs/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
spring:
r2dbc:
url: r2dbc:postgresql://localhost:5432
username: job
password: job

flyway:
url: jdbc:postgresql://localhost:5432/job
user: job
password: job

server:
port: 8081
Loading