Skip to content

Commit

Permalink
Implement Flunder frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
Menkalian committed Feb 15, 2023
1 parent 0b8ef31 commit ed1bb7f
Show file tree
Hide file tree
Showing 123 changed files with 3,656 additions and 89 deletions.
44 changes: 34 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

plugins {
// Spring
id("org.springframework.boot") version "2.5.3"
id("io.spring.dependency-management") version "1.0.11.RELEASE"
id("org.springframework.boot") version "3.0.2"
id("io.spring.dependency-management") version "1.1.0"

// Languages
kotlin("jvm") version "1.5.21"
kotlin("plugin.spring") version "1.5.21"
kotlin("plugin.jpa") version "1.5.21"
kotlin("jvm") version "1.8.0"
kotlin("plugin.spring") version "1.8.0"
kotlin("plugin.jpa") version "1.8.0"
java

// Gradle utilities
id("org.jetbrains.dokka") version "1.5.0"
id("org.jetbrains.dokka") version "1.7.20"
jacoco
`maven-publish`

Expand All @@ -23,24 +23,43 @@ plugins {
}

group = "de.menkalian.pisces"
version = "5.4.0"
version = "5.5.0"

// Compilation and generation settings
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

sourceSets.get("main").resources {
srcDir(File(buildDir, "external/resources"))
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict", "-Xopt-in=kotlin.RequiresOptIn")
jvmTarget = "11"
jvmTarget = "17"
}
}

tasks.getByName("kotlinSourcesJar") {
dependsOn(tasks.generateBuildConfig)
dependsOn(tasks.generateKeyObjects)
dependsOn(tasks.generateFeaturetoggleCode)
}

rootProject.project("frontend").afterEvaluate {
val flunder = rootProject
val frontend = this
flunder.tasks.create("copyFrontend", Copy::class.java) {
from(frontend.file("dist"))
destinationDir = File(flunder.buildDir, "external/resources/static").apply { mkdirs() }

dependsOn(frontend.tasks.getByName("npm_run_build"))
flunder.tasks.getByName("processResources").dependsOn(this)
}
}

tasks.bootJar.configure {
archiveClassifier.set("boot")
}
Expand All @@ -49,6 +68,7 @@ keygen {
targetPackage = "de.menkalian.pisces.variables"
finalLayerAsString = true
}

featuretoggle {
targetPackage = "de.menkalian.pisces.config"
}
Expand All @@ -65,6 +85,7 @@ repositories {
setUrl("https://artifactory.menkalian.de/artifactory/menkalian")
}
}

publishing {
repositories {
maven {
Expand All @@ -88,6 +109,9 @@ dependencies {
// Spring
val springboot = { module: String -> "org.springframework.boot:spring-boot-starter-$module" }
implementation(springboot("web"))
implementation(springboot("websocket"))
implementation(springboot("security"))
implementation(springboot("oauth2-client"))
implementation(springboot("actuator"))
implementation(springboot("data-jpa"))

Expand Down
31 changes: 31 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

package-lock.json
build

40 changes: 40 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# frontend

This template should help get you started developing with Vue 3 in Vite.

## Recommended IDE Setup

[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).

## Type Support for `.vue` Imports in TS

TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:

1. Disable the built-in TypeScript Extension
1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.

## Customize configuration

See [Vite Configuration Reference](https://vitejs.dev/config/).

## Project Setup

```sh
npm install
```

### Compile and Hot-Reload for Development

```sh
npm run dev
```

### Type-Check, Compile and Minify for Production

```sh
npm run build
```
3 changes: 3 additions & 0 deletions frontend/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins {
id("com.github.node-gradle.node") version "3.5.1"
}
1 change: 1 addition & 0 deletions frontend/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
14 changes: 14 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DJ Flunder Web 🌐</title>
</head>
<body>
<div id="app"></div>
<script>global = globalThis</script>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
34 changes: 34 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "frontend",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite",
"build": "run-p type-check build-only",
"preview": "vite preview",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit"
},
"dependencies": {
"@types/sockjs-client": "^1.5.1",
"@types/stompjs": "^2.3.5",
"axios": "^1.2.3",
"mitt": "^3.0.0",
"sockjs-client": "^1.6.1",
"vue": "^3.2.45",
"vue-axios": "^3.5.2",
"vue-router": "^4.1.6",
"vue-toastification": "^2.0.0-rc.5",
"vue3-cookies": "^1.0.6",
"webstomp-client": "^1.2.6"
},
"devDependencies": {
"@types/node": "^18.11.12",
"@vitejs/plugin-vue": "^4.0.0",
"@vue/tsconfig": "^0.1.3",
"npm-run-all": "^4.1.5",
"typescript": "~4.7.4",
"vite": "^4.0.0",
"vue-tsc": "^1.0.12"
}
}
Binary file added frontend/public/favicon.ico
Binary file not shown.
Loading

0 comments on commit ed1bb7f

Please sign in to comment.