From 81ff035ee0143e3e133ee2323349fb34bb523f8c Mon Sep 17 00:00:00 2001 From: pratyush Date: Fri, 3 Apr 2026 10:47:11 +0000 Subject: [PATCH 1/9] Initial commit --- .gitlab-ci.yml | 89 + .idea/compiler.xml | 25 + .idea/dataSources/data_sources_history.xml | 119 + .idea/encodings.xml | 6 + .idea/jarRepositories.xml | 20 + .idea/misc.xml | 13 + .idea/vcs.xml | 6 + .idea/workspace.xml | 180 + Dockerfile | 6 + README.md | 93 + banguardian-server/.gitattributes | 2 + banguardian-server/.gitignore | 33 + .../.mvn/wrapper/maven-wrapper.properties | 3 + banguardian-server/mvnw | 295 ++ banguardian-server/mvnw.cmd | 189 ++ banguardian-server/pom.xml | 109 + .../banguardian/BanguardianApplication.java | 13 + .../api/routes/TestController.java | 12 + .../src/main/resources/application.yaml | 16 + .../BanguardianApplicationTests.java | 13 + banguardian-ui/.gitignore | 24 + banguardian-ui/README.md | 73 + banguardian-ui/eslint.config.js | 23 + banguardian-ui/index.html | 13 + banguardian-ui/package-lock.json | 2981 +++++++++++++++++ banguardian-ui/package.json | 30 + banguardian-ui/public/favicon.svg | 1 + banguardian-ui/public/icons.svg | 24 + banguardian-ui/src/App.css | 184 + banguardian-ui/src/App.tsx | 121 + banguardian-ui/src/assets/hero.png | Bin 0 -> 44919 bytes banguardian-ui/src/assets/react.svg | 1 + banguardian-ui/src/assets/vite.svg | 1 + banguardian-ui/src/index.css | 111 + banguardian-ui/src/main.tsx | 10 + banguardian-ui/tsconfig.app.json | 28 + banguardian-ui/tsconfig.json | 7 + banguardian-ui/tsconfig.node.json | 26 + banguardian-ui/vite.config.ts | 7 + k3s/deployment.yaml | 83 + 40 files changed, 4990 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 .idea/compiler.xml create mode 100644 .idea/dataSources/data_sources_history.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/jarRepositories.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 banguardian-server/.gitattributes create mode 100644 banguardian-server/.gitignore create mode 100644 banguardian-server/.mvn/wrapper/maven-wrapper.properties create mode 100755 banguardian-server/mvnw create mode 100644 banguardian-server/mvnw.cmd create mode 100644 banguardian-server/pom.xml create mode 100644 banguardian-server/src/main/java/pkay/xyz/banguardian/BanguardianApplication.java create mode 100644 banguardian-server/src/main/java/pkay/xyz/banguardian/api/routes/TestController.java create mode 100644 banguardian-server/src/main/resources/application.yaml create mode 100644 banguardian-server/src/test/java/pkay/xyz/banguardian/BanguardianApplicationTests.java create mode 100644 banguardian-ui/.gitignore create mode 100644 banguardian-ui/README.md create mode 100644 banguardian-ui/eslint.config.js create mode 100644 banguardian-ui/index.html create mode 100644 banguardian-ui/package-lock.json create mode 100644 banguardian-ui/package.json create mode 100644 banguardian-ui/public/favicon.svg create mode 100644 banguardian-ui/public/icons.svg create mode 100644 banguardian-ui/src/App.css create mode 100644 banguardian-ui/src/App.tsx create mode 100644 banguardian-ui/src/assets/hero.png create mode 100644 banguardian-ui/src/assets/react.svg create mode 100644 banguardian-ui/src/assets/vite.svg create mode 100644 banguardian-ui/src/index.css create mode 100644 banguardian-ui/src/main.tsx create mode 100644 banguardian-ui/tsconfig.app.json create mode 100644 banguardian-ui/tsconfig.json create mode 100644 banguardian-ui/tsconfig.node.json create mode 100644 banguardian-ui/vite.config.ts create mode 100644 k3s/deployment.yaml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..9603ac2 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,89 @@ +stages: + - build-ui + - build-server + - package + - deploy-dev + - deploy-prod + +variables: + DOCKER_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA + # Replace 'path/to/project:agent-name' with your actual agent's path and name + KUBE_CONTEXT: "my-group/banguardian-project:my-k3s-agent" + +# 1. Build React UI +build-ui: + stage: build-ui + image: node:25-alpine + script: + - cd banguardian-ui + - npm install + - npm run build + artifacts: + paths: + - banguardian-ui/dist/ + expire_in: 1 hour + +# 2. Build Spring Boot (Bundling the UI) +build-server: + stage: build-server + image: eclipse-temurin:21-jdk-alpine + needs: + - build-ui + script: + - mkdir -p banguardian-server/src/main/resources/static + - cp -r banguardian-ui/dist/* banguardian-server/src/main/resources/static/ + - cd banguardian-server + - ./mvnw clean package -DskipTests + artifacts: + paths: + - banguardian-server/target/*.jar + expire_in: 1 hour + +# 3. Build & Push Docker Image +build-docker: + stage: package + image: docker:24.0.5 + services: + - docker:24.0.5-dind + before_script: + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + script: + - docker build -t $DOCKER_IMAGE . + - docker push $DOCKER_IMAGE + only: + - main + +# Deployment Template +.deploy_template: + image: + name: alpine/k8s:1.28.3 # Includes kubectl and envsubst + before_script: + - kubectl config use-context $KUBE_CONTEXT + script: + # Safely inject the image tag and apply to the specific namespace + - envsubst < k3s/deployment.yaml | kubectl apply -n $K8S_NAMESPACE -f - + +# 4. Deploy to Development (Automatic) +deploy-dev: + extends: .deploy_template + stage: deploy-dev + variables: + K8S_NAMESPACE: banguardian-dev + environment: + name: development + needs: + - job: build-docker + +# 5. Deploy to Production (Manual Approval) +deploy-prod: + extends: .deploy_template + stage: deploy-prod + variables: + K8S_NAMESPACE: banguardian-prod + environment: + name: production + when: manual + only: + - main + needs: + - job: deploy-dev diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..7ee9818 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/dataSources/data_sources_history.xml b/.idea/dataSources/data_sources_history.xml new file mode 100644 index 0000000..09de4bb --- /dev/null +++ b/.idea/dataSources/data_sources_history.xml @@ -0,0 +1,119 @@ + + + + + mariadb + true + true + org.mariadb.jdbc.Driver + jdbc:mariadb://192.168.1.206:3306/banguard + banguardianu1 + + $ProjectFileDir$ + + + + + + mariadb + true + true + org.mariadb.jdbc.Driver + jdbc:mariadb://192.168.1.206:3306/banguard + c10_banguard + + $ProjectFileDir$ + + + + + + mariadb + true + true + org.mariadb.jdbc.Driver + jdbc:mariadb://192.168.1.206:3306/c10_banguard + c10_banguard + + $ProjectFileDir$ + + + + + + mariadb + true + true + org.mariadb.jdbc.Driver + jdbc:mariadb://192.168.1.206:3306/c10_banguard + c10_banguard + + $ProjectFileDir$ + + + + + + mariadb + true + true + org.mariadb.jdbc.Driver + jdbc:mariadb://192.168.1.206:3306/c10_banguard + c10_banguard + + $ProjectFileDir$ + + + + + + mariadb + true + true + org.mariadb.jdbc.Driver + jdbc:mariadb://192.168.1.206:3306/c10_banguard + c10_banguard + + $ProjectFileDir$ + + + + + + #@ + ` + + + mariadb + true + org.mariadb.jdbc.Driver + jdbc:mariadb://192.168.1.206:3306/c10_banguard + + + + + + master_key + c10_banguard + + + + + + $ProjectFileDir$ + + + + + + mariadb + true + true + org.mariadb.jdbc.Driver + jdbc:mariadb://192.168.1.206:3306/c10_banguard + c10_banguard + + $ProjectFileDir$ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..d5f2fbd --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..712ab9d --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..1b30ca8 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,13 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..9853d8e --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + { + "lastFilter": { + "state": "OPENED", + "assignee": { + "type": "org.jetbrains.plugins.gitlab.mergerequest.ui.filters.GitLabMergeRequestsFiltersValue.MergeRequestsMemberFilterValue.MergeRequestsAssigneeFilterValue", + "username": "pratyush", + "fullname": "pratyush" + } + } +} + { + "selectedUrlAndAccountId": { + "first": "https://gitlab.erpratyush.me/pratyush/ban-guardian.git", + "second": "db76e022-5ac0-4e45-8fdd-277752c65b15" + } +} + {} + { + "isMigrated": true +} + + + + + + + + { + "associatedIndex": 0, + "fromUser": false +} + + + + + + + { + "keyToString": { + "ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true", + "Maven.banguardian [clean].executor": "Run", + "ModuleVcsDetector.initialDetectionPerformed": "true", + "RequestMappingsPanelOrder0": "0", + "RequestMappingsPanelOrder1": "1", + "RequestMappingsPanelWidth0": "75", + "RequestMappingsPanelWidth1": "75", + "RunOnceActivity.MCP Project settings loaded": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true", + "RunOnceActivity.git.unshallow": "true", + "RunOnceActivity.typescript.service.memoryLimit.init": "true", + "Spring Boot.BanguardianApplication.executor": "Debug", + "codeWithMe.voiceChat.enabledByDefault": "false", + "com.intellij.ml.llm.matterhorn.ej.ui.settings.DefaultModelSelectionForGA.v1": "true", + "git.auto.fetch.suggestion.counter": "3", + "kotlin-language-version-configured": "true", + "last_opened_file_path": "/projects/ban-guardian/banguardian-server/.mvn/wrapper", + "node.js.detected.package.eslint": "true", + "node.js.detected.package.tslint": "true", + "node.js.selected.package.eslint": "(autodetect)", + "node.js.selected.package.tslint": "(autodetect)", + "nodejs_package_manager_path": "npm", + "project.structure.last.edited": "Modules", + "project.structure.proportion": "0.0", + "project.structure.side.proportion": "0.2", + "to.speed.mode.migration.done": "true", + "vue.rearranger.settings.migration": "true" + }, + "keyToStringList": { + "DatabaseDriversLRU": [ + "mariadb" + ] + } +} + + + + + + + + + + + + + + + + + 1775162724013 + + + + + + + + + + + + + + + -- GitLab From bdbf1a0febf3e6e9ef8187f7258295631eb3f94a Mon Sep 17 00:00:00 2001 From: pratyush Date: Fri, 3 Apr 2026 11:11:34 +0000 Subject: [PATCH 3/9] Remove branch restriction for Docker build and push job in `.gitlab-ci.yml`. --- .gitlab-ci.yml | 3 +-- .idea/workspace.xml | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dfaebbb..05194bd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,8 +51,7 @@ build-docker: script: - docker build -t $DOCKER_IMAGE . - docker push $DOCKER_IMAGE - only: - - main + # Deployment Template .deploy_template: diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 21a706a..63417b9 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,10 +4,8 @@ - + - - @@ -173,6 +179,10 @@ + + +