2026-03-19 06:58:08 +08:00
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
|
import react from '@vitejs/plugin-react'
|
2026-03-22 05:21:23 +08:00
|
|
|
import { VitePWA } from 'vite-plugin-pwa'
|
2026-03-19 06:58:08 +08:00
|
|
|
|
|
|
|
|
export default defineConfig({
|
2026-03-22 05:21:23 +08:00
|
|
|
plugins: [
|
|
|
|
|
react(),
|
|
|
|
|
VitePWA({
|
|
|
|
|
registerType: 'autoUpdate',
|
|
|
|
|
workbox: {
|
2026-03-31 01:39:54 +08:00
|
|
|
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024,
|
2026-03-22 05:21:23 +08:00
|
|
|
globPatterns: ['**/*.{js,css,html,svg,png,woff,woff2,ttf}'],
|
|
|
|
|
navigateFallback: 'index.html',
|
2026-03-30 09:53:45 +08:00
|
|
|
navigateFallbackDenylist: [/^\/api/, /^\/uploads/, /^\/mcp/],
|
2026-03-22 05:21:23 +08:00
|
|
|
runtimeCaching: [
|
|
|
|
|
{
|
|
|
|
|
// Carto map tiles (default provider)
|
|
|
|
|
urlPattern: /^https:\/\/[a-d]\.basemaps\.cartocdn\.com\/.*/i,
|
|
|
|
|
handler: 'CacheFirst',
|
|
|
|
|
options: {
|
|
|
|
|
cacheName: 'map-tiles',
|
|
|
|
|
expiration: { maxEntries: 1000, maxAgeSeconds: 30 * 24 * 60 * 60 },
|
|
|
|
|
cacheableResponse: { statuses: [0, 200] },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
// OpenStreetMap tiles (fallback / alternative)
|
|
|
|
|
urlPattern: /^https:\/\/[a-c]\.tile\.openstreetmap\.org\/.*/i,
|
|
|
|
|
handler: 'CacheFirst',
|
|
|
|
|
options: {
|
|
|
|
|
cacheName: 'map-tiles',
|
|
|
|
|
expiration: { maxEntries: 1000, maxAgeSeconds: 30 * 24 * 60 * 60 },
|
|
|
|
|
cacheableResponse: { statuses: [0, 200] },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
// Leaflet CSS/JS from unpkg CDN
|
|
|
|
|
urlPattern: /^https:\/\/unpkg\.com\/.*/i,
|
|
|
|
|
handler: 'CacheFirst',
|
|
|
|
|
options: {
|
|
|
|
|
cacheName: 'cdn-libs',
|
|
|
|
|
expiration: { maxEntries: 30, maxAgeSeconds: 365 * 24 * 60 * 60 },
|
|
|
|
|
cacheableResponse: { statuses: [0, 200] },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
// API calls — prefer network, fall back to cache
|
|
|
|
|
urlPattern: /\/api\/.*/i,
|
|
|
|
|
handler: 'NetworkFirst',
|
|
|
|
|
options: {
|
|
|
|
|
cacheName: 'api-data',
|
|
|
|
|
expiration: { maxEntries: 200, maxAgeSeconds: 24 * 60 * 60 },
|
|
|
|
|
networkTimeoutSeconds: 5,
|
|
|
|
|
cacheableResponse: { statuses: [0, 200] },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
// Uploaded files (photos, covers, documents)
|
|
|
|
|
urlPattern: /\/uploads\/.*/i,
|
|
|
|
|
handler: 'CacheFirst',
|
|
|
|
|
options: {
|
|
|
|
|
cacheName: 'user-uploads',
|
|
|
|
|
expiration: { maxEntries: 300, maxAgeSeconds: 30 * 24 * 60 * 60 },
|
|
|
|
|
cacheableResponse: { statuses: [0, 200] },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
manifest: {
|
v2.6.2 — TREK Rebrand, OSM Enrichment, File Management, Hotel Bookings & Bug Fixes
Rebrand:
- NOMAD → TREK branding across all UI, translations, server, PWA manifest
- New TREK logos (dark/light, with/without icon)
- Liquid glass toast notifications
Bugs Fixed:
- HTTPS redirect now opt-in only (FORCE_HTTPS=true), fixes #33 #43 #52 #54 #55
- PDF export "Tag" fallback uses i18n, fixes #15
- Vacay sharing color collision detection, fixes #25
- Backup settings import fix (PR #47)
- Atlas country detection uses smallest bounding box, fixes #31
- JPY and zero-decimal currencies formatted correctly, fixes #32
- HTML lang="en" instead of hardcoded "de", fixes #34
- Duplicate translation keys removed
- setSelectedAssignmentId crash fixed
New Features:
- OSM enrichment: Overpass API for opening hours, Wikimedia Commons for photos
- Reverse geocoding on map right-click to add places
- OIDC config via environment variables (OIDC_ISSUER, OIDC_CLIENT_ID, etc.), fixes #48
- Multi-arch Docker build (ARM64 + AMD64), fixes #11
- File management: star, trash/restore, upload owner, assign to places/bookings, notes
- Markdown rendering in Collab Notes with expand modal, fixes #17
- Type-specific booking fields (flight: airline/number/airports, hotel: check-in/out/days, train: number/platform/seat), fixes #35
- Hotel bookings auto-create accommodations, bidirectional sync
- Multiple hotels per day with check-in/check-out color coding
- Ko-fi and Buy Me a Coffee support cards
- GitHub releases proxy with server-side caching
2026-03-28 23:38:08 +08:00
|
|
|
name: 'TREK \u2014 Travel Planner',
|
|
|
|
|
short_name: 'TREK',
|
|
|
|
|
description: 'Travel Resource & Exploration Kit',
|
2026-03-22 05:21:23 +08:00
|
|
|
theme_color: '#111827',
|
|
|
|
|
background_color: '#0f172a',
|
|
|
|
|
display: 'standalone',
|
|
|
|
|
scope: '/',
|
|
|
|
|
start_url: '/',
|
|
|
|
|
orientation: 'any',
|
|
|
|
|
categories: ['travel', 'navigation'],
|
|
|
|
|
icons: [
|
|
|
|
|
{ src: 'icons/apple-touch-icon-180x180.png', sizes: '180x180', type: 'image/png' },
|
|
|
|
|
{ src: 'icons/icon-192x192.png', sizes: '192x192', type: 'image/png' },
|
|
|
|
|
{ src: 'icons/icon-512x512.png', sizes: '512x512', type: 'image/png' },
|
|
|
|
|
{ src: 'icons/icon-512x512.png', sizes: '512x512', type: 'image/png', purpose: 'maskable' },
|
|
|
|
|
{ src: 'icons/icon.svg', sizes: 'any', type: 'image/svg+xml' },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
],
|
2026-03-19 06:58:08 +08:00
|
|
|
server: {
|
|
|
|
|
port: 5173,
|
|
|
|
|
proxy: {
|
|
|
|
|
'/api': {
|
|
|
|
|
target: 'http://localhost:3001',
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
},
|
|
|
|
|
'/uploads': {
|
|
|
|
|
target: 'http://localhost:3001',
|
|
|
|
|
changeOrigin: true,
|
v2.1.0 — Real-time collaboration, performance & security overhaul
Real-Time Collaboration (WebSocket):
- WebSocket server with JWT auth and trip-based rooms
- Live sync for all CRUD operations (places, assignments, days, notes, budget, packing, reservations, files)
- Socket-based exclusion to prevent duplicate updates
- Auto-reconnect with exponential backoff
- Assignment move sync between days
Performance:
- 16 database indexes on all foreign key columns
- N+1 query fix in places, assignments and days endpoints
- Marker clustering (react-leaflet-cluster) with configurable radius
- List virtualization (react-window) for places sidebar
- useMemo for filtered places
- SQLite WAL mode + busy_timeout for concurrent writes
- Weather API: server-side cache (1h forecast, 15min current) + client sessionStorage
- Google Places photos: persisted to DB after first fetch
- Google Details: 3-tier cache (memory → sessionStorage → API)
Security:
- CORS auto-configuration (production: same-origin, dev: open)
- API keys removed from /auth/me response
- Admin-only endpoint for reading API keys
- Path traversal prevention in cover image deletion
- JWT secret persisted to file (survives restarts)
- Avatar upload file extension whitelist
- API key fallback: normal users use admin's key without exposure
- Case-insensitive email login
Dark Mode:
- Fixed hardcoded colors across PackingList, Budget, ReservationModal, ReservationsPanel
- Mobile map buttons and sidebar sheets respect dark mode
- Cluster markers always dark
UI/UX:
- Redesigned login page with animated planes, stars and feature cards
- Admin: create user functionality with CustomSelect
- Mobile: day-picker popup for assigning places to days
- Mobile: touch-friendly reorder buttons (32px targets)
- Mobile: responsive text (shorter labels on small screens)
- Packing list: index-based category colors
- i18n: translated date picker placeholder, fixed German labels
- Default map tile: CartoDB Light
2026-03-19 19:44:22 +08:00
|
|
|
},
|
|
|
|
|
'/ws': {
|
|
|
|
|
target: 'http://localhost:3001',
|
|
|
|
|
ws: true,
|
2026-03-30 09:53:45 +08:00
|
|
|
},
|
|
|
|
|
'/mcp': {
|
|
|
|
|
target: 'http://localhost:3001',
|
|
|
|
|
changeOrigin: true,
|
2026-03-19 06:58:08 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|