25 lines
1.6 KiB
Markdown
25 lines
1.6 KiB
Markdown
|
|
# Village Politics: frontend
|
|||
|
|
|
|||
|
|
This is the Nuxt client for a browser strategy game in the style of Tribal Wars. It runs on the web first and may ship on Steam later, wrapped in Electron or Tauri. The backend, its architecture, and the roadmap live in `../game-village-politics`. Read `../game-village-politics/docs/architecture.md` before you add a feature.
|
|||
|
|
|
|||
|
|
## Rules
|
|||
|
|
|
|||
|
|
- **The client is a view.** It sends intents over WS and renders what the server returns. It never computes costs, durations, combat, or loot. The only computation it does is projecting resources (`stored + rate × elapsed`) and countdowns from server timestamps. It refetches when a countdown reaches zero or a `village:updated` push arrives.
|
|||
|
|
- **`ssr: false` for every target**, so one static build serves both the web and Steam. Code must not rely on Nuxt server routes or SSR-only APIs.
|
|||
|
|
- **Transport** is WS-first through the `ws` singleton from `@blax-software/networking`, the same as learn-atc. HTTP is only for login and register, which return the bearer token. Load the `blax-websockets` skill before you write `ws.send` or `ws.listen` code.
|
|||
|
|
- **Plain UI until M6**: tables, lists, forms, and no styling work. Keep components small and typed, with state in composables (`useVillage`, `useWorld`).
|
|||
|
|
- All user-facing text goes through i18n keys, with `en` as the first locale.
|
|||
|
|
|
|||
|
|
## Commands
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
pnpm install
|
|||
|
|
pnpm dev # https://village.localhost.at
|
|||
|
|
pnpm typecheck
|
|||
|
|
pnpm generate # static build for web and Steam
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## Commits
|
|||
|
|
|
|||
|
|
Make small commits, one concern each, with prefixes like `feat:`, `fix:`, `test:`, `docs:`, `chore:`.
|