Add scoring reports for the recreated newz repo milestones M1 through M3, with verification notes and remediation steps for each. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
6.5 KiB
6.5 KiB
M3: Setup Frontend - Score Report
Model: qwen3.8-27b
Repository scored: ../newz (/home/daniel/Gitea/daniel/newz), committed frontend/ on develop (merge 253052c, PR #3)
Rubric: milestone/m3-setup-frontend-scoring.md
Total Score: 41 (35 base + 6 bonus) - Overall level 1 as delivered
Overall level 1 as delivered. A clean checkout of develop does not build: src/pages/Home.tsx and src/pages/CategoriesPage.tsx import ../data/sample, which is not committed. The root .gitignore excludes data/, which also matches frontend/src/data/. The file exists in the working tree only. With that file restored, the build, lint, unit tests, E2E tests and Docker image all pass, and the overall level would be 3.
Verification Performed
All checks ran on a clean git archive export of develop, except where noted.
| Check | Result |
|---|---|
npm ci |
Installs. Warnings about esbuild install scripts only. |
npm run build (clean export) |
Fails. TS2307: Cannot find module '../data/sample' in Home.tsx and CategoriesPage.tsx, followed by implicit-any errors. |
npm run build (with src/data/sample.ts copied in) |
Passes. tsc reports 0 errors; vite build produces dist/. |
npm run lint |
Exit 0. |
npx vitest run |
5 files, 23 tests, all pass. |
Unit coverage (src/components, src/pages, src/api) |
Components: 100% statements, 93.9% branches, 100% lines. Pages and API client are not exercised by unit tests. |
npx playwright test --project=chromium (with sample file) |
9 passed. Covers the shell and branding, featured article and grid, router-link navigation without a full reload, article card to placeholder, console errors, and four API-client tests. |
docker build (clean export) |
Fails with the same missing-module error (npm run build exit 2). |
docker build (with sample file) and docker run |
Builds. SPA routes /, /articles, /categories, /articles/1 and unknown paths return 200 (the unknown path renders the 404 component). /api/v1/version returns 502 because the backend is not running in this test. |
Scoring by Criterion
| Criterion | Score | Max | Notes |
|---|---|---|---|
| Project Setup | 2 | 2 | frontend/ contains public/, src/ (assets/, components/, pages/, types/, api/, tests/, lib/), and playwright/. |
| TypeScript & Dependencies | 4 | 5 | strict: true. react-router-dom ^6.20.0, lucide-react and typed API client are used by components. tsc passes with the sample file present. Not level 5 because the build fails from a clean checkout. |
| UI Components | 5 | 5 | Header uses NavLink with Home, FileText and Settings icons, a mobile menu with aria-expanded and aria-controls, and labelled navigation. Layout, ArticleCard, AuthorAvatar and CategoryBadge exist and are tested. |
| React Router Configuration | 5 | 5 | BrowserRouter wraps the app in App.tsx. Routes: /, /articles, /articles/:id, /categories, and a * 404 route. Navigation uses NavLink/Link. The E2E test checks that navigation does not trigger a full page load. |
| Page Components | 3 | 3 | Home, ArticlePage and CategoriesPage live in pages/ and are mapped in App.tsx. |
| API Integration | 2 | 2 | api/client.ts has a configurable base URL, a fetch wrapper that converts failures to ApiError, and typed endpoint functions. |
| Unit Testing | 3 | 4 | 23 tests across Header, Layout, ArticleCard, AuthorAvatar and CategoryBadge, using React Testing Library. No unit tests for the API client's error handling (level 4 requires them). |
| E2E Testing | 5 | 6 | 9 Playwright tests (chromium) pass, covering layout, navigation without reload, and the article card flow. No accessibility-scanner checks, so level 6 is not met. |
| Docker Configuration | 2 | 3 | Multi-stage Dockerfile (node:20-alpine build, nginx:1.27-alpine serve). The compose file has frontend on port 3000:80 with depends_on: backend: service_healthy. But the build fails from a clean checkout, so level 3 is not met. |
| Code Quality | 2 | 2 | ESLint runs and passes. TypeScript strict mode. Consistent React and hooks rules. |
| Documentation | 2 | 3 | frontend/README.md (240 lines) covers scripts, structure, routing, API client, testing, Docker, environment variables, lucide icons and troubleshooting. No per-component prop documentation, so level 3 is not met. |
| Base total | 35 | 49 |
Bonus
- +1 ESLint rules configured: awarded.
.eslintrc.cjsenables TypeScript, React and hooks rules, and lint passes. - +2 TypeScript strict mode and typed components: awarded.
strict: true, and components have typed props and interfaces. - +3 Root compose orchestration, SPA
try_filesfallback, and E2E routing checks without reloads: awarded. All three are present.
Bonus total: +6.
Critical Requirements Checklist (from rubric)
lucide-reactinstalled and usedreact-router-dominstalled and usedBrowserRouterconfigured inApp.tsx<Link>/<NavLink>used for navigation (no plain anchors in the app)
Other Issues Found
- Missing
src/data/sample.tsin git. The root.gitignorelinedata/excludesfrontend/src/data/. Narrow the rule (for example,/data/anchored at the repo root), or move the sample module tosrc/lib/orsrc/mocks/, and commit it. This is the single blocker for the build and the Docker image. - API proxy only tested without a backend. Nginx returns 502 for
/apiwhen the backend is down. This is correct behaviour, but the frontend renders a fallback. A full stack run has not been tested in this scoring pass. - No unit tests for
api/client.ts. The fetch wrapper,ApiErrormapping, and network-error path are untested. - Pages and API client have no coverage in the unit run. Only components are exercised.
- No "Search" icon in the Header, although the M3 acceptance criteria list
Searchamong the lucide icons. The search bar is also absent.
Path to a Higher Score
- Commit
src/data/sample.ts(fix the.gitignorerule), then confirmnpm run buildanddocker buildpass from a fresh clone. This moves the overall level to 3. - Add unit tests for
api/client.ts: success, non-2xx error envelope, and network failure. - Add an accessibility check to the E2E suite (for example,
@axe-core/playwright). - Add prop documentation for the shared components (
Header,Layout,ArticleCard,AuthorAvatar,CategoryBadge) to the README. - Add the
Searchicon to the header or to the planned search bar.