Skip to content

Conversation

@codemauri
Copy link

Mauricio Florez and others added 4 commits November 6, 2025 20:02
- Remove complete backend/ and frontend/ implementations
- Replace Makefile with stub (only help target)
- Replace docker-compose.yml with stub (TODOs only)
- Keep all documentation files (README.md, ARCHITECTURE.md, etc.)
- Add TUTORIAL_RESET_GUIDE.md with reset instructions

This branch now serves as a proper starting point for the tutorial.
Learners can follow the 9 prompts in README.md to build the complete application.
- Image upload working (dual URL + file upload)
- Full-text search working (PostgreSQL TSVECTOR)
- All bugs fixed (edit page, image display, search UX)
- 292 tests passing (87 backend + 205 frontend)
- Meal planning feature complete
- Grocery list generator complete
- Recipe sharing complete
- Star ratings complete
…ete)

Fixed 3 critical privacy/security bugs, implemented comprehensive admin
management system, added password change functionality, and achieved 100%
test coverage with 398 total tests passing.

Bugs Fixed (5 total):
- Bug #15: Meal Plan Privacy Violation - Users could see other users' meal plans
- Bug #16: Category Privacy Violation - Categories shared globally across users
- Bug #17: 403 Error on Logout - Frontend loading categories without auth
- Bug #18: User Deletion Cascade Delete - Admin couldn't delete users
- Bug #19: Model Tests Failing - Category tests missing user_id after Bug #16 fix
- Bug #20: Makefile Out of Date - Missing test-admin command, outdated counts

Features Implemented (2 total):
- Feature #17: Admin Management System
  * 8 admin-only endpoints (stats, user management, resource management)
  * Admin self-lockout prevention (cannot deactivate self or remove own admin)
  * 19 comprehensive tests for all admin functionality
- Feature #18: Password Change Functionality
  * Secure password change with current password validation
  * 3 tests for success, validation, and authentication

Privacy & Security Improvements:
- All meal plan endpoints now require authentication (6 endpoints)
- All category endpoints now require authentication (5 endpoints)
- Complete user privacy isolation (users only see their own data)
- Cascade delete prevents orphaned data when users are deleted
- Default categories on registration (Breakfast, Lunch, Dinner, Snack)

Database Changes:
- Added user_id to meal_plans table with foreign key constraint
- Added user_id to categories table with foreign key constraint
- Added cascade delete relationships (User → Recipes, Categories, MealPlans)
- Removed unique constraint from category name (per-user uniqueness only)
- 4 new Alembic migrations

Test Coverage:
- Backend: 150 tests (129 API + 21 model) - 100% pass rate
- Frontend: 248 tests - 100% pass rate
- Total: 398 tests - 100% pass rate
- Added 26 new API tests (19 admin + 3 password + 4 cascade)
- Fixed 2 model tests for user_id requirement
- New test fixtures: admin_user, authenticated_admin, second_user
- New make command: test-admin (runs all 26 admin-related tests)

Files Modified (11 total):
Backend (8): models, schemas, routers (meal_plans, categories, recipes, auth, admin),
            conftest, test_api, test_models, 4 migrations
Frontend (2): app/page.tsx, app/categories/page.tsx (auth checks)
Project (1): Makefile (test-admin command, updated counts to 150/398)

Documentation:
- SESSION_SUMMARY_2025-11-14.md (Auth implementation)
- SESSION_SUMMARY_2025-11-15.md (Share feature redesign)
- SESSION_SUMMARY_2025-11-17.md (Privacy bugs + Admin features)
- FEATURES_SUMMARY.md (Updated test counts, added bugs 15-20, features 17-18)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Exclude runtime data and temporary development files from version control:
- backend/uploads/ - User-uploaded images (138 test files, 2.5 MB)
- *.backup, *.bak - Temporary backup files
- fix_*.py, update_*.py - One-time development scripts

Rationale:
- User uploads are runtime data, not source code
- Git is optimized for code, not binary image files
- Prevents repository bloat (images stay in history forever)
- Production uploads should use cloud storage (S3, etc.)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant