The admin area was managing a Hacker News-style Item model that the
public site never consumed, so the homepage always fell back to sample
data. Rebuild the admin area around the real public content model.
Backend:
- Remove the Item model, schema and admin API
- Admin API now manages articles at /api/v1/admin/articles (CRUD) with
/api/v1/admin/authors and /api/v1/admin/categories reference data
- Add public read-only article endpoints (/api/v1/articles,
/api/v1/articles/{id}): no auth, published-only, newest-first
- Rewrite Article schemas; ArticleRead embeds author and category
- Add idempotent seed_content.py dev seeder (3 authors, 4 categories,
6 published articles)
Frontend:
- Admin UI rewritten around articles: AdminDashboard list, new
EditArticlePage (create/edit, author/category selects, published
toggle, Lexical editor, debounced auto-save)
- Replace AdminItem types and api client with the article domain
- Update App routes, AdminLayout sidebar, DeleteConfirmation, Lexical
editor labels and Home/client comments to article terminology
Tests:
- Rewrite admin unit tests and the Playwright admin e2e spec for the
article domain; add test_articles.py for the public endpoints and
seeder
EditorShell's ingest called $generateNodesFromDOM but discarded the
returned nodes, so stored content never appeared in the WYSIWYG editor
in edit mode (the E2E edit test only checked title/points and missed it).
The parsed nodes are now appended to the root (kept empty-paragraph
default when nothing parses).
Hardening tests added while auditing the M6 test checklist:
- E2E: edit view asserts the stored body renders in the editor; new
hostile-HTML test loads <script> tags, onerror/onload handlers and
javascript: links through the real editor and asserts none survive
into the contenteditable and nothing executes.
- E2E/unit: create button is disabled while the request is in flight.
- Backend: SQL metacharacters in the search term behave as literal
text and leave the table intact.
Milestone doc updated: QA checklist items now cite their tests, plus a
QA-findings note for the ingest bug.
frontend/src/data/sample.ts (imported by Home/CategoriesPage) was never
committed because the root .gitignore ignored every path named data/.
A fresh clone would have failed the frontend build.
M3 frontend infrastructure for the newzy news application:
- Vite + React 18 + TypeScript project (Node >=18) in frontend/
- React Router v6: BrowserRouter in App.tsx, routes for /, /articles,
/articles/:id and /categories, Link/NavLink-based navigation
- lucide-react icons (Home, FileText, Settings, Search, ...) in the
responsive Header (desktop + mobile menu) and article components
- Reusable components: ArticleCard, AuthorAvatar, CategoryBadge (CVA),
Layout shell with backend API status indicator in the footer
- Typed API client (fetch wrapper, ApiError, endpoint helpers) with
types matching the backend models; sample-data fallback until the
backend article endpoints exist
- Tailwind CSS global/component styles, cn() helper (clsx + tailwind-merge)
- Unit tests: Vitest + React Testing Library (23 tests, 100% statement
coverage on components)
- E2E tests: Playwright (9 tests) covering page shell, feed rendering,
client-side navigation, article route and API interactions
- ESLint (react + react-hooks + typescript) configured and passing
- Multi-stage Dockerfile (Vite build -> Nginx) with SPA fallback and an
/api/ proxy to the backend service; docker-compose frontend service on
port 3000 in both frontend/ and the root docker-compose.yml
- README with setup, API documentation, testing and Docker instructions
Implement milestone M2 (backend setup):
- FastAPI app factory (core/app.py) with CORS, lifespan table
creation, and global error handlers using a standardized
{detail, code, errors?} envelope
- Endpoints: GET /health, GET /api/v1/health, GET /api/v1/version
- SQLAlchemy 2.0 ORM: Article, Author, Category models with
relationships, unique constraints, and FK pragma for SQLite
- Pydantic v2 schemas (create/update/read) for all models
- Env-driven config (DATABASE_URL, CORS_ORIGINS) + .env.example
- pytest suite (19 tests, ~95% coverage) with per-test SQLite
databases via fixtures
- Dockerfile (python:3.11-slim) and docker-compose.yml with a
persistent ./data/db volume and healthcheck
Add repository scaffolding: .gitignore, README, CONTRIBUTING, MIT
license, pre-push quality hook, and documentation covering branching,
file conventions, and commit style. Establish the main/develop
branching strategy. This is project setup only; no application
functionality is included.