Commit Graph

5 Commits

Author SHA1 Message Date
Paul Huliganga afdc915aa2 fix(backend): remove require() usage in ESM database saver
Use writeFileSync import instead of require('fs') to avoid runtime
ReferenceError in Node ESM mode during periodic DB saves.
2026-03-24 20:04:28 -04:00
Paul Huliganga dbdbcf43fa feat(tags): implement tag management with create, assign, and display functionality
Backend:
- Add Tag type definitions (Tag, CreateTagInput, UpdateTagInput)
- Implement TagRepository with CRUD and recipe assignment methods
- Implement TagService with business logic and validation
- Create tag API routes (GET, POST, PUT, DELETE /api/tags)
- Add recipe-tag assignment endpoints (POST/DELETE /api/tags/recipes/:id/tags)
- Write 18 integration tests for tag functionality (all passing)
- Mount tag routes in main Express app

Frontend:
- Extend API client with tag CRUD and assignment methods
- Create useTags hook for tag state management
- Create TagSelector component for tag selection with inline tag creation
- Update RecipeForm to accept initialTags and pass selected tags to onSubmit
- Update RecipeDetailPage to fetch, display, and manage recipe tags
- Update RecipeCard to display tags with custom colors
- Add tag filter UI to RecipeListPage (note: backend filtering pending)
- Display tags in recipe detail view with color styling

Testing:
- All 34 backend tests passing (16 recipe + 18 tag tests)
- Frontend builds successfully with TypeScript strict mode
- Tag assignment and removal working end-to-end

Note: Tag filtering in recipe list shows UI but doesn't filter results yet.
Backend support for tag-based filtering can be added in future iteration.
2026-03-24 04:02:51 -04:00
Paul Huliganga e2599b81f4 feat(api): implement recipe CRUD API endpoints
- Add Recipe type definitions (Recipe, CreateRecipeInput, UpdateRecipeInput)
- Implement RecipeRepository for database operations (CRUD + search)
- Implement RecipeService with business logic validation
- Create Express routes with Zod validation schemas
- Add database initialization module with auto-save functionality
- Implement comprehensive integration tests (16 tests, all passing)
- Support pagination, search filtering, and proper error handling
- Follow layered architecture pattern (Routes → Services → Repositories)

All tests passing (16/16). TypeScript strict mode enabled.
2026-03-24 00:13:58 -04:00
Paul Huliganga 394aa22df1 feat(db): enable schema migration using sql.js and export to data/recipes.db 2026-03-24 00:01:41 -04:00
Paul Huliganga ed1f4f88be feat(backend): initialize Node.js project with Express 2026-03-23 23:40:36 -04:00