Commit Graph

57 Commits

Author SHA1 Message Date
Alexander ac31d24326 add automatic image renaming when recipe short_name changes 2025-12-26 21:55:04 +01:00
Alexander c2e4576c42 refactor: unify recipe routes into [recipeLang] slug with full bilingual support
Consolidate /rezepte and /recipes routes into single [recipeLang] structure to eliminate code duplication. All pages now use conditional API routing and reactive labels based on language parameter.

- Merge duplicate route structures into /[recipeLang] with 404 for invalid slugs
- Add English API endpoints for search, favorites, tags, and categories
- Implement language dropdown in header with localStorage persistence
- Convert all pages to use Svelte 5 runes (, , )
- Add German-only redirects (301) for add/edit pages
- Make all view pages (list, detail, filters, search, favorites) fully bilingual
- Remove floating language switcher in favor of header dropdown
2025-12-26 21:19:27 +01:00
Alexander 1f16d1c5c9 add English translation support for recipes with DeepL integration
- Add embedded translations schema to Recipe model with English support
- Create DeepL translation service with batch translation and change detection
- Build translation approval UI with side-by-side editing for all recipe fields
- Integrate translation workflow into add/edit pages with field comparison
- Create complete English recipe routes at /recipes/* mirroring German structure
- Add language switcher component with hreflang SEO tags
- Support image loading from German short_name for English recipes
- Add English API endpoints for all recipe filters (category, tag, icon, season)
- Include layout with English navigation header for all recipe subroutes
2025-12-26 20:28:43 +01:00
Alexander e37da0ac7a refactor: remove verbose debug logging from cospend API endpoints
Removed excessive console.log statements from recurring payments processing and monthly expenses aggregation. Error logging (console.error) is retained for troubleshooting.
2025-12-16 16:40:39 +01:00
Alexander 7a44ffefb4 feat: enhance rosary with interactive Bible citations and improved mystery selection
- Add clickable Bible reference buttons that open modal with full verses
- Create BibleModal component with backdrop blur and styled close button
- Implement build-time data fetching for Bible texts while maintaining reactivity
- Redesign mystery selector with responsive grid (3-in-row/4-in-row/2×2)
- Add "Heutige" badge to indicate today's auto-selected mystery
- Reposition luminous mysteries toggle below mystery selector
- Integrate Bible reference and counter buttons side-by-side
- Restructure Bible API under /api/glaube/bibel/ for better organization
2025-12-16 15:45:40 +01:00
Alexander 283aaa19d9 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
Alexander 3f528730d4 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
2025-09-17 20:16:51 +02:00
Alexander 2b857b503b 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
2025-09-14 19:54:31 +02:00
Alexander b233c55ee6 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
2025-09-14 19:53:55 +02:00
Alexander 9c50a60853 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.
2025-09-12 23:17:18 +02:00
Alexander 22d05cfb0d 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.
2025-09-12 22:54:25 +02:00
Alexander 96f8dce88c error page: prettier + random bible verse 2025-09-12 22:49:32 +02:00
Alexander 73fb674c86 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
2025-09-12 22:21:22 +02:00
Alexander bd6e3ebec6 cospend: display all payments + less logging 2025-09-12 20:54:23 +02:00
Alexander d2f1e6e8e7 add MVP monthly expenses graph 2025-09-12 20:07:37 +02:00
Alexander 21a2f0068d 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
2025-09-12 14:54:15 +02:00
Alexander eedfd3ecec 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
2025-09-12 12:41:18 +02:00
Alexander 078ed0c642 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.
2025-09-10 12:28:17 +02:00
Alexander 0481831217 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
2025-09-09 19:25:05 +02:00
Alexander 653d29cce4 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
2025-09-09 18:58:04 +02:00
Alexander 0b0cf97fbb 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
2025-09-08 22:29:52 +02:00
Alexander 5db53f63a4 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
2025-09-08 21:15:45 +02:00
Alexander f52de20105 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
2025-09-04 18:57:47 +02:00
Alexander ec2c1509fd 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.
2025-09-04 15:22:13 +02:00
Alexander cb39365e77 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.
2025-09-04 14:53:59 +02:00
Alexander fffd271c06 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
2025-09-01 20:18:57 +02:00
Alexander b4b8f65207 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
2025-08-31 21:01:19 +02:00
Alexander e30ccc1dfe remove user admin routes 2024-02-19 23:24:28 +01:00
Alexander e8b9cea219 add forgotten updated api routes 2024-02-18 14:45:01 +01:00
Alexander e7ed39dc51 initial OIDC setup 2024-02-14 16:07:55 +01:00
Alexander 74e30d2114 also search through season, exclude "🍽️"recipes from being in season 2024-01-19 20:12:09 +01:00
Alexander bc1eb756da fix path depth for payments/[item] api 2023-07-24 23:05:50 +02:00
Alexander 6d029e6eb7 added missing payments api routes 2023-07-24 22:59:09 +02:00
Alexander ffea1c5637 add payment route + additional starting blocks 2023-07-24 22:57:12 +02:00
Alexander 1254a75dbf add externalized hashPassword.js 2023-07-23 12:22:58 +02:00
Alexander 304474a8fb change password possible 2023-07-23 12:21:12 +02:00
Alexander 4a91b30ec1 remove old api routes; 2023-07-22 13:09:28 +02:00
Alexander 5353c189ff move API routes as cleanup 2023-07-22 13:09:06 +02:00
Alexander 20e3c3ea33 section scales, not anchor 2023-07-22 12:58:29 +02:00
Alexander e21f621a49 allow for build because of jsonwebtoken quirk 2023-07-18 14:28:39 +02:00
Alexander a6b8685f91 First fully working user management, move to layout groups 2023-07-18 14:18:52 +02:00
Alexander c14b174a42 cleaner login and registration 2023-07-18 12:05:30 +02:00
Alexander 7bf9ce9831 add initial user Management API 2023-07-18 09:14:33 +02:00
Alexander 84d214bb9e bodge img upload on edit if no img available 2023-07-13 18:18:01 +02:00
Alexander cf0cb60161 fix img APIs to working standard 2023-07-12 12:23:35 +02:00
Alexander 4a9e904fcf add initial img API endpoints 2023-07-12 11:35:43 +02:00
Alexander 50c17b2a2f randomize moved to API 2023-07-11 22:54:13 +02:00
Alexander 11e3b61b28 fix to working state 2023-07-11 18:51:34 +02:00
Alexander 3aa3f7949a initial implementation of placeholder images, thumbnails and blurring between using sharp 2023-07-11 18:47:29 +02:00
Alexander 73c1d13c37 Icon route added 2023-07-03 12:39:34 +02:00