Backend: - Item model (title, url, points, username, content, created_at) - is_admin flag on User + startup migration for pre-existing DBs - get_current_admin dependency (401 without/invalid token, 403 for non-admins); server-side check on every admin endpoint - /api/v1/admin/items CRUD: pagination, case-insensitive title/url search, sort by title/created_at/points, in-memory rate limiting (1000 req/60s per admin -> 429) - seed_admin.py (ADMIN_USERNAME/ADMIN_PASSWORD), documented in backend/.env.example Frontend: - Auth context exposes is_admin; RequireAdmin route guard (redirects signed-out users, renders 403 page for non-admins) - AdminLayout with responsive dark sidebar; Admin link in header for admins only - AdminDashboard: paginated table (page size 10/20/50), 300ms debounced search, sortable title/points/created_at columns, edit/delete row actions - EditItemPage: create + edit with client-side validation and a Lexical (0.25) WYSIWYG editor (bold/italic/underline, H1-H6, lists, code blocks, links, undo/redo), optional debounced auto-save - DeleteConfirmation modal with warning icon and explicit "Yes, delete" confirmation - Unit tests (34) and mocked E2E workflow tests (10) All acceptance criteria for milestones/m6-setup-admin-area-prompt.md verified: 108 backend, 87 frontend unit and 29 E2E tests pass.
62 lines
1.7 KiB
JSON
62 lines
1.7 KiB
JSON
{
|
|
"name": "newzy-frontend",
|
|
"private": true,
|
|
"version": "0.1.0",
|
|
"type": "module",
|
|
"description": "Frontend for the newzy news web application — React + TypeScript + Vite.",
|
|
"license": "MIT",
|
|
"engines": {
|
|
"node": ">=18"
|
|
},
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "tsc && vite build",
|
|
"preview": "vite preview",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest",
|
|
"test:coverage": "vitest run --coverage",
|
|
"e2e": "playwright test",
|
|
"e2e:ui": "playwright test --ui",
|
|
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
|
|
},
|
|
"dependencies": {
|
|
"@lexical/code": "^0.25.0",
|
|
"@lexical/html": "^0.25.0",
|
|
"@lexical/link": "^0.25.0",
|
|
"@lexical/list": "^0.25.0",
|
|
"@lexical/react": "^0.25.0",
|
|
"@lexical/rich-text": "^0.25.0",
|
|
"@lexical/selection": "^0.25.0",
|
|
"class-variance-authority": "^0.7.0",
|
|
"clsx": "^2.1.0",
|
|
"lexical": "^0.25.0",
|
|
"lucide-react": "^0.263.0",
|
|
"react": "^18.2.0",
|
|
"react-dom": "^18.2.0",
|
|
"react-router-dom": "^6.20.0",
|
|
"tailwind-merge": "^2.1.0"
|
|
},
|
|
"devDependencies": {
|
|
"@playwright/test": "^1.39.0",
|
|
"@testing-library/dom": "^9.3.4",
|
|
"@testing-library/jest-dom": "^6.4.2",
|
|
"@testing-library/react": "^14.2.0",
|
|
"@types/react": "^18.2.0",
|
|
"@types/react-dom": "^18.2.0",
|
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
"@typescript-eslint/parser": "^6.21.0",
|
|
"@vitejs/plugin-react": "^4.2.0",
|
|
"@vitest/coverage-v8": "^0.34.0",
|
|
"autoprefixer": "^10.4.16",
|
|
"eslint": "^8.57.0",
|
|
"eslint-plugin-react": "^7.34.0",
|
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
"jsdom": "^24.0.0",
|
|
"postcss": "^8.4.32",
|
|
"tailwindcss": "^3.4.0",
|
|
"typescript": "~5.4.2",
|
|
"vite": "^4.4.0",
|
|
"vitest": "^0.34.0"
|
|
}
|
|
}
|