Skip to content

Commit

Permalink
Convert to monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissearle committed Dec 20, 2024
1 parent 7306852 commit f04fd56
Show file tree
Hide file tree
Showing 72 changed files with 11,796 additions and 75 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Cupcake Backend

on:
push:
paths:
- backend/**

jobs:
push:
name: "Build Cupcake backend"
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '22'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build
run: ./gradlew :backend:clean :backend:build

# Insert docker build and push steps here

- name: Generate summary
run: |
echo "Tag: ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
- name: Upload reports if failed
if: failure()
uses: actions/upload-artifact@v4
with:
name: search-reports
path: |
**/build/reports/
**/build/test-results/
- name: Upload coverage if passed
if: success()
uses: actions/upload-artifact@v4
with:
name: search-coverage
path: |
**/build/reports/jacoco/
21 changes: 21 additions & 0 deletions .github/workflows/frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Frosting Frontend

on:
push:
paths:
- frontend/**

jobs:
push:
name: "Build search frontend"
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

# Insert docker build and push steps here - this actually builds the app inside docker

- name: Generate summary
run: |
echo "Tag: ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
15 changes: 0 additions & 15 deletions .github/workflows/test.yaml

This file was deleted.

File renamed without changes.
62 changes: 62 additions & 0 deletions backend/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.ktor)
alias(libs.plugins.kotlinter)
alias(libs.plugins.detekt)
alias(libs.plugins.versions)
alias(libs.plugins.serialization)

jacoco
}

group = "no.java.cupcake"
version = "0.0.1"

kotlin {
jvmToolchain(22)
}

application {
mainClass.set("no.java.cupcake.ApplicationKt")

val isDevelopment: Boolean = project.ext.has("development")
applicationDefaultJvmArgs = listOf("-Dio.ktor.development=$isDevelopment")
}

repositories {
mavenCentral()
}

dependencies {
implementation(libs.bundles.ktor.server)
implementation(libs.bundles.ktor.client)

implementation(libs.cache4k)
implementation(libs.kotlinx.coroutines.core)

implementation(libs.logback.classic)
implementation(libs.kotlin.logging)
implementation(libs.micrometer.registry.prometheus)

testImplementation(libs.bundles.test)
}

tasks.shadowJar {
archiveFileName.set("cupcake.jar")
}

tasks.jar {
enabled = false
}

tasks.withType<Test>().configureEach {
useJUnitPlatform()
}

tasks.test {
finalizedBy(tasks.jacocoTestReport)
}

tasks.jacocoTestReport {
dependsOn(tasks.test)
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
59 changes: 0 additions & 59 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,62 +1,3 @@
plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.ktor)
alias(libs.plugins.kotlinter)
alias(libs.plugins.detekt)
alias(libs.plugins.versions)
alias(libs.plugins.serialization)

jacoco
}

group = "no.java.cupcake"
version = "0.0.1"

kotlin {
jvmToolchain(22)
}

application {
mainClass.set("no.java.cupcake.ApplicationKt")

val isDevelopment: Boolean = project.ext.has("development")
applicationDefaultJvmArgs = listOf("-Dio.ktor.development=$isDevelopment")
}

repositories {
mavenCentral()
}

dependencies {
implementation(libs.bundles.ktor.server)
implementation(libs.bundles.ktor.client)

implementation(libs.cache4k)
implementation(libs.kotlinx.coroutines.core)

implementation(libs.logback.classic)
implementation(libs.kotlin.logging)
implementation(libs.micrometer.registry.prometheus)

testImplementation(libs.bundles.test)
}

tasks.shadowJar {
archiveFileName.set("cupcake.jar")
}

tasks.jar {
enabled = false
}

tasks.withType<Test>().configureEach {
useJUnitPlatform()
}

tasks.test {
finalizedBy(tasks.jacocoTestReport)
}

tasks.jacocoTestReport {
dependsOn(tasks.test)
}
24 changes: 24 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist

# Node dependencies
node_modules

# Logs
logs
*.log

# Misc
.DS_Store
.fleet
.idea

# Local env files
.env
.env.*
!.env.example
13 changes: 13 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:22-alpine AS build

WORKDIR /app
COPY . .
RUN npm install
RUN npm run build

FROM node:22-alpine AS deploy

WORKDIR /app
COPY --from=build /app/.output/ /app
CMD ["node", "/app/server/index.mjs"]

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

A frontend for [cupcake](https://github.com/javaBin/cupcake)

## TODO

Always lots to do - but - before we can release this:

* Require authentication - the backend needs to implement authentication/authorization.
* Some tests would be nice :)

## Build

Nuxt application using npm

npm install

## Local running

npm run dev

## Preview build

npm build
npm preview

## Deploy

docker build -t frosting:latest .
7 changes: 7 additions & 0 deletions frontend/app/app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
<v-app>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</v-app>
</template>
Loading

0 comments on commit f04fd56

Please sign in to comment.