build(frontend): szkielet projektu Vue 3 + TypeScript + Vite
Panel przestaje być zestawem plików statycznych serwowanych przez backend i staje się osobnym projektem w katalogu frontend/. - Vue 3 z Composition API jako framework - szablony komponentów są bliskie dotychczasowemu HTML-owi, więc migracja nie wymaga przepisywania widoków na inny model mentalny. - TypeScript w trybie strict; kontrakt danych z API będzie opisany typami. - Vite jako bundler, z aliasem @ na src/ i budowaniem do dist/. - Serwer deweloperski przekierowuje /api i /ws na backend; adres można nadpisać zmienną VITE_BACKEND_URL. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
edf317d21e
commit
ab3c980597
6 files changed
+1775
No files matched your search
@@ -0,0 +1,2 @@
|
||||
node_modules/
|
||||
*.tsbuildinfo
|
||||
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="pl">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>ŻyrarBOT - Dashboard Kolejki</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
Generated
+1684
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "zyrarbot-panel",
|
||||
"version": "2.0.0",
|
||||
"private": true,
|
||||
"description": "Panel webowy ŻyrarBOT-a",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vue-tsc --noEmit && vite build",
|
||||
"preview": "vite preview",
|
||||
"typecheck": "vue-tsc --noEmit",
|
||||
"smoke": "node smoke-test.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"lucide-vue-next": "^1.0.0",
|
||||
"vue": "^3.5.41"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^26.2.0",
|
||||
"@vitejs/plugin-vue": "^6.0.8",
|
||||
"jsdom": "^30.0.1",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^8.2.2",
|
||||
"vue-tsc": "^3.3.10"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"jsx": "preserve",
|
||||
"isolatedModules": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"skipLibCheck": true,
|
||||
"noEmit": true,
|
||||
"types": ["vite/client"],
|
||||
"baseUrl": ".",
|
||||
"paths": { "@/*": ["./src/*"] }
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.vue", "vite.config.ts"]
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
|
||||
// Panel jest samodzielną aplikacją - buduje się do dist/ i trafia do własnego
|
||||
// obrazu z nginxem. Backend nie serwuje żadnych plików statycznych.
|
||||
const BACKEND = process.env.VITE_BACKEND_URL ?? 'http://localhost:8000'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
port: 5173,
|
||||
// W trybie deweloperskim rolę nginxa przejmuje proxy serwera Vite.
|
||||
proxy: {
|
||||
'/api': BACKEND,
|
||||
'/ws': { target: BACKEND.replace(/^http/, 'ws'), ws: true },
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in new issue
Block a user