Adds complete CalDAV integration for syncing appointments between the web app and Nextcloud calendars with real-time availability checking and conflict resolution. Core Features: - Bidirectional sync: Web ↔ Nextcloud calendars - Real-time availability checking with instant user feedback - Conflict detection (Nextcloud is source of truth) - Pending request workflow with 'REQUEST:' prefix for unconfirmed appointments - Hard time blocking - any calendar event blocks booking slots - Graceful degradation when CalDAV unavailable New Dependencies: - tsdav@^2.0.4 - TypeScript CalDAV client - ical.js@^1.5.0 - iCalendar format parser/generator Database Changes: - New table: artist_calendars (stores calendar configuration per artist) - New table: calendar_sync_logs (tracks all sync operations) - Added caldav_uid and caldav_etag columns to appointments table - Migration: sql/migrations/20250109_add_caldav_support.sql New Services: - lib/caldav-client.ts - Core CalDAV operations and iCalendar conversion - lib/calendar-sync.ts - Bidirectional sync logic with error handling New API Endpoints: - GET /api/caldav/availability - Real-time availability checking - POST /api/caldav/sync - Manual sync trigger (admin only) - GET/POST/PUT/DELETE /api/admin/calendars - Calendar configuration CRUD Updated Components: - app/api/appointments/route.ts - Integrated CalDAV sync on CRUD operations - components/booking-form.tsx - Added real-time availability indicator - hooks/use-availability.ts - Custom hook for debounced availability checking Documentation: - docs/CALDAV-SETUP.md - Complete setup guide with troubleshooting - docs/CALDAV-IMPLEMENTATION-SUMMARY.md - Technical implementation overview Pending Tasks (for future PRs): - Admin dashboard UI for calendar management - Background sync worker (Cloudflare Workers cron) - Unit and integration tests Tested with local database migration and linting checks passed.
144 lines
5.9 KiB
JSON
144 lines
5.9 KiB
JSON
{
|
|
"name": "my-v0-project",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"scripts": {
|
|
"build": "next build",
|
|
"dev": "next dev",
|
|
"dev:wrangler": "npm run pages:build && npx @opennextjs/cloudflare@latest preview",
|
|
"lint": "next lint",
|
|
"start": "next start",
|
|
"test": "vitest",
|
|
"test:ui": "vitest --ui",
|
|
"test:run": "vitest run",
|
|
"test:coverage": "vitest run --coverage",
|
|
"pages:build": "opennextjs-cloudflare build",
|
|
"preview": "opennextjs-cloudflare preview",
|
|
"deploy": "wrangler pages deploy .vercel/output/static",
|
|
"db:create": "wrangler d1 create united-tattoo",
|
|
"db:migrate": "wrangler d1 execute united-tattoo --file=./sql/schema.sql",
|
|
"db:migrate:local": "wrangler d1 execute united-tattoo --local --file=./sql/schema.sql",
|
|
"db:backup": "mkdir -p backups && wrangler d1 export united-tattoo --output=backups/d1-backup-$(date +%Y%m%d-%H%M).sql",
|
|
"db:backup:local": "mkdir -p backups && wrangler d1 export united-tattoo --local --output=backups/d1-backup-$(date +%Y%m%d-%H%M).sql",
|
|
"db:migrate:up:preview": "wrangler d1 execute united-tattoo --file=sql/migrations/20250918_0001_initial.sql",
|
|
"db:migrate:down:preview": "wrangler d1 execute united-tattoo --file=sql/migrations/20250918_0001_initial_down.sql",
|
|
"db:migrate:up:prod": "wrangler d1 execute united-tattoo --remote --file=sql/migrations/20250918_0001_initial.sql",
|
|
"db:migrate:down:prod": "wrangler d1 execute united-tattoo --remote --file=sql/migrations/20250918_0001_initial_down.sql",
|
|
"db:migrate:latest:preview": "node scripts/migrate-latest.mjs",
|
|
"db:migrate:latest:prod": "node scripts/migrate-latest.mjs --remote",
|
|
"db:studio": "wrangler d1 execute united-tattoo --command=\"SELECT name FROM sqlite_master WHERE type='table';\"",
|
|
"db:studio:local": "wrangler d1 execute united-tattoo --local --command=\"SELECT name FROM sqlite_master WHERE type='table';\"",
|
|
"bmad:refresh": "bmad-method install -f -i codex",
|
|
"bmad:list": "bmad-method list:agents",
|
|
"bmad:validate": "bmad-method validate",
|
|
"ci:lint": "npm run lint",
|
|
"ci:typecheck": "npx tsc --noEmit",
|
|
"ci:test": "npm run test:coverage",
|
|
"ci:build": "npm run pages:build",
|
|
"ci:budgets": "node scripts/budgets.mjs",
|
|
"format": "prettier --write .",
|
|
"format:check": "prettier --check .",
|
|
"format:staged": "prettier --write --staged",
|
|
"security:audit": "npm audit --audit-level=moderate",
|
|
"security:fix": "npm audit fix",
|
|
"security:outdated": "npm outdated",
|
|
"performance:lighthouse": "lhci autorun",
|
|
"performance:bundle": "npm run ci:build && npm run ci:budgets",
|
|
"deploy:preview": "CLOUDFLARE_ACCOUNT_ID=$CLOUDFLARE_ACCOUNT_ID npx @opennextjs/cloudflare deploy",
|
|
"deploy:production": "CLOUDFLARE_ACCOUNT_ID=$CLOUDFLARE_ACCOUNT_ID npx @opennextjs/cloudflare deploy"
|
|
},
|
|
"dependencies": {
|
|
"@auth/supabase-adapter": "^1.10.0",
|
|
"@aws-sdk/client-s3": "^3.890.0",
|
|
"@aws-sdk/s3-request-presigner": "^3.890.0",
|
|
"@hookform/resolvers": "^3.10.0",
|
|
"@opennextjs/cloudflare": "^1.8.2",
|
|
"@radix-ui/react-accordion": "latest",
|
|
"@radix-ui/react-alert-dialog": "1.1.4",
|
|
"@radix-ui/react-aspect-ratio": "1.1.1",
|
|
"@radix-ui/react-avatar": "1.1.2",
|
|
"@radix-ui/react-checkbox": "latest",
|
|
"@radix-ui/react-collapsible": "1.1.2",
|
|
"@radix-ui/react-context-menu": "latest",
|
|
"@radix-ui/react-dialog": "latest",
|
|
"@radix-ui/react-dropdown-menu": "latest",
|
|
"@radix-ui/react-hover-card": "1.1.4",
|
|
"@radix-ui/react-label": "2.1.1",
|
|
"@radix-ui/react-menubar": "latest",
|
|
"@radix-ui/react-navigation-menu": "latest",
|
|
"@radix-ui/react-popover": "1.1.4",
|
|
"@radix-ui/react-progress": "1.1.1",
|
|
"@radix-ui/react-radio-group": "latest",
|
|
"@radix-ui/react-scroll-area": "1.2.2",
|
|
"@radix-ui/react-select": "latest",
|
|
"@radix-ui/react-separator": "1.1.1",
|
|
"@radix-ui/react-slider": "1.2.2",
|
|
"@radix-ui/react-slot": "latest",
|
|
"@radix-ui/react-switch": "1.1.2",
|
|
"@radix-ui/react-tabs": "1.1.2",
|
|
"@radix-ui/react-toast": "1.2.4",
|
|
"@radix-ui/react-toggle": "1.1.1",
|
|
"@radix-ui/react-toggle-group": "1.1.1",
|
|
"@radix-ui/react-tooltip": "1.1.6",
|
|
"@studio-freight/lenis": "latest",
|
|
"@supabase/supabase-js": "^2.57.4",
|
|
"@tanstack/react-query": "^5.89.0",
|
|
"@tanstack/react-query-devtools": "^5.89.0",
|
|
"@tanstack/react-table": "^8.21.3",
|
|
"@vercel/analytics": "1.3.1",
|
|
"autoprefixer": "^10.4.20",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"cmdk": "latest",
|
|
"date-fns": "latest",
|
|
"embla-carousel-react": "8.5.1",
|
|
"geist": "^1.3.1",
|
|
"ical.js": "^1.5.0",
|
|
"input-otp": "latest",
|
|
"lucide-react": "^0.454.0",
|
|
"moment": "^2.30.1",
|
|
"next": "14.2.16",
|
|
"next-auth": "^4.24.11",
|
|
"next-themes": "^0.4.6",
|
|
"react": "^18",
|
|
"react-big-calendar": "^1.19.4",
|
|
"react-day-picker": "latest",
|
|
"react-dom": "^18",
|
|
"react-dropzone": "^14.3.8",
|
|
"react-hook-form": "^7.60.0",
|
|
"react-resizable-panels": "latest",
|
|
"recharts": "2.15.4",
|
|
"sonner": "^1.7.4",
|
|
"tailwind-merge": "^2.5.5",
|
|
"tailwindcss-animate": "^1.0.7",
|
|
"tsdav": "^2.1.5",
|
|
"vaul": "^0.9.9",
|
|
"zod": "3.25.67"
|
|
},
|
|
"devDependencies": {
|
|
"@tailwindcss/postcss": "^4.1.9",
|
|
"@testing-library/jest-dom": "^6.8.0",
|
|
"@testing-library/react": "^16.3.0",
|
|
"@testing-library/user-event": "^14.6.1",
|
|
"@types/node": "^22",
|
|
"@types/react": "^18",
|
|
"@types/react-big-calendar": "^1.16.3",
|
|
"@types/react-dom": "^18",
|
|
"@vitejs/plugin-react": "^5.0.3",
|
|
"@vitest/coverage-v8": "^3.2.4",
|
|
"eslint": "^8.57.0",
|
|
"eslint-config-next": "14.2.16",
|
|
"jsdom": "^27.0.0",
|
|
"postcss": "^8.5",
|
|
"tailwindcss": "^4.1.9",
|
|
"tw-animate-css": "1.3.3",
|
|
"typescript": "^5",
|
|
"vitest": "^3.2.4",
|
|
"wrangler": "^4.37.1"
|
|
},
|
|
"budgets": {
|
|
"TOTAL_STATIC_MAX_BYTES": 3000000,
|
|
"MAX_ASSET_BYTES": 1500000
|
|
}
|
|
}
|