strava-frontend/.roo/memory-bank/techContext.md

46 lines
2.1 KiB
Markdown

# Tech Context — Strava Frontend
## Stack
- **Vue 3** (3.5) + **TypeScript** 5.4 (strict mode, `noEmit`)
- **Vite** 4 (dev server, bundler) with `@vitejs/plugin-vue` and `@intlify/unplugin-vue-i18n/vite`
- **Pinia** 3 — state management (options-style stores; vue ≥3.3 required)
- **vue-router** 4 — history-mode routing
- **vue-i18n** 9 — i18n (composition mode, default/fallback `ru`)
- **Vuestic UI** 1.9 — component library (+ `@vuestic/tailwind`)
- **Tailwind CSS** 3.4 + **PostCSS** + **autoprefixer** — utilities/styling
- **Sass** — global styles
- **Axios** 1.6 — HTTP client
- **Chart.js** 4 + `vue-chartjs` 5 (+ zoom/geo/adapter-moment plugins) — charts
- **vue-yandex-maps** — Yandex Maps integration
- **@vueuse/core**, **vue-moment**, **flag-icons**, **ionicons**, **medium-editor**, **epic-spinners**, `register-service-worker` (PWA), `@gtm-support/vue-gtm` (analytics)
- **Storybook** 7 — component dev environment
## Tooling
- **ESLint** 9 flat config (`eslint.config.mjs`) with `vue`, `typescript-eslint`, `prettier` plugins
- **Prettier** 3 — formatting
- **Husky** + **lint-staged** — pre-commit lint of `src/**/*.{ts,js,vue}`
- **vue-tsc** — type checking at build
## Scripts (`package.json`)
- `yarn dev` — Vite dev server
- `yarn build` — `vue-tsc --noEmit && vite build`
- `yarn lint` — eslint --fix over src
- `yarn format` — prettier --write
- `yarn storybook` / `yarn build-storybook`
- `yarn build:ci` / `yarn start:ci` — CI build + static serve
## Environment
- API host is a hardcoded constant `HOST` in `src/main.ts` (no `.env`-driven base URL). Yandex Maps API key and GTM keys are hardcoded / env-driven (`VITE_APP_GTM_ENABLED`, `VITE_APP_GTM_KEY`).
- Locales: `br, cn, es, gb, ir, ru` (default `ru`).
- Deploy: Dockerfile + `nginx.conf`; `run.sh` local runner.
## Constraints
- No test framework configured (no vitest/jest/cypress). Verification = `yarn lint` + `yarn build`.
- Backend API contract: `/api/v0/*`, JWT Bearer auth, error envelope may be `{ code, message, detail }` (see backend `app/web/errors.py`).
- Keep `vue-tsc` clean — build fails on type errors.