Skip to content

[T-007] Web app skeleton: Vite + React 19 + TypeScript strict, ESLint/Prettier, Vitest, pnpm #13

Closed

Description

@CodewithJha

Task T-007 · Milestone M1 — Foundation · Size S · Priority P1 · Epic #1

Implements NFR-MNT-001

Branch chore/t-007-web-app-skeleton-vite-react — one task = one branch = one PR (doc 32 §6)

Summary

Create web/ as an empty-but-buildable Vite React TypeScript app with the strict lint/type/test toolchain from doc 16 §4, wired into the root Makefile.

Context / motivation

Splitting the web skeleton from the backend skeleton lets frontend foundations proceed in parallel. All later dashboard work (M8) assumes this toolchain.

Scope

In scope

  • web/package.json (pnpm 9, Node 24 LTS via engines + .nvmrc), pnpm-lock.yaml.
  • Vite 6 + React 19 + TypeScript 5.6 with strict: true, noUncheckedIndexedAccess: true.
  • ESLint (typescript-eslint strict, react-hooks, jsx-a11y) + Prettier; rule forbidding dangerouslySetInnerHTML (doc 31 TM-05).
  • Vitest + Testing Library + jsdom; one smoke test rendering <App/>.
  • Folder skeleton from doc 13 §5 (app/ api/ features/ components/ styles/ lib/ test/) with .gitkeep.
  • Root Makefile targets extended: setup runs pnpm install --frozen-lockfile; lint, typecheck, test include web.
  • Vite dev-server proxy /api → http://127.0.0.1:8000 (target read from VITE_API_PROXY_TARGET, default documented).

Out of scope

  • Design tokens & app shell (T-085a/b)
  • API client generation (T-085c)
  • Docker image (T-116)

Implementation guidance

  • corepack enable → pnpm; pin packageManager field.
  • tsconfig.json: strict, noUncheckedIndexedAccess, exactOptionalPropertyTypes, moduleResolution: bundler.
  • Add web/src/vite-env.d.ts typing import.meta.env.VITE_API_BASE_URL.
  • No hard-coded URLs anywhere (doc 16 §4) — proxy target and base URL come from env.
  • Add pre-commit hooks for ESLint/Prettier on web/**.
  • Standards: respect the layering contracts (doc 16 §2) and conventions in doc 34; no hard-coded tunables — thresholds/defaults come from typed settings (doc 27); no magic numbers (ruff PLR2004); public APIs typed (mypy strict) and documented.

Acceptance criteria

  • pnpm --dir web build, pnpm --dir web lint, pnpm --dir web test pass.
  • make lint test runs both backend and web checks.
  • TypeScript strict flags from doc 16 §4 enabled; ESLint has 0 warnings.
  • Folder skeleton matches doc 13 §5.
  • Tests listed below added and green in CI; coverage of new code meets the gate in doc 18 §3.
  • Docs, config reference and CHANGELOG Unreleased updated where behaviour, keys or interfaces changed.
  • Definition of Done (doc 32 §3) satisfied.

Tests required

  • Vitest smoke test renders the root component.

Dependencies

Blocked by: #12 (T-001)

Blocks: #28 (T-006a), #162 (T-085a), #164 (T-085c), #168 (T-086c)

Parallelization notes

Files / paths owned by this task — avoid editing other paths; shared files (pyproject.toml entry points, cli/main.py, api/routers/__init__.py, router.tsx, docker/compose.yaml, ci.yml) are append-only:

  • web/**
  • Makefile (web targets only)
  • .pre-commit-config.yaml (web hooks only)

Touches only web/ plus additive Makefile/pre-commit lines; can run in parallel with T-002*, T-003a, T-008, T-009, T-017.

Definition of Done

Per doc 32 §3 and AGENTS.md §5: lint, format, mypy strict and import-linter green; tests added and passing; docs updated; PR template completed with Closes #<this issue>; Conventional Commit messages referencing T-007 (doc 16 §6); commits authored only by the repository owner identity (AGENTS.md §4); CI green; reviewer checklist (doc 32 §5.1) satisfied.

References

Design docs: doc 16 §4 · doc 13 §5 · ADR-0010 · doc 15 §1

Requirements: NFR-MNT-001 (traceability: doc 28)

External:

Activity

  1. added this to the M1 — Foundation milestone on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions