Backend (FastAPI):
- is_admin field added to User model with default False
- Admin-only dependency validates JWT AND is_admin flag
- Protected CRUD endpoints for items management
- Pagination, search by title/url, sort by title/date
Frontend (React + TypeScript):
- AdminLayout with sidebar navigation protected by auth check
- AdminDashboard with pagination controls and page size selector
- EditItemPage with Lexical WYSIWYG editor toolbar
- DeleteConfirmation modal requires explicit confirmation
- Warning icon and consequences message before delete
Security:
- Server-side 403 Forbidden for non-admin users
- JWT token validation required on all admin routes
Backend (FastAPI):
- User model with username, password_hash, created_at fields
- PBKDF2 password hashing (120,000 iterations with salt)
- JWT token generation using HS256 algorithm (7-day expiry)
- Auth endpoints: POST /api/auth/register, POST /api/auth/login
- GET /api/auth/me validates Bearer tokens
- Environment variable HN_SECRET_KEY for JWT signing
Frontend (React + TypeScript):
- AuthContext for authentication state management
- Login.tsx, Register.tsx, SignOut.tsx pages
- AUTH_TOKEN stored in localStorage
- Session restoration on page load
- API client with auth methods and token attachment
Security:
- Passwords hashed with PBKDF2-SHA256 (not plaintext)
- Random salt per password using secrets.token_hex
- JWT signed with configurable SECRET_KEY
- 401 responses for invalid/expired tokens
Reference implementation used: /home/daniel/Gitea/daniel/news
- Add docker-compose.yml orchestrating backend and frontend services
- Create .env.example with documented environment variables
- Create .env file with default development configuration
- Makefile with dev, stop, restart, test, clean commands
- data/.gitignore excludes SQLite database from version control
- .dockerignore files for both frontend and backend builds
- Update README.md with M4 milestone links
This milestone enables developers to run the full application stack using Docker Compose.
M2 (Backend):
- Add tests/ folder with pytest test files
- Add pytest.ini for test configuration and coverage
- Update scoring to require unit tests (Score 4+)
M3 (Frontend):
- Add tests/ folder with Vitest component unit tests
- Add playwright/e2e/ folder with E2E Playwright tests
- Add @playwright/test dependency and configuration
- Update scoring to require both unit and E2E tests (Score 5)
README.md updated with all milestone links and test requirements