feat: initialize Gradle multi-module backend and Vite frontend

This commit is contained in:
2026-08-06 17:17:44 +08:00
commit 2cf32d0768
52 changed files with 2970 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>IM 聊天</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
+24
View File
@@ -0,0 +1,24 @@
{
"name": "@im-system/app",
"private": true,
"version": "0.1.0",
"license": "MIT",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc -b && vite build",
"preview": "vite preview",
"type-check": "vue-tsc --noEmit"
},
"dependencies": {
"@vitejs/plugin-vue": "^6.0.8",
"pinia": "^4.0.2",
"vue": "^3.5.41",
"vue-router": "^5.2.0"
},
"devDependencies": {
"typescript": "^7.0.2",
"vite": "^8.2.0",
"vue-tsc": "^3.3.9"
}
}
+47
View File
@@ -0,0 +1,47 @@
<script setup lang="ts">
const online = ref(true)
</script>
<template>
<main class="shell">
<header class="topbar">
<span class="status-dot" :class="{ offline: !online }" />
<h1>IM 聊天</h1>
</header>
<section class="content">
<p>前端骨架就绪Vue 3 + TypeScript + Vite可无缝迁移至 Tauri</p>
</section>
</main>
</template>
<style scoped>
.shell {
display: flex;
flex-direction: column;
height: 100vh;
}
.topbar {
display: flex;
align-items: center;
gap: 8px;
padding: 12px 16px;
border-bottom: 1px solid #e5e7eb;
}
.status-dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: #22c55e;
}
.status-dot.offline {
background: #9ca3af;
}
.content {
flex: 1;
padding: 16px;
}
</style>
+8
View File
@@ -0,0 +1,8 @@
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
const app = createApp(App)
app.use(createPinia())
app.mount('#app')
+7
View File
@@ -0,0 +1,7 @@
/// <reference types="vite/client" />
declare module '*.vue' {
import type { DefineComponent } from 'vue'
const component: DefineComponent<Record<string, never>, Record<string, never>, unknown>
export default component
}
+29
View File
@@ -0,0 +1,29 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"target": "ES2022",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "preserve",
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
}
+7
View File
@@ -0,0 +1,7 @@
{
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
}
+22
View File
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"target": "ES2022",
"lib": ["ES2023"],
"module": "ESNext",
"skipLibCheck": true,
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"noEmit": true,
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["vite.config.ts"]
}
+17
View File
@@ -0,0 +1,17 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// 同时用于浏览器与 TauriTauri 会在 dev/build 时注入 TAURI_ENV_* 环境变量)
export default defineConfig({
plugins: [vue()],
// Tauri 期望静态资源走相对路径,且必须设置固定端口供其内嵌 WebView 使用
clearScreen: false,
server: {
port: 1420,
strictPort: true,
watch: {
ignored: ['**/src-tauri/**']
}
},
envPrefix: ['VITE_', 'TAURI_ENV_']
})