Commit Graph

52 Commits

Author SHA1 Message Date
10ee2e81ae refactor: consolidate formatting utilities and add testing infrastructure
- Replace 8 duplicate formatCurrency functions with shared utility
- Add comprehensive formatter utilities (currency, date, number, etc.)
- Set up Vitest for unit testing with 38 passing tests
- Set up Playwright for E2E testing
- Consolidate database connection to single source (src/utils/db.ts)
- Add auth middleware helpers to reduce code duplication
- Fix display bug: remove spurious minus sign in recent activity amounts
- Add path aliases for cleaner imports ($utils, $models)
- Add project documentation (CODEMAP.md, REFACTORING_PLAN.md)

Test coverage: 38 unit tests passing
Build: successful with no breaking changes
2025-11-18 15:24:22 +01:00
de20bdb82a fix: improve cospend mobile layout and fix settlement rounding
- Fix settlement amounts rounding to 2 decimal places in debts API
- Improve dashboard mobile responsiveness with tighter gaps and padding
- Optimize settlement layout to stay horizontal on mobile with smaller profile pictures
- Fix payments page mobile layout with better breakpoints and reduced min-width
- Enhance modal behavior on mobile devices with proper responsive design
- Reduce container max-width from 1400px to 1200px for better mobile fitting

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-17 20:16:51 +02:00
90ea22497f feat: add multi-currency support to cospend payments
- Add ExchangeRate model for currency conversion tracking
- Implement currency utility functions for formatting and conversion
- Add exchange rates API endpoint with caching and fallback rates
- Update Payment and RecurringPayment models to support multiple currencies
- Enhanced payment forms with currency selection and conversion display
- Update split method selector with better currency handling
- Add currency-aware payment display and balance calculations
- Support for EUR, USD, GBP, and CHF with automatic exchange rate fetching

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-14 19:54:31 +02:00
ac84de43e1 fix: implement persistent MongoDB connections and resolve race conditions
- Replace connect/disconnect pattern with persistent connection pool
- Add explicit database initialization on server startup
- Remove all dbDisconnect() calls from API endpoints to prevent race conditions
- Fix MongoNotConnectedError when scheduler runs concurrently with API requests
- Add connection pooling with proper MongoDB driver options
- Add safety check for recipes array in favorites utility

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-14 19:53:55 +02:00
972c9b8d9b fix: use event.fetch instead of global fetch for server-side requests
Updated both hooks.server.ts and bible-quote API to properly use event.fetch
for relative URLs in server-side code, following SvelteKit best practices.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-12 23:17:18 +02:00
8eb28c1dec bible api: use SvelteKit static file handling instead of fs
Replace filesystem access with fetch request to leverage SvelteKit's
built-in static file serving for the allioli.tsv bible data.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-12 22:54:25 +02:00
878ea724c7 error page: prettier + random bible verse 2025-09-12 22:49:32 +02:00
5f381646c6 Enhance cospend monthly expenses chart with improved UX
- Add monthly total labels above each bar showing cumulative expense amounts
- Improve chart styling: white labels, larger fonts, clean flat tooltip design
- Hide Y-axis ticks and grid lines for cleaner appearance
- Capitalize category names in legend and tooltips
- Show only hovered category in tooltip instead of all categories
- Trim empty months from start of data for users with limited history
- Create responsive layout: balance and chart side-by-side on wide screens
- Increase max width to 1400px for dashboard while keeping recent activity at 800px
- Filter out settlements from monthly expenses view

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-12 22:21:22 +02:00
be775e8d8e cospend: display all payments + less logging 2025-09-12 20:54:23 +02:00
6e84fe1ce5 add MVP monthly expenses graph 2025-09-12 20:07:37 +02:00
14eeec8ed0 Fix payment display and dashboard refresh functionality
- Fix 'paid in full for others' payments showing CHF 0.00 instead of actual amount
- Add time-based sorting to payments (date + createdAt) for proper chronological order
- Redirect to dashboard after adding payment instead of payments list
- Implement complete dashboard refresh after payment deletion via modal
- Fix dashboard component reactivity for single debtor view updates

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-12 14:54:15 +02:00
ae4184c98d Add comprehensive recurring payments system with scheduling
- Add RecurringPayment model with flexible scheduling options
- Implement node-cron based scheduler for payment processing
- Create API endpoints for CRUD operations on recurring payments
- Add recurring payments management UI with create/edit forms
- Integrate scheduler initialization in hooks.server.ts
- Enhance payments/add form with progressive enhancement
- Add recurring payments button to main dashboard
- Improve server-side rendering for better performance

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-12 12:41:18 +02:00
c9dd7a5dc1 Fix event sorting on /cospend dashboard to match payments view
Sort recent activity by payment date instead of creation date using
MongoDB aggregation pipeline to properly handle populated fields.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 12:28:17 +02:00
c5f6373ff6 Add complete settlement system with visual distinction
- Add settlement category with handshake emoji (🤝)
- Create settlement page for recording debt payments with user → user flow
- Implement settlement detection and visual styling across all views
- Add conditional "Settle Debts" button (hidden when balance is 0)
- Style settlement payments distinctly in recent activity with large profile pictures
- Add settlement flow styling in payments overview with green theme
- Update backend validation and Mongoose schema for settlement category
- Fix settlement receiver detection with proper user flow logic

🤝 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 19:25:05 +02:00
f3b97827ba Enhance Cospend with debt breakdown and predefined users
- Add EnhancedBalance component with integrated single-user debt display
- Create DebtBreakdown component for multi-user debt overview
- Add predefined users configuration (alexander, anna)
- Implement personal + equal split payment method
- Add profile pictures throughout payment interfaces
- Integrate debt information with profile pictures in balance view
- Auto-hide debt breakdown when single user (shows in balance instead)
- Support both manual and predefined user management modes

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 18:58:04 +02:00
e4ee109d8b Add payment categories with emoji icons and image upload support
- Add comprehensive category system: Groceries 🛒, Shopping 🛍️, Travel 🚆, Restaurant 🍽️, Utilities , Fun 🎉
- Create category utility functions with emoji and display name helpers
- Update Payment model and API validation to support categories
- Add category selectors to payment creation and edit forms
- Display category emojis prominently across all UI components:
  - Dashboard recent activities with category icons and names
  - Payment cards showing category in metadata
  - Payment modals and view pages with category information
- Add image upload/removal functionality to payment edit form
- Maintain responsive design and consistent styling across all components

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-08 22:29:52 +02:00
9a3b2ad134 Add complete Cospend expense sharing feature
- Add MongoDB models for Payment and PaymentSplit with proper splitting logic
- Implement API routes for CRUD operations and balance calculations
- Create dashboard with balance overview and recent activity
- Add payment creation form with file upload (using $IMAGE_DIR)
- Implement shallow routing with modal side panel for payment details
- Support multiple split methods: equal, full payment, custom proportions
- Add responsive design for desktop and mobile
- Integrate with existing Authentik authentication

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-08 21:15:45 +02:00
a582bac94d Add JSON-LD structured data for recipes
- Create recipeJsonLd.ts function with Schema.org compliant Recipe markup
- Add API endpoint at /api/rezepte/json-ld/[name] for on-demand generation
- Include proper ISO 8601 time parsing for German formats
- Add rel="alternate" link in recipe pages for discoverability
- Set author to Alexander Bocken with proper Person type
- Include caching headers for performance optimization

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 18:57:47 +02:00
0bdc674a6d Fix recipe search favorites filter to use UserFavorites model
Replace non-existent User model import with correct UserFavorites model and update filtering logic to work with the proper data structure.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 15:22:13 +02:00
b05dcf9e3b Implement progressive enhancement for universal search with context-aware filtering
Add comprehensive search solution that works across all recipe pages with proper fallbacks. Features include universal API endpoint, context-aware filtering (category/tag/icon/season/favorites), and progressive enhancement with form submission fallback for no-JS users.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 14:53:59 +02:00
cd54ad0498 Implement user favorites feature for recipes
- Add UserFavorites MongoDB model with ObjectId references
- Create authenticated API endpoints for favorites management
- Add Heart icon and FavoriteButton components with toggle functionality
- Display favorite button below recipe tags for logged-in users
- Add Favoriten navigation link (visible only when authenticated)
- Create favorites page with grid layout and search functionality
- Store favorites by MongoDB ObjectId for data integrity

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-01 20:18:57 +02:00
c8d879d4f9 Upgrade SvelteKit 4 to SvelteKit 5 with latest dependencies
Major changes:
- Upgraded Svelte from v4 to v5.38.6 (latest stable)
- Upgraded SvelteKit from v2.0.0 to v2.37.0 (latest)
- Upgraded Vite from v5 to v7.1.3 for better performance
- Updated all related packages to latest compatible versions
- Added pnpm as package manager with packageManager field
- Fixed Card.svelte nested anchor tags issue by converting inner links to buttons
- Updated component styling to maintain visual consistency
- Removed incompatible svelte-preprocess-import-assets package

Dependencies updated:
- @sveltejs/kit: ^2.0.0 → ^2.37.0
- @sveltejs/vite-plugin-svelte: ^3.0.0 → ^6.1.3
- svelte: ^4.0.0 → ^5.38.6
- vite: ^5.0.0 → ^7.1.3
- @sveltejs/adapter-auto: ^3.0.0 → ^6.1.0
- @sveltejs/adapter-node: ^2.0.0 → ^5.0.0
- svelte-check: ^3.4.6 → ^4.0.0
- mongoose: ^7.4.0 → ^8.0.0
- sharp: ^0.32.3 → ^0.33.0

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-31 21:01:19 +02:00
c23d742398 remove user admin routes 2024-02-19 23:24:28 +01:00
446620b8f5 add forgotten updated api routes 2024-02-18 14:45:01 +01:00
ca62e48f7b initial OIDC setup 2024-02-14 16:07:55 +01:00
4127e9dd39 also search through season, exclude "🍽️"recipes from being in season 2024-01-19 20:12:09 +01:00
a0edaf74ce fix path depth for payments/[item] api 2023-07-24 23:05:50 +02:00
008069da69 added missing payments api routes 2023-07-24 22:59:09 +02:00
c6fb41de6d add payment route + additional starting blocks 2023-07-24 22:57:12 +02:00
021e9aa940 add externalized hashPassword.js 2023-07-23 12:22:58 +02:00
f918adf22a change password possible 2023-07-23 12:21:12 +02:00
094170b4af remove old api routes; 2023-07-22 13:09:28 +02:00
e9339d4ba4 move API routes as cleanup 2023-07-22 13:09:06 +02:00
9705509f54 section scales, not anchor 2023-07-22 12:58:29 +02:00
2a38e041d6 allow for build because of jsonwebtoken quirk 2023-07-18 14:28:39 +02:00
4321ece385 First fully working user management, move to layout groups 2023-07-18 14:18:52 +02:00
1f34c36384 cleaner login and registration 2023-07-18 12:05:30 +02:00
a931977684 add initial user Management API 2023-07-18 09:14:33 +02:00
2eaef8e10c bodge img upload on edit if no img available 2023-07-13 18:18:01 +02:00
691aa1b0b7 fix img APIs to working standard 2023-07-12 12:23:35 +02:00
385a878cf5 add initial img API endpoints 2023-07-12 11:35:43 +02:00
32ff7a2a20 randomize moved to API 2023-07-11 22:54:13 +02:00
8f15d9650b fix to working state 2023-07-11 18:51:34 +02:00
800ca29531 initial implementation of placeholder images, thumbnails and blurring between using sharp 2023-07-11 18:47:29 +02:00
7eb731181a Icon route added 2023-07-03 12:39:34 +02:00
0ad95d1f2c API routes now return proper Responses and basic errors are handled
slight improvements in layouting
2023-07-02 23:39:31 +02:00
238d1504a9 add forgotten img api 2023-06-27 19:27:00 +02:00
811ae3db5f Does not work: uploading images
Adding/Editing/Deleting works
SeasonsSelect works
Nice recipe layout
2023-06-24 15:35:38 +02:00
bdfb7280e1 First almost fully functioning MVP.
Lacking:
- Seasons cannot be added/edited
- image upload
- layout recipe/adding
2023-06-24 15:35:38 +02:00
b4223f8eb0 Lots of changes, started on working /add 2023-06-24 15:35:37 +02:00