Skip to content

Commit

Permalink
Add DMS UI (#20)
Browse files Browse the repository at this point in the history
* Add UI

* Fix UI

* DMS Service and DMS UI with own root redirects

* Remove npmWorkDir

* Update server/build.gradle.kts

* Migrate to rest/api/3 controllers

* Fix to rest/api/3 requests

* Fix to rest/api/3 requests

* Fix to rest/api/3 requests

* Fix dev run configurations

* Add actuator/info fetching

* Remove version.json

* Fix README.md

* Reformat code, rearrange imports

* Fix small issues
  • Loading branch information
aryabokon committed Jun 21, 2024
1 parent 7416f31 commit 93cd9ac
Show file tree
Hide file tree
Showing 60 changed files with 32,851 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ out/
build
test_db.mv.db
.env
**/resources/public
**/node_modules
37 changes: 37 additions & 0 deletions .run/DmsService (bootRun, frontend live reload).run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="DmsService (bootRun, frontend live reload)" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/server" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="bootRun" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<EXTENSION ID="com.intellij.execution.ExternalSystemRunConfigurationJavaExtension">
<extension name="net.ashald.envfile">
<option name="IS_ENABLED" value="true" />
<option name="IS_SUBST" value="true" />
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
<option name="IS_IGNORE_MISSING_FILES" value="false" />
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="true" />
<ENTRIES>
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
<ENTRY IS_ENABLED="true" PARSER="env" IS_EXECUTABLE="false" PATH="$USER_HOME$/dev.env" />
</ENTRIES>
</extension>
</EXTENSION>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="DmsServiceApplication (dev)" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<configuration default="false" name="DmsService (dev)" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<option name="ACTIVE_PROFILES" value="dev" />
<additionalParameters>
<param>
Expand Down
13 changes: 13 additions & 0 deletions .run/Frontend (dev).run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Frontend (dev)" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/server/package.json" />
<command value="run" />
<scripts>
<script value="dev" />
</scripts>
<node-interpreter value="project" />
<package-manager value="npm" />
<envs />
<method v="2" />
</configuration>
</component>
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,9 @@
* Execute `chmod -R 777` for `test-common/src/main/artifactory/dump`
* Remove old dump from `test-common/src/main/artifactory/dump`
* Run `:dms-service:composeDown` gradle task

## Frontend development
start `DmsService (bootRun, frontend live reload)` run configuration, wait for start app completely\
start `Frontend (dev)` run configuration \
`Frontend (dev)` profile uses `--watch` flag in package.json which enables watching of changes in frontend source code
After frontend is rebuilt, refresh web page and test you changes
2 changes: 1 addition & 1 deletion ft/src/ft/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ services:

api-gateway:
container_name: dms-ft-api-gateway
image: ${OCTOPUS_GITHUB_DOCKER_REGISTRY}/octopusden/api-gateway:2.0.1
image: ${OCTOPUS_GITHUB_DOCKER_REGISTRY}/octopusden/api-gateway:2.0.9
ports:
- "8765:8765"
volumes:
Expand Down
3 changes: 3 additions & 0 deletions server/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["react", "env", "stage-0"]
}
3 changes: 3 additions & 0 deletions server/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "standard"
}
25 changes: 25 additions & 0 deletions server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ plugins {
id("org.jetbrains.kotlin.plugin.noarg")
id("com.bmuschko.docker-spring-boot-application") version "6.4.0"
id("com.avast.gradle.docker-compose") version "0.14.3"
id("com.github.node-gradle.node") version "7.0.2"
`maven-publish`
}

Expand Down Expand Up @@ -118,6 +119,30 @@ tasks.named("dockerBuildImage") {
dependsOn("test")
}

val npmBuild = tasks.register<com.github.gradle.node.npm.task.NpmTask>("npmBuild") {
dependsOn("npmInstall")
npmCommand.set(listOf("run", "build"))
}

tasks.withType<ProcessResources> {
dependsOn(npmBuild)
}

node {
version.set("16.20.2")
download.set(true)
npmVersion.set("8.19.4")
}

tasks.getByName<Delete>("clean") {
this.delete.add("$projectDir/node_modules")
}

tasks.named<org.springframework.boot.gradle.tasks.run.BootRun>("bootRun") {
args("--spring.cloud.config.enabled=false", "--spring.profiles.active=dev", "--spring.config.additional-location=dev/")
sourceResources(sourceSets.main.get())
}

dependencies {
implementation(project(":common"))
implementation("org.springframework.boot:spring-boot-starter-web")
Expand Down
12 changes: 12 additions & 0 deletions server/dev/api-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ spring:
- Path=/dms-service/**
filters:
- StripPrefix=1
- id: dms-ui-redirect
uri: no://op
predicates:
- Path=/dms-ui
filters:
- RedirectTo=302, /dms-ui/index.html, true
- id: dms-ui
uri: http://host.docker.internal:8080
predicates:
- Path=/dms-ui/**
filters:
- StripPrefix=1
security:
oauth2:
client:
Expand Down
9 changes: 7 additions & 2 deletions server/dev/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@ auth-server:
storage:
maven-group-prefix: corp.domain.dms
artifactory:
host: http://localhost:8081
host: http://localhost:18081
user: admin
password: password
upload-repositories:
MAVEN: example-repo-local

dms-service:
webhook:
url: http://localhost:1080/webhook

components-registry-service:
url: # set via env

Expand Down Expand Up @@ -89,7 +93,8 @@ management:

logging.level:
ROOT: INFO
org.springframework.security: DEBUG
org.octopusden.octopus.platform.commons.http.client: ERROR
org.octopusden.cloud.commons.security: TRACE
org.octopusden.octopus.dms.security: TRACE
org.octopusden.octopus.dms: DEBUG
org.octopusden.octopus.dms: DEBUG
4 changes: 3 additions & 1 deletion server/dev/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:

api-gateway:
container_name: dms-dev-api-gateway
image: ${OCTOPUS_GITHUB_DOCKER_REGISTRY}/octopusden/api-gateway:2.0.1
image: ${OCTOPUS_GITHUB_DOCKER_REGISTRY}/octopusden/api-gateway:2.0.9
ports:
- 8765:8765
volumes:
Expand All @@ -46,3 +46,5 @@ services:
- AUTH_SERVER_REALM=${AUTH_SERVER_REALM}
- AUTH_SERVER_CLIENT_ID=${AUTH_SERVER_CLIENT_ID}
- AUTH_SERVER_CLIENT_SECRET=${AUTH_SERVER_CLIENT_SECRET}
extra_hosts:
- "host.docker.internal:host-gateway"
Loading

0 comments on commit 93cd9ac

Please sign in to comment.