first commit
This commit is contained in:
commit
edbef55500
96
README.md
Normal file
96
README.md
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
# TSA
|
||||||
|
|
||||||
|
VueJS (latest) + Vite dev app, containerized, routed through the shared ZORRO Traefik.
|
||||||
|
|
||||||
|
## Stack
|
||||||
|
|
||||||
|
| Layer | Choice |
|
||||||
|
|-------|--------|
|
||||||
|
| Runtime | `node:lts-alpine` (Docker, lima) |
|
||||||
|
| Framework | Vue 3 latest, `<script setup>` |
|
||||||
|
| Build/dev | Vite (HMR) |
|
||||||
|
| Templates | Pug (`<template lang="pug">`) |
|
||||||
|
| Routing | vue-router (history mode) |
|
||||||
|
| Edge | Traefik → `app.telecom.quest` |
|
||||||
|
|
||||||
|
## How it runs (infra)
|
||||||
|
|
||||||
|
```
|
||||||
|
browser http://app.telecom.quest/
|
||||||
|
│
|
||||||
|
▼ :80
|
||||||
|
[ traefik ] container, infra router, entrypoint "web"
|
||||||
|
│ Docker provider, Host(`app.telecom.quest`) label match
|
||||||
|
▼ net: zorro-bpm
|
||||||
|
[ tsa-app ] node:lts-alpine, vite dev :5173
|
||||||
|
│ bind mount .:/app
|
||||||
|
▼
|
||||||
|
host folder /Users/telecom/Dev/tsa (edit here → HMR live)
|
||||||
|
```
|
||||||
|
|
||||||
|
- **No host-native servers.** App runs only in the container (ZORRO rule).
|
||||||
|
- **No published ports.** Only Traefik owns host `:80`. App reachable solely via its Host label.
|
||||||
|
- **Network.** App joins external Docker net `zorro-bpm`; Traefik discovers it via the Docker socket and routes by `Host` header.
|
||||||
|
- **Bind mount.** Project folder mounts to `/app`; `vite` uses polling watch (mac → lima → container fs) so edits hot-reload.
|
||||||
|
|
||||||
|
### Traefik labels (docker-compose.yaml)
|
||||||
|
|
||||||
|
```
|
||||||
|
traefik.enable=true
|
||||||
|
traefik.docker.network=zorro-bpm
|
||||||
|
traefik.http.routers.tsa.rule=Host(`app.telecom.quest`)
|
||||||
|
traefik.http.routers.tsa.entrypoints=web
|
||||||
|
traefik.http.services.tsa.loadbalancer.server.port=5173
|
||||||
|
```
|
||||||
|
|
||||||
|
Infra Traefik config lives at `/Users/timur/Dev/_Zorro/_INFRA/traefik/` (entrypoint `web` = :80, `exposedByDefault: false`, TLS terminated by separate `traefik-tls`). See `/Users/telecom/Dev/_Zorro/ZORRO.md`.
|
||||||
|
|
||||||
|
## Layout
|
||||||
|
|
||||||
|
```
|
||||||
|
tsa/
|
||||||
|
├─ docker-compose.yaml # node:lts-alpine, bind mount, traefik labels
|
||||||
|
├─ package.json # vue, vue-router, vite, @vitejs/plugin-vue, pug
|
||||||
|
├─ vite.config.js # host 0.0.0.0, allowedHosts *.telecom.quest, polling
|
||||||
|
├─ index.html # SPA entry
|
||||||
|
├─ index.jpg # full-screen bg used by Public.vue
|
||||||
|
└─ src/
|
||||||
|
├─ main.js # createApp + router
|
||||||
|
├─ router.js # / → Public, /dashboard → Dashboard
|
||||||
|
├─ App.vue # <router-view>
|
||||||
|
└─ views/
|
||||||
|
├─ Public.vue # full-bleed index.jpg landing
|
||||||
|
└─ Dashboard.vue # stats cards
|
||||||
|
```
|
||||||
|
|
||||||
|
## Routes
|
||||||
|
|
||||||
|
| Path | View | Notes |
|
||||||
|
|------|------|-------|
|
||||||
|
| `/` | Public.vue | `index.jpg` full-screen cover background |
|
||||||
|
| `/dashboard` | Dashboard.vue | demo stat cards |
|
||||||
|
|
||||||
|
## Run
|
||||||
|
|
||||||
|
Over SSH on host `asel` (docker needs both bin dirs in PATH — `/usr/local/bin` has the credential helper):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ssh asel
|
||||||
|
export PATH=/opt/homebrew/bin:/usr/local/bin:$PATH
|
||||||
|
cd /Users/telecom/Dev/tsa
|
||||||
|
|
||||||
|
docker compose up -d # first run installs deps inside container
|
||||||
|
docker compose logs -f # watch vite
|
||||||
|
docker compose restart # re-installs deps after package.json change
|
||||||
|
docker compose down # stop
|
||||||
|
```
|
||||||
|
|
||||||
|
First boot runs `npm install && npm run dev` inside the container; deps live in the mounted `node_modules` on the host folder.
|
||||||
|
|
||||||
|
Open: **http://app.telecom.quest/**
|
||||||
|
|
||||||
|
## Notes / gotchas
|
||||||
|
|
||||||
|
- Vite blocks unknown Host headers → `server.allowedHosts` must include `app.telecom.quest` (set in `vite.config.js`).
|
||||||
|
- `docker compose restart` reruns the entrypoint, so it picks up new `package.json` deps.
|
||||||
|
- Pug needs only the `pug` package; `@vitejs/plugin-vue` compiles `<template lang="pug">` automatically.
|
||||||
Reference in New Issue
Block a user