remove separate ui service, serve ui with backend
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 8s

This commit is contained in:
2025-07-18 01:54:26 +01:00
parent f9047644fe
commit e2c7faba5a
70 changed files with 153 additions and 11214 deletions

2
.env Normal file
View File

@ -0,0 +1,2 @@
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres

3
.gitignore vendored
View File

@ -1 +1,2 @@
.env target/
dist/

View File

View File

@ -1,8 +1,30 @@
run *ARGS: build run *ARGS: build
docker compose up {{ARGS}} ./target/debug/nuchat {{ARGS}}
stop: start: build
docker compose down ./target/debug/nuchat 2>&1 > target/debug/logs/nuchat.log &
build: build: build-cargo build-ui
build-cargo:
@mkdir -p target/debug/logs
@mkdir -p dist
cargo build
[working-directory: "ui"]
build-ui:
npm install
npm run build
test: integration unit
integration:
if [ ! $(curl -sf "localhost:7000/api/healthcheck" ) ]; then just run; fi
cargo test --test '*'
unit:
cargo test --lib --bins
docker *ARGS:
docker compose build docker compose build
docker compose up {{ARGS}}

8
Justfile.bak Normal file
View File

@ -0,0 +1,8 @@
run *ARGS: build
docker compose up {{ARGS}}
stop:
docker compose down
build:
docker compose build

2
backend/.gitignore vendored
View File

@ -1,2 +0,0 @@
target/
dist/

View File

@ -1,26 +0,0 @@
run *ARGS: build
./target/debug/nuchat {{ARGS}}
start: build
./target/debug/nuchat 2>&1 > target/debug/logs/nuchat.log &
build: build-cargo build-ui
build-cargo:
@mkdir -p target/debug/logs
@mkdir -p dist
cargo build
[working-directory: "ui"]
build-ui:
npm install
npm run build
test: integration unit
integration:
if [ ! $(curl -sf "localhost:7000/api/healthcheck" ) ]; then just run; fi
cargo test --test '*'
unit:
cargo test --lib --bins

33
backend/ui/.gitignore vendored
View File

@ -1,33 +0,0 @@
# 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/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
*.tsbuildinfo
logs/
tests_output/

View File

@ -1,61 +0,0 @@
# assets
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).
## 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 [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.
## Customize configuration
See [Vite Configuration Reference](https://vite.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
```
### Run Unit Tests with [Vitest](https://vitest.dev/)
```sh
npm run test:unit
```
### Run End-to-End Tests with [Nightwatch](https://nightwatchjs.org/)
```sh
# When using CI, the project must be built first.
npm run build
# Runs the end-to-end tests
npm run test:e2e
# Runs the tests only on Chrome
npm run test:e2e -- --env chrome
# Runs the tests of a specific file
npm run test:e2e -- tests/e2e/example.ts
# Runs the tests in debug mode
npm run test:e2e -- --debug
```
### Lint with [ESLint](https://eslint.org/)
```sh
npm run lint
```

View File

@ -1,49 +0,0 @@
{
"name": "assets",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "run-p type-check \"build-only {@}\" --",
"preview": "vite preview",
"test:unit": "vitest",
"test:e2e": "nightwatch tests/e2e/*",
"build-only": "vite build --outDir ../dist",
"type-check": "vue-tsc --build",
"lint": "eslint . --fix",
"format": "prettier --write src/"
},
"dependencies": {
"vue": "^3.5.17",
"vue-router": "^4.5.1"
},
"devDependencies": {
"@nightwatch/vue": "^3.1.2",
"@tsconfig/node22": "^22.0.2",
"@types/jsdom": "^21.1.7",
"@types/node": "^22.15.32",
"@vitejs/plugin-vue": "^6.0.0",
"@vitest/eslint-plugin": "^1.2.7",
"@vue/eslint-config-prettier": "^10.2.0",
"@vue/eslint-config-typescript": "^14.5.1",
"@vue/test-utils": "^2.4.6",
"@vue/tsconfig": "^0.7.0",
"chromedriver": "^137.0.4",
"eslint": "^9.29.0",
"eslint-plugin-vue": "~10.2.0",
"geckodriver": "^5.0.0",
"jiti": "^2.4.2",
"jsdom": "^26.1.0",
"nightwatch": "^3.12.2",
"npm-run-all2": "^8.0.4",
"prettier": "3.5.3",
"ts-node": "^10.9.2",
"typescript": "~5.8.0",
"vite": "^7.0.0",
"vite-plugin-nightwatch": "^0.4.6",
"vite-plugin-vue-devtools": "^7.7.7",
"vitest": "^3.2.4",
"vue-tsc": "^2.2.10"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -1,17 +0,0 @@
{
"files": [],
"references": [
{
"path": "./tsconfig.node.json"
},
{
"path": "./tsconfig.app.json"
},
{
"path": "./tsconfig.vitest.json"
},
{
"path": "./nightwatch/tsconfig.json"
}
]
}

View File

@ -1,19 +1,6 @@
services: services:
ui: server:
build: ./ui build: ./
ports:
- "3000:3000"
depends_on:
backend:
condition: service_started
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://0.0.0.0:3000"]
interval: 2s
retries: 3
timeout: 5s
backend:
build: ./backend
ports: ports:
- "7000:7000" - "7000:7000"
depends_on: depends_on:

View File

@ -1,4 +0,0 @@
.nuxt
.output
node_modules
README.md

45
ui/.gitignore vendored
View File

@ -1,24 +1,33 @@
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist
# Node dependencies
node_modules
# Logs # Logs
logs logs
*.log *.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
# Misc node_modules
.DS_Store .DS_Store
.fleet dist
.idea dist-ssr
coverage
*.local
# Local env files /cypress/videos/
.env /cypress/screenshots/
.env.*
!.env.example # Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
*.tsbuildinfo
logs/
tests_output/

View File

@ -1,33 +0,0 @@
FROM node:24-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
FROM base AS prod
WORKDIR /app
COPY pnpm-lock.yaml .
RUN pnpm fetch --prod
FROM base AS build
WORKDIR /app
COPY pnpm-lock.yaml .
COPY package.json .
RUN pnpm install
COPY . .
RUN pnpm run build
FROM base AS runner
WORKDIR /app
COPY --from=prod /app/node_modules /app/node_modules
COPY --from=build /app/.output ./
ENV PORT=3000
ENV NODE_ENV=production
EXPOSE $PORT
CMD ["node", "server/index.mjs"]

View File

@ -1,75 +1,61 @@
# Nuxt Minimal Starter # assets
Look at the [Nuxt documentation](https://nuxt.com/docs/getting-started/introduction) to learn more. This template should help get you started developing with Vue 3 in Vite.
## Setup ## Recommended IDE Setup
Make sure to install dependencies: [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
```bash ## Type Support for `.vue` Imports in TS
# npm
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 [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.
## Customize configuration
See [Vite Configuration Reference](https://vite.dev/config/).
## Project Setup
```sh
npm install npm install
# pnpm
pnpm install
# yarn
yarn install
# bun
bun install
``` ```
## Development Server ### Compile and Hot-Reload for Development
Start the development server on `http://localhost:3000`: ```sh
```bash
# npm
npm run dev npm run dev
# pnpm
pnpm dev
# yarn
yarn dev
# bun
bun run dev
``` ```
## Production ### Type-Check, Compile and Minify for Production
Build the application for production: ```sh
npm run build
```
```bash ### Run Unit Tests with [Vitest](https://vitest.dev/)
# npm
```sh
npm run test:unit
```
### Run End-to-End Tests with [Nightwatch](https://nightwatchjs.org/)
```sh
# When using CI, the project must be built first.
npm run build npm run build
# pnpm # Runs the end-to-end tests
pnpm build npm run test:e2e
# Runs the tests only on Chrome
# yarn npm run test:e2e -- --env chrome
yarn build # Runs the tests of a specific file
npm run test:e2e -- tests/e2e/example.ts
# bun # Runs the tests in debug mode
bun run build npm run test:e2e -- --debug
``` ```
### Lint with [ESLint](https://eslint.org/)
Locally preview production build: ```sh
npm run lint
```bash
# npm
npm run preview
# pnpm
pnpm preview
# yarn
yarn preview
# bun
bun run preview
``` ```
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.

View File

@ -1,6 +0,0 @@
<template>
<div>
<NuxtRouteAnnouncer />
<NuxtWelcome />
</div>
</template>

View File

View File

@ -1,6 +0,0 @@
// @ts-check
import withNuxt from './.nuxt/eslint.config.mjs'
export default withNuxt(
// Your custom configs here
)

View File

@ -1,12 +0,0 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2025-07-15',
devtools: { enabled: true },
modules: [
'@nuxt/eslint',
'@nuxt/image',
'@nuxt/test-utils',
'@nuxt/ui'
]
})

View File

@ -1,23 +1,49 @@
{ {
"name": "nuxt-app", "name": "assets",
"version": "0.0.0",
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
"build": "nuxt build", "dev": "vite",
"dev": "nuxt dev", "build": "run-p type-check \"build-only {@}\" --",
"generate": "nuxt generate", "preview": "vite preview",
"preview": "nuxt preview", "test:unit": "vitest",
"postinstall": "nuxt prepare" "test:e2e": "nightwatch tests/e2e/*",
"build-only": "vite build --outDir ../dist",
"type-check": "vue-tsc --build",
"lint": "eslint . --fix",
"format": "prettier --write src/"
}, },
"dependencies": { "dependencies": {
"@nuxt/eslint": "1.5.2",
"@nuxt/image": "1.10.0",
"@nuxt/test-utils": "3.19.2",
"@nuxt/ui": "3.2.0",
"eslint": "^9.31.0",
"nuxt": "^4.0.0",
"typescript": "^5.8.3",
"vue": "^3.5.17", "vue": "^3.5.17",
"vue-router": "^4.5.1" "vue-router": "^4.5.1"
},
"devDependencies": {
"@nightwatch/vue": "^3.1.2",
"@tsconfig/node22": "^22.0.2",
"@types/jsdom": "^21.1.7",
"@types/node": "^22.15.32",
"@vitejs/plugin-vue": "^6.0.0",
"@vitest/eslint-plugin": "^1.2.7",
"@vue/eslint-config-prettier": "^10.2.0",
"@vue/eslint-config-typescript": "^14.5.1",
"@vue/test-utils": "^2.4.6",
"@vue/tsconfig": "^0.7.0",
"chromedriver": "^137.0.4",
"eslint": "^9.29.0",
"eslint-plugin-vue": "~10.2.0",
"geckodriver": "^5.0.0",
"jiti": "^2.4.2",
"jsdom": "^26.1.0",
"nightwatch": "^3.12.2",
"npm-run-all2": "^8.0.4",
"prettier": "3.5.3",
"ts-node": "^10.9.2",
"typescript": "~5.8.0",
"vite": "^7.0.0",
"vite-plugin-nightwatch": "^0.4.6",
"vite-plugin-vue-devtools": "^7.7.7",
"vitest": "^3.2.4",
"vue-tsc": "^2.2.10"
} }
} }

10850
ui/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -1,2 +0,0 @@
User-Agent: *
Disallow:

View File

Before

Width:  |  Height:  |  Size: 276 B

After

Width:  |  Height:  |  Size: 276 B

View File

@ -1,18 +1,17 @@
{ {
// https://nuxt.com/docs/guide/concepts/typescript
"files": [], "files": [],
"references": [ "references": [
{ {
"path": "./.nuxt/tsconfig.app.json" "path": "./tsconfig.node.json"
}, },
{ {
"path": "./.nuxt/tsconfig.server.json" "path": "./tsconfig.app.json"
}, },
{ {
"path": "./.nuxt/tsconfig.shared.json" "path": "./tsconfig.vitest.json"
}, },
{ {
"path": "./.nuxt/tsconfig.node.json" "path": "./nightwatch/tsconfig.json"
} }
] ]
} }