From 33ee804d10bb67a3b12e9707f8a17153954a6400 Mon Sep 17 00:00:00 2001 From: TakCastel Date: Fri, 3 Jul 2026 02:22:13 +0200 Subject: [PATCH 1/3] =?UTF-8?q?Migre=20le=20front=20sur=20l'API=20Laravel?= =?UTF-8?q?=20et=20d=C3=A9commissionne=20Supabase,=20back/=20et=20Inertia.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - API de jeu complète (/api/v1) : forum (catégories, forums, sujets, messages, compteurs agrégés récursivement via ForumActivity), personnages (création, économie, inventaire, vaisseau), factions, profils, portail, stats, staff, heartbeat, uploads admin. - Front : tous les appels supabase-js remplacés par le client API Sanctum (apiFetch/apiMutate) ; suppression des clients Supabase et des scripts de simulation IA ; deps nettoyées. - Schéma : bio_hrp (profiles), monthly_income/expenses (characters), last_post_id (forums). - Legacy supprimé : back/ (Next.js), supabase/, docker/supabase, squelette Inertia (resources/js, routes web starter kit, tests associés, deps npm de l'api), corrige la dépréciation PDO PHP 8.5. - Infra : compose dev réduit à Postgres, compose prod front+api+db (Dockerfile Laravel Apache, à valider au prochain déploiement), nginx api.swor.fr → :8080, CI et deploy.sh sans Supabase. - Docs : README, DEPLOY.md, docs/LARAVEL.md, data-model à jour. - Tests : 21 tests API (dont flux forum, limites personnages, rôles admin) ; tsc et next build verts ; flux inscription → sujet vérifié en local. Co-Authored-By: Claude Fable 5 --- .dockerignore | 4 +- .env.example | 27 +- .env.production.example | 30 +- .github/workflows/ci.yml | 2 - .gitignore | 7 +- DEPLOY.md | 59 +- README.md | 130 +- api/Dockerfile | 26 + .../Api/V1/CharacterController.php | 129 + .../Api/V1/CommunityController.php | 34 + .../Api/V1/Forum/ForumCategoryController.php | 22 + .../Api/V1/Forum/ForumController.php | 150 + .../Api/V1/Forum/PostController.php | 56 + .../Api/V1/Forum/TopicController.php | 84 + .../Controllers/Api/V1/GroupController.php | 28 + .../Http/Controllers/Api/V1/MeController.php | 74 + .../Controllers/Api/V1/PortalController.php | 42 + .../Controllers/Api/V1/ProfileController.php | 24 + .../Controllers/Api/V1/StatsController.php | 49 + .../Controllers/Api/V1/UploadController.php | 28 + .../Auth/AuthenticatedSessionController.php | 51 - .../Auth/ConfirmablePasswordController.php | 41 - ...mailVerificationNotificationController.php | 24 - .../EmailVerificationPromptController.php | 22 - .../Auth/NewPasswordController.php | 69 - .../Auth/PasswordResetLinkController.php | 42 - .../Auth/RegisteredUserController.php | 52 - .../Settings/PasswordController.php | 43 - .../Settings/ProfileController.php | 63 - .../Http/Middleware/HandleInertiaRequests.php | 50 - api/app/Models/Character.php | 2 + api/app/Models/Forum.php | 24 + api/app/Models/Profile.php | 1 + api/app/Services/ForumActivity.php | 31 + api/bootstrap/app.php | 7 - api/components.json | 21 - api/composer.json | 6 +- api/composer.lock | 145 +- api/config/database.php | 5 +- ...t_fields_to_profiles_characters_forums.php | 41 + api/package-lock.json | 4162 ----------------- api/package.json | 41 - api/resources/css/app.css | 159 - api/resources/js/app.tsx | 29 - api/resources/js/components/app-content.tsx | 18 - api/resources/js/components/app-header.tsx | 182 - api/resources/js/components/app-logo-icon.tsx | 13 - api/resources/js/components/app-logo.tsx | 14 - api/resources/js/components/app-shell.tsx | 29 - .../js/components/app-sidebar-header.tsx | 14 - api/resources/js/components/app-sidebar.tsx | 56 - .../js/components/appearance-dropdown.tsx | 53 - .../js/components/appearance-tabs.tsx | 34 - api/resources/js/components/breadcrumbs.tsx | 31 - api/resources/js/components/delete-user.tsx | 90 - api/resources/js/components/heading-small.tsx | 8 - api/resources/js/components/heading.tsx | 10 - api/resources/js/components/icon.tsx | 10 - api/resources/js/components/input-error.tsx | 10 - api/resources/js/components/nav-footer.tsx | 33 - api/resources/js/components/nav-main.tsx | 24 - api/resources/js/components/nav-user.tsx | 36 - api/resources/js/components/text-link.tsx | 19 - api/resources/js/components/ui/alert.tsx | 36 - api/resources/js/components/ui/avatar.tsx | 30 - api/resources/js/components/ui/badge.tsx | 29 - api/resources/js/components/ui/breadcrumb.tsx | 57 - api/resources/js/components/ui/button.tsx | 43 - api/resources/js/components/ui/card.tsx | 35 - api/resources/js/components/ui/checkbox.tsx | 25 - .../js/components/ui/collapsible.tsx | 9 - api/resources/js/components/ui/dialog.tsx | 78 - .../js/components/ui/dropdown-menu.tsx | 175 - api/resources/js/components/ui/icon.tsx | 14 - api/resources/js/components/ui/input.tsx | 21 - api/resources/js/components/ui/label.tsx | 15 - .../js/components/ui/navigation-menu.tsx | 109 - .../js/components/ui/placeholder-pattern.tsx | 20 - api/resources/js/components/ui/select.tsx | 130 - api/resources/js/components/ui/separator.tsx | 19 - api/resources/js/components/ui/sheet.tsx | 90 - api/resources/js/components/ui/sidebar.tsx | 609 --- api/resources/js/components/ui/skeleton.tsx | 7 - .../js/components/ui/toggle-group.tsx | 49 - api/resources/js/components/ui/toggle.tsx | 39 - api/resources/js/components/ui/tooltip.tsx | 28 - api/resources/js/components/user-info.tsx | 22 - .../js/components/user-menu-content.tsx | 40 - api/resources/js/hooks/use-appearance.tsx | 46 - api/resources/js/hooks/use-initials.tsx | 12 - .../js/hooks/use-mobile-navigation.ts | 10 - api/resources/js/hooks/use-mobile.tsx | 22 - api/resources/js/layouts/app-layout.tsx | 13 - .../js/layouts/app/app-header-layout.tsx | 18 - .../js/layouts/app/app-sidebar-layout.tsx | 17 - api/resources/js/layouts/auth-layout.tsx | 9 - .../js/layouts/auth/auth-card-layout.tsx | 36 - .../js/layouts/auth/auth-simple-layout.tsx | 34 - .../js/layouts/auth/auth-split-layout.tsx | 45 - api/resources/js/layouts/settings/layout.tsx | 62 - api/resources/js/lib/utils.ts | 6 - .../js/pages/auth/confirm-password.tsx | 60 - .../js/pages/auth/forgot-password.tsx | 63 - api/resources/js/pages/auth/login.tsx | 104 - api/resources/js/pages/auth/register.tsx | 119 - .../js/pages/auth/reset-password.tsx | 98 - api/resources/js/pages/auth/verify-email.tsx | 41 - api/resources/js/pages/dashboard.tsx | 35 - .../js/pages/settings/appearance.tsx | 30 - api/resources/js/pages/settings/password.tsx | 128 - api/resources/js/pages/settings/profile.tsx | 120 - api/resources/js/pages/welcome.tsx | 36 - api/resources/js/ssr.jsx | 21 - api/resources/js/types/index.ts | 40 - api/resources/js/types/vite-env.d.ts | 1 - api/resources/views/.gitkeep | 0 api/resources/views/app.blade.php | 20 - api/routes/api.php | 58 + api/routes/auth.php | 56 - api/routes/settings.php | 21 - api/routes/web.php | 14 +- api/tests/Feature/Api/GameApiTest.php | 263 ++ api/tests/Feature/Auth/AuthenticationTest.php | 54 - .../Feature/Auth/EmailVerificationTest.php | 58 - .../Feature/Auth/PasswordConfirmationTest.php | 44 - api/tests/Feature/Auth/PasswordResetTest.php | 73 - api/tests/Feature/Auth/RegistrationTest.php | 31 - api/tests/Feature/DashboardTest.php | 24 - .../Feature/Settings/PasswordUpdateTest.php | 51 - .../Feature/Settings/ProfileUpdateTest.php | 99 - api/tsconfig.json | 118 - api/vite.config.js | 21 - back/Dockerfile | 14 - back/env.local.example | 6 - back/package.json | 29 - back/src/app/layout.tsx | 23 - back/src/app/page.tsx | 10 - back/tsconfig.json | 37 - deploy/nginx/swor.conf.example | 6 +- docker-compose.prod.yml | 65 +- docker-compose.yml | 36 +- docker/supabase/docker-compose.yml | 148 - docker/supabase/env.example | 36 - docker/supabase/kong.yml | 52 - .../volumes/db/init/00_cleanup_atlas.sql | 36 - docker/supabase/volumes/db/init/00_roles.sql | 56 - .../db/init/00z_set_authenticator_password.sh | 7 - .../volumes/db/init/01_core_schema.sql | 468 -- .../volumes/db/init/02_categories.sql | 19 - .../volumes/db/init/03_forums_hrp.sql | 60 - .../volumes/db/init/04_atlas_clone_wars.sql | 111 - .../volumes/db/init/05_atlas_civil_war.sql | 106 - .../volumes/db/init/06_atlas_new_republic.sql | 105 - docker/supabase/volumes/db/init/07_fakes.sql | 88 - .../volumes/db/init/08_ai_members.sql | 51 - docs/LARAVEL.md | 60 +- docs/data-model/README.md | 4 +- front/Dockerfile | 14 - front/Dockerfile.dev | 12 - front/Dockerfile.prod | 6 +- front/env.local.example | 6 - front/metadata.json | 5 - front/package.json | 12 +- front/scripts/clean-descriptions.ts | 62 - front/scripts/simulate-interactions.ts | 393 -- front/scripts/start-simulation.ts | 31 - front/scripts/update-planet-images.ts | 260 - front/src/app/auth/callback/route.ts | 15 - front/src/app/forum/admin/page.tsx | 70 +- front/src/app/forum/era/[eraId]/page.tsx | 118 +- .../character/[characterId]/economy/page.tsx | 52 +- .../[characterId]/inventory/page.tsx | 26 +- .../profile/character/[characterId]/page.tsx | 16 +- .../character/[characterId]/ship/page.tsx | 26 +- front/src/app/profile/character/new/page.tsx | 56 +- front/src/app/settings/page.tsx | 28 +- .../factions/components/FactionDetail.tsx | 29 +- .../factions/components/FactionsIndex.tsx | 14 +- .../features/forum/components/ForumDetail.tsx | 108 +- .../features/forum/components/ForumIndex.tsx | 31 +- .../features/forum/components/ReplyForm.tsx | 25 +- .../features/forum/components/TopicDetail.tsx | 79 +- .../features/forum/components/TopicForm.tsx | 35 +- .../portal/components/PortalContent.tsx | 100 +- .../profile/components/ProfileContent.tsx | 23 +- front/src/shared/components/Footer.tsx | 53 +- .../src/shared/contexts/CharacterContext.tsx | 89 +- front/src/shared/utils/api.ts | 29 +- front/src/shared/utils/supabase-server.ts | 53 - front/src/shared/utils/supabase.ts | 11 - package-lock.json | 1177 +---- package.json | 10 +- scripts/deploy.sh | 4 +- supabase/.gitignore | 8 - supabase/config.toml | 382 -- .../migrations/20240101000000_core_schema.sql | 348 -- supabase/seeds/00_cleanup_atlas.sql | 36 - supabase/seeds/01_categories.sql | 19 - supabase/seeds/02_forums_hrp.sql | 60 - supabase/seeds/03_atlas_clone_wars.sql | 111 - supabase/seeds/04_atlas_civil_war.sql | 106 - supabase/seeds/05_atlas_new_republic.sql | 105 - 202 files changed, 1655 insertions(+), 15011 deletions(-) create mode 100644 api/Dockerfile create mode 100644 api/app/Http/Controllers/Api/V1/CharacterController.php create mode 100644 api/app/Http/Controllers/Api/V1/CommunityController.php create mode 100644 api/app/Http/Controllers/Api/V1/Forum/ForumCategoryController.php create mode 100644 api/app/Http/Controllers/Api/V1/Forum/ForumController.php create mode 100644 api/app/Http/Controllers/Api/V1/Forum/PostController.php create mode 100644 api/app/Http/Controllers/Api/V1/Forum/TopicController.php create mode 100644 api/app/Http/Controllers/Api/V1/GroupController.php create mode 100644 api/app/Http/Controllers/Api/V1/MeController.php create mode 100644 api/app/Http/Controllers/Api/V1/PortalController.php create mode 100644 api/app/Http/Controllers/Api/V1/ProfileController.php create mode 100644 api/app/Http/Controllers/Api/V1/StatsController.php create mode 100644 api/app/Http/Controllers/Api/V1/UploadController.php delete mode 100644 api/app/Http/Controllers/Auth/AuthenticatedSessionController.php delete mode 100644 api/app/Http/Controllers/Auth/ConfirmablePasswordController.php delete mode 100644 api/app/Http/Controllers/Auth/EmailVerificationNotificationController.php delete mode 100644 api/app/Http/Controllers/Auth/EmailVerificationPromptController.php delete mode 100644 api/app/Http/Controllers/Auth/NewPasswordController.php delete mode 100644 api/app/Http/Controllers/Auth/PasswordResetLinkController.php delete mode 100644 api/app/Http/Controllers/Auth/RegisteredUserController.php delete mode 100644 api/app/Http/Controllers/Settings/PasswordController.php delete mode 100644 api/app/Http/Controllers/Settings/ProfileController.php delete mode 100644 api/app/Http/Middleware/HandleInertiaRequests.php create mode 100644 api/app/Services/ForumActivity.php delete mode 100644 api/components.json create mode 100644 api/database/migrations/2026_07_03_200000_add_front_fields_to_profiles_characters_forums.php delete mode 100644 api/package-lock.json delete mode 100644 api/package.json delete mode 100644 api/resources/css/app.css delete mode 100644 api/resources/js/app.tsx delete mode 100644 api/resources/js/components/app-content.tsx delete mode 100644 api/resources/js/components/app-header.tsx delete mode 100644 api/resources/js/components/app-logo-icon.tsx delete mode 100644 api/resources/js/components/app-logo.tsx delete mode 100644 api/resources/js/components/app-shell.tsx delete mode 100644 api/resources/js/components/app-sidebar-header.tsx delete mode 100644 api/resources/js/components/app-sidebar.tsx delete mode 100644 api/resources/js/components/appearance-dropdown.tsx delete mode 100644 api/resources/js/components/appearance-tabs.tsx delete mode 100644 api/resources/js/components/breadcrumbs.tsx delete mode 100644 api/resources/js/components/delete-user.tsx delete mode 100644 api/resources/js/components/heading-small.tsx delete mode 100644 api/resources/js/components/heading.tsx delete mode 100644 api/resources/js/components/icon.tsx delete mode 100644 api/resources/js/components/input-error.tsx delete mode 100644 api/resources/js/components/nav-footer.tsx delete mode 100644 api/resources/js/components/nav-main.tsx delete mode 100644 api/resources/js/components/nav-user.tsx delete mode 100644 api/resources/js/components/text-link.tsx delete mode 100644 api/resources/js/components/ui/alert.tsx delete mode 100644 api/resources/js/components/ui/avatar.tsx delete mode 100644 api/resources/js/components/ui/badge.tsx delete mode 100644 api/resources/js/components/ui/breadcrumb.tsx delete mode 100644 api/resources/js/components/ui/button.tsx delete mode 100644 api/resources/js/components/ui/card.tsx delete mode 100644 api/resources/js/components/ui/checkbox.tsx delete mode 100644 api/resources/js/components/ui/collapsible.tsx delete mode 100644 api/resources/js/components/ui/dialog.tsx delete mode 100644 api/resources/js/components/ui/dropdown-menu.tsx delete mode 100644 api/resources/js/components/ui/icon.tsx delete mode 100644 api/resources/js/components/ui/input.tsx delete mode 100644 api/resources/js/components/ui/label.tsx delete mode 100644 api/resources/js/components/ui/navigation-menu.tsx delete mode 100644 api/resources/js/components/ui/placeholder-pattern.tsx delete mode 100644 api/resources/js/components/ui/select.tsx delete mode 100644 api/resources/js/components/ui/separator.tsx delete mode 100644 api/resources/js/components/ui/sheet.tsx delete mode 100644 api/resources/js/components/ui/sidebar.tsx delete mode 100644 api/resources/js/components/ui/skeleton.tsx delete mode 100644 api/resources/js/components/ui/toggle-group.tsx delete mode 100644 api/resources/js/components/ui/toggle.tsx delete mode 100644 api/resources/js/components/ui/tooltip.tsx delete mode 100644 api/resources/js/components/user-info.tsx delete mode 100644 api/resources/js/components/user-menu-content.tsx delete mode 100644 api/resources/js/hooks/use-appearance.tsx delete mode 100644 api/resources/js/hooks/use-initials.tsx delete mode 100644 api/resources/js/hooks/use-mobile-navigation.ts delete mode 100644 api/resources/js/hooks/use-mobile.tsx delete mode 100644 api/resources/js/layouts/app-layout.tsx delete mode 100644 api/resources/js/layouts/app/app-header-layout.tsx delete mode 100644 api/resources/js/layouts/app/app-sidebar-layout.tsx delete mode 100644 api/resources/js/layouts/auth-layout.tsx delete mode 100644 api/resources/js/layouts/auth/auth-card-layout.tsx delete mode 100644 api/resources/js/layouts/auth/auth-simple-layout.tsx delete mode 100644 api/resources/js/layouts/auth/auth-split-layout.tsx delete mode 100644 api/resources/js/layouts/settings/layout.tsx delete mode 100644 api/resources/js/lib/utils.ts delete mode 100644 api/resources/js/pages/auth/confirm-password.tsx delete mode 100644 api/resources/js/pages/auth/forgot-password.tsx delete mode 100644 api/resources/js/pages/auth/login.tsx delete mode 100644 api/resources/js/pages/auth/register.tsx delete mode 100644 api/resources/js/pages/auth/reset-password.tsx delete mode 100644 api/resources/js/pages/auth/verify-email.tsx delete mode 100644 api/resources/js/pages/dashboard.tsx delete mode 100644 api/resources/js/pages/settings/appearance.tsx delete mode 100644 api/resources/js/pages/settings/password.tsx delete mode 100644 api/resources/js/pages/settings/profile.tsx delete mode 100644 api/resources/js/pages/welcome.tsx delete mode 100644 api/resources/js/ssr.jsx delete mode 100644 api/resources/js/types/index.ts delete mode 100644 api/resources/js/types/vite-env.d.ts create mode 100644 api/resources/views/.gitkeep delete mode 100644 api/resources/views/app.blade.php delete mode 100644 api/routes/auth.php delete mode 100644 api/routes/settings.php create mode 100644 api/tests/Feature/Api/GameApiTest.php delete mode 100644 api/tests/Feature/Auth/AuthenticationTest.php delete mode 100644 api/tests/Feature/Auth/EmailVerificationTest.php delete mode 100644 api/tests/Feature/Auth/PasswordConfirmationTest.php delete mode 100644 api/tests/Feature/Auth/PasswordResetTest.php delete mode 100644 api/tests/Feature/Auth/RegistrationTest.php delete mode 100644 api/tests/Feature/DashboardTest.php delete mode 100644 api/tests/Feature/Settings/PasswordUpdateTest.php delete mode 100644 api/tests/Feature/Settings/ProfileUpdateTest.php delete mode 100644 api/tsconfig.json delete mode 100644 api/vite.config.js delete mode 100644 back/Dockerfile delete mode 100644 back/env.local.example delete mode 100644 back/package.json delete mode 100644 back/src/app/layout.tsx delete mode 100644 back/src/app/page.tsx delete mode 100644 back/tsconfig.json delete mode 100644 docker/supabase/docker-compose.yml delete mode 100644 docker/supabase/env.example delete mode 100644 docker/supabase/kong.yml delete mode 100644 docker/supabase/volumes/db/init/00_cleanup_atlas.sql delete mode 100644 docker/supabase/volumes/db/init/00_roles.sql delete mode 100755 docker/supabase/volumes/db/init/00z_set_authenticator_password.sh delete mode 100644 docker/supabase/volumes/db/init/01_core_schema.sql delete mode 100644 docker/supabase/volumes/db/init/02_categories.sql delete mode 100644 docker/supabase/volumes/db/init/03_forums_hrp.sql delete mode 100644 docker/supabase/volumes/db/init/04_atlas_clone_wars.sql delete mode 100644 docker/supabase/volumes/db/init/05_atlas_civil_war.sql delete mode 100644 docker/supabase/volumes/db/init/06_atlas_new_republic.sql delete mode 100644 docker/supabase/volumes/db/init/07_fakes.sql delete mode 100644 docker/supabase/volumes/db/init/08_ai_members.sql delete mode 100644 front/Dockerfile delete mode 100644 front/Dockerfile.dev delete mode 100644 front/metadata.json delete mode 100644 front/scripts/clean-descriptions.ts delete mode 100644 front/scripts/simulate-interactions.ts delete mode 100644 front/scripts/start-simulation.ts delete mode 100644 front/scripts/update-planet-images.ts delete mode 100644 front/src/app/auth/callback/route.ts delete mode 100644 front/src/shared/utils/supabase-server.ts delete mode 100644 front/src/shared/utils/supabase.ts delete mode 100644 supabase/.gitignore delete mode 100644 supabase/config.toml delete mode 100644 supabase/migrations/20240101000000_core_schema.sql delete mode 100644 supabase/seeds/00_cleanup_atlas.sql delete mode 100644 supabase/seeds/01_categories.sql delete mode 100644 supabase/seeds/02_forums_hrp.sql delete mode 100644 supabase/seeds/03_atlas_clone_wars.sql delete mode 100644 supabase/seeds/04_atlas_civil_war.sql delete mode 100644 supabase/seeds/05_atlas_new_republic.sql diff --git a/.dockerignore b/.dockerignore index 014145e..3c8dc1f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,8 +6,8 @@ node_modules !.env.example !.env.production.example *.local -docker/supabase/volumes/db/data -docker/supabase/volumes/storage *.tsbuildinfo +api/vendor +api/storage/logs README.md DEPLOY.md diff --git a/.env.example b/.env.example index f9f339f..82f1d6a 100644 --- a/.env.example +++ b/.env.example @@ -1,28 +1,3 @@ -# ============================================================================= -# Docker Compose racine + Supabase legacy (front/ et back/ Next.js) -# ============================================================================= - +# Docker dev (Postgres uniquement) — voir docker-compose.yml POSTGRES_PASSWORD=postgres POSTGRES_PORT=54322 - -KONG_PORT=54321 -KONG_ADMIN_PORT=54325 -STUDIO_PORT=54323 - -JWT_SECRET=super-secret-jwt-token-with-at-least-32-characters-long -JWT_EXPIRY=3600 - -ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InN3b3ItdjIiLCJyb2xlIjoiYW5vbiIsImlhdCI6MTYwMDAwMDAwMCwiZXhwIjoyMDAwMDAwMDAwfQ.placeholder-anon-key -SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InN3b3ItdjIiLCJyb2xlIjoic2VydmljZV9yb2xlIiwiaWF0IjoxNjAwMDAwMDAwMCwiZXhwIjoyMDAwMDAwMDAwfQ.placeholder-service-key - -SITE_URL=http://localhost:3000 -OPERATOR_TOKEN=operator-token -ENABLE_EMAIL_SIGNUP=true -ENABLE_EMAIL_AUTOCONFIRM=true -SMTP_ADMIN_EMAIL=admin@example.com -SMTP_HOST=smtp.example.com -SMTP_PORT=587 -SMTP_USER=user -SMTP_PASS=pass -SMTP_SENDER_NAME=Supabase -DB_MAX_POOL_SIZE=20 diff --git a/.env.production.example b/.env.production.example index 2f2621e..d605838 100644 --- a/.env.production.example +++ b/.env.production.example @@ -3,30 +3,22 @@ # --- URLs publiques --- SITE_URL=https://swor.fr -PUBLIC_SUPABASE_URL=https://api.swor.fr +API_URL=https://api.swor.fr -# --- Supabase (mêmes valeurs que docker/supabase/.env) --- -POSTGRES_PASSWORD=change-me-strong-password -POSTGRES_PORT=54322 - -KONG_PORT=54321 -KONG_ADMIN_PORT=54325 -STUDIO_PORT=54323 +# --- Laravel --- +# Générer avec : cd api && php artisan key:generate --show +APP_KEY=base64:change-me +SANCTUM_STATEFUL_DOMAINS=swor.fr,www.swor.fr +SESSION_DOMAIN=.swor.fr -JWT_SECRET=change-me-jwt-secret-at-least-32-characters -JWT_EXPIRY=3600 - -ANON_KEY=your-anon-key-jwt -SERVICE_ROLE_KEY=your-service-role-key-jwt +# --- Postgres --- +POSTGRES_DB=swor +POSTGRES_USER=postgres +POSTGRES_PASSWORD=change-me-strong-password -# --- Auth / SMTP --- -OPERATOR_TOKEN=change-me-operator-token -ENABLE_EMAIL_SIGNUP=true -ENABLE_EMAIL_AUTOCONFIRM=false +# --- SMTP (emails transactionnels : vérification, reset password) --- SMTP_ADMIN_EMAIL=noreply@swor.fr SMTP_HOST=smtp.example.com SMTP_PORT=587 SMTP_USER= SMTP_PASS= -SMTP_SENDER_NAME=Swor -DB_MAX_POOL_SIZE=20 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4316775..1868440 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,5 +43,3 @@ jobs: run: npm run build -w front env: NEXT_PUBLIC_API_URL: http://localhost:8000 - NEXT_PUBLIC_SUPABASE_URL: http://localhost:54321 - NEXT_PUBLIC_SUPABASE_ANON_KEY: placeholder-anon-key-for-ci diff --git a/.gitignore b/.gitignore index 82109f3..4b52374 100644 --- a/.gitignore +++ b/.gitignore @@ -33,10 +33,6 @@ next-env.d.ts .env.local .env*.local -# Docker local volumes (Postgres data, storage) -docker/supabase/volumes/db/data/ -docker/supabase/volumes/storage/ - # TypeScript *.tsbuildinfo @@ -52,8 +48,7 @@ api/storage/*.key api/database/database.sqlite api/bootstrap/cache/*.php api/.env -api/node_modules/ -api/.phpunit.result.cache +.phpunit.result.cache /auth.json Homestead.json Homestead.yaml diff --git a/DEPLOY.md b/DEPLOY.md index 39dc5e7..28b431e 100644 --- a/DEPLOY.md +++ b/DEPLOY.md @@ -1,12 +1,16 @@ # Swor — déploiement VPS (Docker) -Guide pour remplacer l’ancienne app Laravel sur [swor.fr](https://swor.fr) par le stack Next.js + Supabase. +Stack production : front Next.js + API Laravel + PostgreSQL, derrière Nginx. + +> ⚠️ La stack Docker de production (`api/Dockerfile`, `docker-compose.prod.yml`) +> a été réécrite lors de la migration Laravel et n'a pas encore été validée sur +> le VPS — à tester au prochain déploiement. ## Prérequis serveur - Ubuntu 22.04+ (ou équivalent) - Docker et Docker Compose v2 -- Nginx (ou Caddy) pour le reverse proxy HTTPS +- Nginx pour le reverse proxy HTTPS - Nom de domaine pointant vers le VPS (`swor.fr`, `api.swor.fr`) ## 1. Préparer le serveur @@ -29,41 +33,29 @@ Depuis votre machine locale : ./scripts/deploy.sh user@votre-vps /opt/swor ``` -Ou manuellement : - -```bash -rsync -avz --delete \ - --exclude node_modules \ - --exclude .next \ - --exclude .git \ - --exclude docker/supabase/volumes/db/data \ - --exclude docker/supabase/volumes/storage \ - ./ user@votre-vps:/opt/swor/ -``` - -## 3. Configurer l’environnement +## 3. Configurer l'environnement Sur le VPS : ```bash cd /opt/swor cp .env.production.example .env.production -cp docker/supabase/env.example docker/supabase/.env ``` -Éditez `.env.production` et `docker/supabase/.env` : +Éditez `.env.production` : | Variable | Exemple | Rôle | |----------|---------|------| -| `SITE_URL` | `https://swor.fr` | URL du front (auth Supabase) | -| `PUBLIC_SUPABASE_URL` | `https://api.swor.fr` | URL API exposée au navigateur | -| `JWT_SECRET` | 32+ caractères | Secret JWT Supabase | -| `ANON_KEY` / `SERVICE_ROLE_KEY` | JWT signés | Clés API (identiques dans les deux fichiers) | +| `SITE_URL` | `https://swor.fr` | URL publique du front | +| `API_URL` | `https://api.swor.fr` | URL publique de l'API (injectée au build du front) | +| `APP_KEY` | `base64:…` | Clé Laravel (`php artisan key:generate --show`) | +| `SANCTUM_STATEFUL_DOMAINS` | `swor.fr,www.swor.fr` | Domaines autorisés pour la session SPA | +| `SESSION_DOMAIN` | `.swor.fr` | Portée du cookie de session | | `POSTGRES_PASSWORD` | mot de passe fort | Base de données | +| `SMTP_*` | — | Emails transactionnels | -Générez des clés JWT cohérentes avec votre `JWT_SECRET` (ou réutilisez celles du dev en changeant le secret). - -> **Important :** `PUBLIC_SUPABASE_URL` est injectée au **build** du front. Après modification, reconstruisez : `docker compose -f docker-compose.prod.yml --env-file .env.production up -d --build`. +> **Important :** `API_URL` est injectée au **build** du front. Après +> modification, reconstruisez : `npm run docker:prod:up`. ## 4. Lancer en production @@ -72,14 +64,13 @@ cd /opt/swor npm run docker:prod:up ``` -Services : +Les migrations Laravel s'exécutent automatiquement au démarrage du conteneur API. | Service | Port interne | Accès recommandé | |---------|--------------|------------------| -| Front Next.js | 3000 (localhost) | Via Nginx → `swor.fr` | -| Supabase API (Kong) | 54321 | Via Nginx → `api.swor.fr` | -| Supabase Studio | 54323 | Bloquer en prod ou VPN uniquement | -| PostgreSQL | 54322 | Localhost / jamais exposé | +| Front Next.js | 127.0.0.1:3000 | Via Nginx → `swor.fr` | +| API Laravel | 127.0.0.1:8080 | Via Nginx → `api.swor.fr` | +| PostgreSQL | interne Docker | Jamais exposé | ## 5. Nginx (HTTPS) @@ -109,19 +100,17 @@ sudo ufw allow 443 sudo ufw enable ``` -Ne pas ouvrir les ports 54321, 54322, 54323 publiquement — Nginx fait le proxy. +Ne pas ouvrir les ports 3000 et 8080 publiquement — Nginx fait le proxy. ## Dépannage ```bash # Logs -docker compose -f docker-compose.prod.yml --env-file .env.production logs -f front +docker compose -f docker-compose.prod.yml --env-file .env.production logs -f api # Rebuild complet docker compose -f docker-compose.prod.yml --env-file .env.production up -d --build --force-recreate -# Reset BDD (destructif) -docker compose -f docker-compose.prod.yml --env-file .env.production down -rm -rf docker/supabase/volumes/db/data -docker compose -f docker-compose.prod.yml --env-file .env.production up -d +# Console Laravel dans le conteneur +docker exec -it swor-api php artisan tinker ``` diff --git a/README.md b/README.md index fd997c8..62f3b11 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,8 @@ Site cible : [swor.fr](https://swor.fr) - **Factions** — groupes officiels et communautaires - **Univers** — wiki de la galaxie - **Règles** — règlement général, roleplay, personnages, économie -- **Authentification** — inscription, connexion, réinitialisation et suppression de compte (Supabase Auth) -- **Chat** — messagerie intégrée -- **Back-office** — interface d’administration (en cours de développement) +- **Authentification** — inscription, connexion, réinitialisation et suppression de compte (Fortify + Sanctum) +- **Back-office** — Filament sur `/admin` (à venir, #39) ## Architecture @@ -22,116 +21,64 @@ Monorepo avec **deux applications autonomes** ([ADR 0002](docs/adr/0002-frontend ``` swor/ -├── api/ # Backend Laravel (API JSON + Filament à venir) +├── api/ # Backend Laravel 12 (API JSON /api/v1, auth Sanctum) ├── front/ # Application joueur (Next.js, port 3000) -├── back/ # Back-office legacy (Next.js, port 3001 — remplacé par Filament) -├── supabase/ # Migrations SQL legacy -└── docker/ # Compose (Supabase, services) +├── deploy/ # Config Nginx d'exemple +└── docs/ # ADR, modèle de données, workflow ``` | Service | Port | Description | |----------------|-------|--------------------------------------| | API Laravel | 8000 | Auth, métier, JSON (`/api/v1/`) | | Front | 3000 | Application utilisateur (Next.js) | -| Back-office | 3001 | Admin legacy (en cours de remplacement)| -| Supabase API | 54321 | Kong legacy (migration en cours) | -| PostgreSQL | 54322 | Base de données | +| PostgreSQL | 54322 | Base de données (Docker) | -Voir [docs/LARAVEL.md](docs/LARAVEL.md) pour le démarrage local API + front. +Voir [docs/LARAVEL.md](docs/LARAVEL.md) pour le démarrage local détaillé. ## Prérequis +- PHP 8.2+ et [Composer](https://getcomposer.org/) - [Node.js](https://nodejs.org/) 20+ (voir `.nvmrc`) -- [Docker](https://www.docker.com/) et Docker Compose (pour l’environnement complet) -- npm (workspaces) +- [Docker](https://www.docker.com/) et Docker Compose (pour Postgres) ## Installation ```bash git clone swor cd swor -npm run setup +npm run setup # composer install + npm install + copie des .env +npm run docker:up # Postgres sur :54322 +cd api && php artisan key:generate && php artisan migrate --seed ``` -`npm run setup` installe les dépendances et copie les fichiers d’environnement d’exemple (sans écraser les fichiers existants). - -## Configuration - -Les fichiers d’exemple : - -| Fichier | Destination | Usage | -|---------|-------------|-------| -| `.env.example` | `.env` | Docker Compose racine (Supabase legacy) | -| `api/.env.example` | `api/.env` | API Laravel | -| `docker/supabase/env.example` | `docker/supabase/.env` | Stack Supabase | -| `front/env.local.example` | `front/.env.local` | Application front | -| `back/env.local.example` | `back/.env.local` | Back-office | - -Les clés `ANON_KEY` et `SERVICE_ROLE_KEY` doivent être identiques entre `.env`, `docker/supabase/.env` et les `.env.local` du front/back. - ## Lancement -### Avec Docker - -Depuis la racine du projet (Supabase + front) : - -```bash -npm run setup:env # si pas encore fait -npm run docker:up -``` - -- Front : [http://localhost:3000](http://localhost:3000) -- Supabase Studio : [http://localhost:54323](http://localhost:54323) - -### En local (développement) - -1. Démarrer Supabase seul : - -```bash -npm run setup:env -npm run docker:supabase:up -``` - -2. Lancer le front : - -```bash -npm run dev -# ou : npm run dev -w front -``` - -3. Lancer le back-office (optionnel) : - ```bash -npm run dev:back +npm run dev:api # API Laravel sur :8000 (serveur + queue + logs) +npm run dev:front # Front Next.js sur :3000 ``` ## Scripts utiles | Commande | Description | |----------|-------------| -| `npm run setup` | Installation + copie des `.env` d’exemple | -| `npm run dev` | Front en mode développement | -| `npm run dev:back` | Back-office en mode développement | -| `npm run build` | Build de production du front | +| `npm run setup` | Installation + copie des `.env` d'exemple | +| `npm run dev:api` | API Laravel en mode développement | +| `npm run dev:front` | Front en mode développement | | `npm run lint` | Vérification TypeScript du front | -| `npm run docker:up` | Démarre Supabase + front (Docker) | -| `npm run docker:down` | Arrête tous les conteneurs | -| `npm run docker:supabase:up` | Démarre uniquement Supabase | +| `npm run test:api` | Tests PHPUnit de l'API | +| `npm run docker:up` | Démarre Postgres (Docker) | | `npm run docker:prod:up` | Build et démarre la stack production | -| `npm run simulate -w front` | Simulation d’interactions forum via IA | -| `npm run simulate:watch -w front` | Simulation en boucle | - -La simulation IA nécessite `OPENAI_API_KEY` ou `GEMINI_API_KEY` dans `front/.env.local`, ainsi que `SUPABASE_SERVICE_ROLE_KEY`. ## Stack technique -**Front & Back** +**Front** - Next.js (App Router), React, TypeScript -- Tailwind CSS -- Lucide React +- Tailwind CSS, Lucide React **Backend & données** -- Supabase (PostgreSQL, Auth, Realtime, Storage) +- Laravel 12 (Fortify + Sanctum, sessions SPA par cookies) +- PostgreSQL - Schéma : personnages, forums hiérarchiques, factions, inventaire, économie, vaisseaux ## Structure du front @@ -139,42 +86,23 @@ La simulation IA nécessite `OPENAI_API_KEY` ou `GEMINI_API_KEY` dans `front/.en ``` front/src/ ├── app/ # Routes Next.js -├── features/ # Modules métier (forum, profile, factions, rules, universe, chat…) -└── shared/ # Composants UI, contextes, utilitaires Supabase +├── features/ # Modules métier (forum, profile, factions, rules, universe…) +└── shared/ # Composants UI, contextes, client API (shared/utils/api.ts) ``` ## Base de données -Le projet utilise trois emplacements SQL, chacun avec un rôle distinct : - -| Emplacement | Rôle | Quand c’est utilisé | -|-------------|------|---------------------| -| `supabase/migrations/` | **Schéma** — évolution de la structure (tables, enums, RLS) | Référence pour les changements de schéma ; compatible CLI Supabase | -| `supabase/seeds/` | **Données de démo** — catégories, atlas, forums HRP | Rechargement manuel ou via CLI | -| `docker/supabase/volumes/db/init/` | **Bootstrap Docker** — schéma + seeds + données dev | Exécuté **une seule fois** au premier démarrage du conteneur PostgreSQL | - -### Règle de synchronisation - -1. **Modifier le schéma** dans `supabase/migrations/`, puis recopier le SQL dans `docker/supabase/volumes/db/init/01_core_schema.sql` (ou le fichier init correspondant). -2. **Modifier les données de seed** dans `supabase/seeds/`, puis recopier dans les fichiers `docker/supabase/volumes/db/init/` homologues (`02_categories.sql`, `03_forums_hrp.sql`, etc.). -3. Les fichiers **uniquement dans `init/`** (`00_roles.sql`, `07_fakes.sql`, `08_ai_members.sql`) sont spécifiques à l’environnement Docker local et n’ont pas d’équivalent dans `seeds/`. - -### Réinitialiser la base locale - -Pour rejouer les scripts `init/`, supprimez le volume Postgres puis redémarrez : +Le schéma vit dans `api/database/migrations/`, les données de démo dans +`api/database/seeders/`. ```bash -npm run docker:supabase:down -rm -rf docker/supabase/volumes/db/data -npm run docker:supabase:up +cd api && php artisan migrate:fresh --seed # réinitialiser la base locale ``` -> **Note :** `supabase/config.toml` cible la CLI Supabase officielle (Postgres 17). Le stack Docker custom utilise Postgres 15. En développement, privilégiez le Docker custom (`npm run docker:supabase:up`). - ## Licence Projet privé — tous droits réservés. ## Déploiement (production VPS) -Voir [DEPLOY.md](./DEPLOY.md) pour le déploiement Docker sur un VPS (Nginx, HTTPS, Supabase). +Voir [DEPLOY.md](./DEPLOY.md) pour le déploiement Docker sur un VPS (Nginx, HTTPS). diff --git a/api/Dockerfile b/api/Dockerfile new file mode 100644 index 0000000..5658fc7 --- /dev/null +++ b/api/Dockerfile @@ -0,0 +1,26 @@ +# --- Dépendances Composer --- +FROM composer:2 AS vendor +WORKDIR /app +COPY composer.json composer.lock ./ +RUN composer install --no-dev --no-scripts --no-autoloader --prefer-dist --no-interaction +COPY . . +RUN composer dump-autoload --optimize --no-dev + +# --- Image finale : Apache + PHP --- +FROM php:8.4-apache + +RUN apt-get update \ + && apt-get install -y --no-install-recommends libpq-dev libzip-dev unzip \ + && docker-php-ext-install pdo_pgsql zip opcache \ + && rm -rf /var/lib/apt/lists/* + +RUN a2enmod rewrite \ + && sed -ri 's!/var/www/html!/var/www/html/public!g' /etc/apache2/sites-available/000-default.conf + +WORKDIR /var/www/html +COPY --from=vendor /app ./ +RUN chown -R www-data:www-data storage bootstrap/cache + +EXPOSE 80 + +CMD ["sh", "-c", "php artisan migrate --force && php artisan config:cache && php artisan route:cache && apache2-foreground"] diff --git a/api/app/Http/Controllers/Api/V1/CharacterController.php b/api/app/Http/Controllers/Api/V1/CharacterController.php new file mode 100644 index 0000000..604d016 --- /dev/null +++ b/api/app/Http/Controllers/Api/V1/CharacterController.php @@ -0,0 +1,129 @@ +json($character->load('mainGroup')); + } + + public function store(Request $request): JsonResponse + { + $user = $request->user(); + + $data = $request->validate([ + 'name' => ['required', 'string', 'max:255'], + 'species' => ['required', 'string', 'max:255'], + 'class' => ['required', 'string', 'max:255'], + 'occupation_category' => ['required', 'string', 'max:255'], + 'era' => ['required', 'string', 'max:255'], + 'main_group_id' => ['nullable', 'uuid', 'exists:groups,id'], + 'physical_description' => ['nullable', 'string'], + 'personality' => ['nullable', 'string'], + 'background_history' => ['nullable', 'string'], + 'likes' => ['nullable', 'string'], + 'dislikes' => ['nullable', 'string'], + 'skills' => ['nullable', 'array', 'max:3'], + 'skills.*' => ['string', 'max:255'], + 'starting_item' => ['nullable', 'string', 'max:255'], + ]); + + if (Character::where('user_id', $user->id)->count() >= self::MAX_CHARACTERS_PER_USER) { + return response()->json([ + 'message' => 'Limite de '.self::MAX_CHARACTERS_PER_USER.' personnages atteinte.', + ], 422); + } + + $group = isset($data['main_group_id']) + ? Faction::find($data['main_group_id']) + : null; + + $character = DB::transaction(function () use ($user, $data, $group) { + $character = Character::create([ + ...$data, + 'user_id' => $user->id, + 'faction' => $group?->name ?? 'Indépendant', + 'credits' => 2000, + 'skills' => $data['skills'] ?? [], + ]); + + if ($group !== null) { + GroupMember::create([ + 'group_id' => $group->id, + 'character_id' => $character->id, + 'role' => 'member', + ]); + } + + $user->profile()->update(['active_character_id' => $character->id]); + + return $character; + }); + + return response()->json($character->load('mainGroup'), 201); + } + + public function update(Request $request, Character $character): JsonResponse + { + $user = $request->user(); + + if ($character->user_id !== $user->id && ! $user->isAdmin()) { + return response()->json(['message' => 'Ce personnage ne vous appartient pas.'], 403); + } + + $data = $request->validate([ + 'monthly_income' => ['sometimes', 'integer', 'min:0'], + 'monthly_expenses' => ['sometimes', 'integer', 'min:0'], + 'avatar' => ['nullable', 'string', 'max:2048'], + 'physical_description' => ['nullable', 'string'], + 'personality' => ['nullable', 'string'], + 'background_history' => ['nullable', 'string'], + 'likes' => ['nullable', 'string'], + 'dislikes' => ['nullable', 'string'], + ]); + + $character->update($data); + + return response()->json($character->load('mainGroup')); + } + + public function inventory(Character $character): JsonResponse + { + return response()->json([ + 'starting_item' => $character->starting_item, + 'items' => $character->inventory()->with('item')->get(), + ]); + } + + public function ship(Character $character): JsonResponse + { + $ship = $character->ship()->with('modules')->first(); + + return response()->json(['ship' => $ship]); + } + + public function economy(Character $character): JsonResponse + { + return response()->json([ + 'credits' => $character->credits, + 'monthly_income' => $character->monthly_income, + 'monthly_expenses' => $character->monthly_expenses, + 'history' => $character->economyHistory() + ->orderByDesc('date') + ->orderByDesc('created_at') + ->get(), + ]); + } +} diff --git a/api/app/Http/Controllers/Api/V1/CommunityController.php b/api/app/Http/Controllers/Api/V1/CommunityController.php new file mode 100644 index 0000000..0070041 --- /dev/null +++ b/api/app/Http/Controllers/Api/V1/CommunityController.php @@ -0,0 +1,34 @@ +orderBy('role') + ->get(['id', 'username', 'role', 'avatar_url']); + + return response()->json($staff); + } + + public function online(): JsonResponse + { + $profiles = Profile::where('last_seen', '>', now()->subMinutes(15)) + ->with('activeCharacter:id,main_group_id', 'activeCharacter.mainGroup:id,color') + ->limit(50) + ->get(['id', 'username', 'role', 'active_character_id', 'last_seen']); + + return response()->json($profiles); + } +} diff --git a/api/app/Http/Controllers/Api/V1/Forum/ForumCategoryController.php b/api/app/Http/Controllers/Api/V1/Forum/ForumCategoryController.php new file mode 100644 index 0000000..d6e9083 --- /dev/null +++ b/api/app/Http/Controllers/Api/V1/Forum/ForumCategoryController.php @@ -0,0 +1,22 @@ +json( + ForumCategory::orderBy('display_order')->get() + ); + } + + public function show(ForumCategory $category): JsonResponse + { + return response()->json($category); + } +} diff --git a/api/app/Http/Controllers/Api/V1/Forum/ForumController.php b/api/app/Http/Controllers/Api/V1/Forum/ForumController.php new file mode 100644 index 0000000..a8162a0 --- /dev/null +++ b/api/app/Http/Controllers/Api/V1/Forum/ForumController.php @@ -0,0 +1,150 @@ +when($request->filled('category_id'), fn ($q) => $q->where('category_id', $request->integer('category_id'))) + ->when($request->boolean('root'), fn ($q) => $q->whereNull('parent_id')) + ->orderBy('display_order') + ->get(); + + return response()->json($forums); + } + + public function show(Forum $forum): JsonResponse + { + $forum->load([ + 'category:id,name,era', + 'children' => fn ($q) => $q->orderBy('display_order'), + 'children.lastPost:id,topic_id,author_id,character_id,created_at', + 'children.lastPost.topic:id,title', + 'children.lastPost.author:id,username', + 'children.lastPost.character:id,name,main_group_id', + 'children.lastPost.character.mainGroup:id,color', + ]); + + $topics = Topic::where('forum_id', $forum->id) + ->with([ + 'author:id,username,avatar_url', + 'character:id,name,avatar,main_group_id', + 'character.mainGroup:id,name,color', + 'lastPost:id,topic_id,author_id,character_id,created_at', + 'lastPost.author:id,username', + 'lastPost.character:id,name,main_group_id', + 'lastPost.character.mainGroup:id,color', + ]) + ->orderByDesc('is_pinned') + ->orderByDesc('updated_at') + ->get(); + + return response()->json([ + 'forum' => $forum, + 'ancestors' => collect($forum->ancestors()) + ->map(fn (Forum $f) => $f->only(['id', 'name', 'parent_id'])) + ->values(), + 'topics' => $topics, + ]); + } + + public function store(Request $request): JsonResponse + { + $data = $request->validate([ + 'name' => ['required', 'string', 'max:255'], + 'description' => ['nullable', 'string'], + 'category_id' => ['required', 'integer', 'exists:forum_categories,id'], + 'parent_id' => ['nullable', 'integer', 'exists:forums,id'], + 'type' => ['required', Rule::enum(ForumType::class)], + 'display_order' => ['nullable', 'integer'], + 'image_url' => ['nullable', 'string', 'max:2048'], + 'header_image_url' => ['nullable', 'string', 'max:2048'], + ]); + + $forum = Forum::create($data); + + return response()->json($forum, 201); + } + + public function update(Request $request, Forum $forum): JsonResponse + { + $data = $request->validate([ + 'name' => ['sometimes', 'required', 'string', 'max:255'], + 'description' => ['nullable', 'string'], + 'category_id' => ['sometimes', 'integer', 'exists:forum_categories,id'], + 'parent_id' => ['nullable', 'integer', 'exists:forums,id', Rule::notIn([$forum->id])], + 'type' => ['sometimes', Rule::enum(ForumType::class)], + 'display_order' => ['sometimes', 'integer'], + 'image_url' => ['nullable', 'string', 'max:2048'], + 'header_image_url' => ['nullable', 'string', 'max:2048'], + ]); + + $forum->update($data); + + return response()->json($forum); + } + + /** + * Supprime un forum (et ses descendants, en cascade) après avoir + * déplacé leurs sujets vers le forum indiqué par move_topics_to. + */ + public function destroy(Request $request, Forum $forum): JsonResponse + { + $data = $request->validate([ + 'move_topics_to' => ['required', 'integer', 'exists:forums,id'], + ]); + + $subtreeIds = $this->subtreeIds($forum); + + if (in_array((int) $data['move_topics_to'], $subtreeIds, true)) { + return response()->json([ + 'message' => 'Le forum de destination ne peut pas faire partie des forums supprimés.', + ], 422); + } + + DB::transaction(function () use ($forum, $subtreeIds, $data) { + Topic::whereIn('forum_id', $subtreeIds)->update(['forum_id' => $data['move_topics_to']]); + $forum->delete(); + }); + + return response()->json(null, 204); + } + + /** + * @return array + */ + private function subtreeIds(Forum $forum): array + { + $ids = [$forum->id]; + $frontier = [$forum->id]; + + while ($frontier !== []) { + $frontier = Forum::whereIn('parent_id', $frontier)->pluck('id')->all(); + $ids = array_merge($ids, $frontier); + } + + return $ids; + } +} diff --git a/api/app/Http/Controllers/Api/V1/Forum/PostController.php b/api/app/Http/Controllers/Api/V1/Forum/PostController.php new file mode 100644 index 0000000..f47d099 --- /dev/null +++ b/api/app/Http/Controllers/Api/V1/Forum/PostController.php @@ -0,0 +1,56 @@ +user(); + + if ($topic->is_locked && ! $user->isModerator()) { + return response()->json(['message' => 'Ce sujet est verrouillé.'], 403); + } + + $data = $request->validate([ + 'content' => ['required', 'string'], + 'character_id' => [ + 'nullable', + 'uuid', + Rule::exists('characters', 'id')->where('user_id', $user->id), + ], + ]); + + $post = DB::transaction(function () use ($topic, $user, $data) { + $post = Post::create([ + 'topic_id' => $topic->id, + 'author_id' => $user->id, + 'character_id' => $data['character_id'] ?? null, + 'content' => trim($data['content']), + ]); + + $topic->update([ + 'replies_count' => $topic->replies_count + 1, + 'last_post_id' => $post->id, + ]); + + ForumActivity::record($topic->forum, $post, isNewTopic: false); + + return $post; + }); + + return response()->json( + $post->load('author:id,username', 'character:id,name'), + 201 + ); + } +} diff --git a/api/app/Http/Controllers/Api/V1/Forum/TopicController.php b/api/app/Http/Controllers/Api/V1/Forum/TopicController.php new file mode 100644 index 0000000..e45a71d --- /dev/null +++ b/api/app/Http/Controllers/Api/V1/Forum/TopicController.php @@ -0,0 +1,84 @@ +load([ + 'forum:id,name,parent_id,category_id', + 'forum.category:id,name,era', + 'posts' => fn ($q) => $q->orderBy('created_at'), + 'posts.author:id,username,avatar_url,role,title_hrp', + 'posts.character:id,name,avatar,class,main_group_id', + 'posts.character.mainGroup:id,name,color', + ]); + + return response()->json([ + 'topic' => $topic, + 'ancestors' => $topic->forum + ? collect($topic->forum->ancestors()) + ->map(fn (Forum $f) => $f->only(['id', 'name', 'parent_id'])) + ->values() + : [], + ]); + } + + public function store(Request $request, Forum $forum): JsonResponse + { + $user = $request->user(); + + $data = $request->validate([ + 'title' => ['required', 'string', 'max:255'], + 'content' => ['required', 'string'], + 'character_id' => [ + 'nullable', + 'uuid', + Rule::exists('characters', 'id')->where('user_id', $user->id), + ], + ]); + + $topic = DB::transaction(function () use ($forum, $user, $data) { + $topic = Topic::create([ + 'forum_id' => $forum->id, + 'author_id' => $user->id, + 'character_id' => $data['character_id'] ?? null, + 'title' => trim($data['title']), + ]); + + $post = Post::create([ + 'topic_id' => $topic->id, + 'author_id' => $user->id, + 'character_id' => $data['character_id'] ?? null, + 'content' => trim($data['content']), + ]); + + $topic->update(['last_post_id' => $post->id]); + + ForumActivity::record($forum, $post, isNewTopic: true); + + return $topic; + }); + + return response()->json($topic->load('author:id,username', 'character:id,name'), 201); + } + + public function incrementViews(Topic $topic): Response + { + $topic->increment('views_count'); + + return response()->noContent(); + } +} diff --git a/api/app/Http/Controllers/Api/V1/GroupController.php b/api/app/Http/Controllers/Api/V1/GroupController.php new file mode 100644 index 0000000..0a37a1c --- /dev/null +++ b/api/app/Http/Controllers/Api/V1/GroupController.php @@ -0,0 +1,28 @@ +when($request->filled('era'), fn ($q) => $q->where('era', $request->string('era'))) + ->orderBy('name') + ->get(); + + return response()->json($groups); + } + + public function show(Faction $group): JsonResponse + { + $group->load(['characters' => fn ($q) => $q->withCount('posts')]); + + return response()->json($group); + } +} diff --git a/api/app/Http/Controllers/Api/V1/MeController.php b/api/app/Http/Controllers/Api/V1/MeController.php new file mode 100644 index 0000000..c69c689 --- /dev/null +++ b/api/app/Http/Controllers/Api/V1/MeController.php @@ -0,0 +1,74 @@ +profile($request)->load([ + 'activeCharacter:id,name,avatar,era,faction,credits,main_group_id', + 'activeCharacter.mainGroup:id,name,color', + ]); + $profile->loadCount('posts'); + + return response()->json($profile); + } + + public function updateProfile(Request $request): JsonResponse + { + $profile = $this->profile($request); + + $data = $request->validate([ + 'username' => [ + 'sometimes', 'required', 'string', 'max:255', + Rule::unique('profiles', 'username')->ignore($profile->id), + ], + 'avatar_url' => ['nullable', 'string', 'max:2048'], + 'bio_hrp' => ['nullable', 'string', 'max:5000'], + ]); + + $profile->update($data); + + return response()->json($profile); + } + + public function setActiveCharacter(Request $request): JsonResponse + { + $profile = $this->profile($request); + + $data = $request->validate([ + 'character_id' => [ + 'nullable', + 'uuid', + Rule::exists('characters', 'id')->where('user_id', $profile->id), + ], + ]); + + $profile->update(['active_character_id' => $data['character_id'] ?? null]); + + return $this->show($request); + } + + public function heartbeat(Request $request): Response + { + $this->profile($request)->update(['last_seen' => now()]); + + return response()->noContent(); + } + + private function profile(Request $request): Profile + { + return $request->user()->profile()->firstOrFail(); + } +} diff --git a/api/app/Http/Controllers/Api/V1/PortalController.php b/api/app/Http/Controllers/Api/V1/PortalController.php new file mode 100644 index 0000000..7c45623 --- /dev/null +++ b/api/app/Http/Controllers/Api/V1/PortalController.php @@ -0,0 +1,42 @@ +orderByDesc('created_at') + ->limit(5) + ->get(['id', 'title', 'created_at', 'author_id', 'forum_id']); + + $newsForum = Forum::where('name', 'Annonces')->first(['id', 'name']); + + $news = $newsForum + ? Topic::where('forum_id', $newsForum->id) + ->with([ + 'author:id,username', + 'posts' => fn ($q) => $q->orderBy('created_at')->limit(1), + ]) + ->orderByDesc('created_at') + ->limit(3) + ->get(['id', 'title', 'created_at', 'author_id', 'forum_id']) + : collect(); + + return response()->json([ + 'latest_topics' => $latestTopics, + 'news' => $news, + 'news_forum_id' => $newsForum?->id, + ]); + } +} diff --git a/api/app/Http/Controllers/Api/V1/ProfileController.php b/api/app/Http/Controllers/Api/V1/ProfileController.php new file mode 100644 index 0000000..ecb8fc1 --- /dev/null +++ b/api/app/Http/Controllers/Api/V1/ProfileController.php @@ -0,0 +1,24 @@ +loadCount('posts'); + + return response()->json($profile); + } + + public function characters(Profile $profile): JsonResponse + { + return response()->json( + $profile->characters()->with('mainGroup')->get() + ); + } +} diff --git a/api/app/Http/Controllers/Api/V1/StatsController.php b/api/app/Http/Controllers/Api/V1/StatsController.php new file mode 100644 index 0000000..35b8702 --- /dev/null +++ b/api/app/Http/Controllers/Api/V1/StatsController.php @@ -0,0 +1,49 @@ +orderByDesc('created_at') + ->first(['id', 'username']); + + $memberCounts = Character::whereNotNull('main_group_id') + ->selectRaw('main_group_id, count(*) as member_count') + ->groupBy('main_group_id') + ->pluck('member_count', 'main_group_id'); + + $factionsByEra = Faction::orderBy('name') + ->get(['id', 'name', 'color', 'era']) + ->groupBy(fn (Faction $g) => $g->era ?? 'Général') + ->map(fn ($groups) => $groups->map(fn (Faction $g) => [ + 'id' => $g->id, + 'name' => $g->name, + 'color' => $g->color, + 'member_count' => (int) ($memberCounts[$g->id] ?? 0), + ])->values()); + + return response()->json([ + 'total_users' => Profile::count(), + 'total_topics' => Topic::count(), + 'total_posts' => Post::count(), + 'online_count' => Profile::where('last_seen', '>', now()->subMinutes(15))->count(), + 'guests_count' => 0, + 'online_record' => null, + 'latest_user' => $latestUser, + 'birthdays_today' => [], + 'birthdays_week' => [], + 'factions_by_era' => $factionsByEra, + ]); + } +} diff --git a/api/app/Http/Controllers/Api/V1/UploadController.php b/api/app/Http/Controllers/Api/V1/UploadController.php new file mode 100644 index 0000000..701b068 --- /dev/null +++ b/api/app/Http/Controllers/Api/V1/UploadController.php @@ -0,0 +1,28 @@ +validate([ + 'file' => ['required', 'image', 'max:4096'], + 'folder' => ['required', Rule::in(self::FOLDERS)], + ]); + + $path = $data['file']->store($data['folder'], 'public'); + + return response()->json([ + 'url' => Storage::disk('public')->url($path), + ], 201); + } +} diff --git a/api/app/Http/Controllers/Auth/AuthenticatedSessionController.php b/api/app/Http/Controllers/Auth/AuthenticatedSessionController.php deleted file mode 100644 index b4a48d9..0000000 --- a/api/app/Http/Controllers/Auth/AuthenticatedSessionController.php +++ /dev/null @@ -1,51 +0,0 @@ - Route::has('password.request'), - 'status' => $request->session()->get('status'), - ]); - } - - /** - * Handle an incoming authentication request. - */ - public function store(LoginRequest $request): RedirectResponse - { - $request->authenticate(); - - $request->session()->regenerate(); - - return redirect()->intended(route('dashboard', absolute: false)); - } - - /** - * Destroy an authenticated session. - */ - public function destroy(Request $request): RedirectResponse - { - Auth::guard('web')->logout(); - - $request->session()->invalidate(); - $request->session()->regenerateToken(); - - return redirect('/'); - } -} diff --git a/api/app/Http/Controllers/Auth/ConfirmablePasswordController.php b/api/app/Http/Controllers/Auth/ConfirmablePasswordController.php deleted file mode 100644 index c729706..0000000 --- a/api/app/Http/Controllers/Auth/ConfirmablePasswordController.php +++ /dev/null @@ -1,41 +0,0 @@ -validate([ - 'email' => $request->user()->email, - 'password' => $request->password, - ])) { - throw ValidationException::withMessages([ - 'password' => __('auth.password'), - ]); - } - - $request->session()->put('auth.password_confirmed_at', time()); - - return redirect()->intended(route('dashboard', absolute: false)); - } -} diff --git a/api/app/Http/Controllers/Auth/EmailVerificationNotificationController.php b/api/app/Http/Controllers/Auth/EmailVerificationNotificationController.php deleted file mode 100644 index f64fa9b..0000000 --- a/api/app/Http/Controllers/Auth/EmailVerificationNotificationController.php +++ /dev/null @@ -1,24 +0,0 @@ -user()->hasVerifiedEmail()) { - return redirect()->intended(route('dashboard', absolute: false)); - } - - $request->user()->sendEmailVerificationNotification(); - - return back()->with('status', 'verification-link-sent'); - } -} diff --git a/api/app/Http/Controllers/Auth/EmailVerificationPromptController.php b/api/app/Http/Controllers/Auth/EmailVerificationPromptController.php deleted file mode 100644 index 672f7cf..0000000 --- a/api/app/Http/Controllers/Auth/EmailVerificationPromptController.php +++ /dev/null @@ -1,22 +0,0 @@ -user()->hasVerifiedEmail() - ? redirect()->intended(route('dashboard', absolute: false)) - : Inertia::render('auth/verify-email', ['status' => $request->session()->get('status')]); - } -} diff --git a/api/app/Http/Controllers/Auth/NewPasswordController.php b/api/app/Http/Controllers/Auth/NewPasswordController.php deleted file mode 100644 index 264a0e9..0000000 --- a/api/app/Http/Controllers/Auth/NewPasswordController.php +++ /dev/null @@ -1,69 +0,0 @@ - $request->email, - 'token' => $request->route('token'), - ]); - } - - /** - * Handle an incoming new password request. - * - * @throws ValidationException - */ - public function store(Request $request): RedirectResponse - { - $request->validate([ - 'token' => 'required', - 'email' => 'required|email', - 'password' => ['required', 'confirmed', Rules\Password::defaults()], - ]); - - // Here we will attempt to reset the user's password. If it is successful we - // will update the password on an actual user model and persist it to the - // database. Otherwise we will parse the error and return the response. - $status = Password::reset( - $request->only('email', 'password', 'password_confirmation', 'token'), - function ($user) use ($request) { - $user->forceFill([ - 'password' => Hash::make($request->password), - 'remember_token' => Str::random(60), - ])->save(); - - event(new PasswordReset($user)); - } - ); - - // If the password was successfully reset, we will redirect the user back to - // the application's home authenticated view. If there is an error we can - // redirect them back to where they came from with their error message. - if ($status == Password::PasswordReset) { - return to_route('login')->with('status', __($status)); - } - - throw ValidationException::withMessages([ - 'email' => [__($status)], - ]); - } -} diff --git a/api/app/Http/Controllers/Auth/PasswordResetLinkController.php b/api/app/Http/Controllers/Auth/PasswordResetLinkController.php deleted file mode 100644 index 74d46f9..0000000 --- a/api/app/Http/Controllers/Auth/PasswordResetLinkController.php +++ /dev/null @@ -1,42 +0,0 @@ - $request->session()->get('status'), - ]); - } - - /** - * Handle an incoming password reset link request. - * - * @throws ValidationException - */ - public function store(Request $request): RedirectResponse - { - $request->validate([ - 'email' => 'required|email', - ]); - - Password::sendResetLink( - $request->only('email') - ); - - return back()->with('status', __('A reset link will be sent if the account exists.')); - } -} diff --git a/api/app/Http/Controllers/Auth/RegisteredUserController.php b/api/app/Http/Controllers/Auth/RegisteredUserController.php deleted file mode 100644 index 3c4cc27..0000000 --- a/api/app/Http/Controllers/Auth/RegisteredUserController.php +++ /dev/null @@ -1,52 +0,0 @@ -validate([ - 'name' => 'required|string|max:255', - 'email' => 'required|string|lowercase|email|max:255|unique:'.User::class, - 'password' => ['required', 'confirmed', Rules\Password::defaults()], - ]); - - $user = User::create([ - 'name' => $request->name, - 'email' => $request->email, - 'password' => Hash::make($request->password), - ]); - - event(new Registered($user)); - - Auth::login($user); - - return to_route('dashboard'); - } -} diff --git a/api/app/Http/Controllers/Settings/PasswordController.php b/api/app/Http/Controllers/Settings/PasswordController.php deleted file mode 100644 index 8469bc8..0000000 --- a/api/app/Http/Controllers/Settings/PasswordController.php +++ /dev/null @@ -1,43 +0,0 @@ - $request->user() instanceof MustVerifyEmail, - 'status' => $request->session()->get('status'), - ]); - } - - /** - * Update the user's password. - */ - public function update(Request $request): RedirectResponse - { - $validated = $request->validate([ - 'current_password' => ['required', 'current_password'], - 'password' => ['required', Password::defaults(), 'confirmed'], - ]); - - $request->user()->update([ - 'password' => Hash::make($validated['password']), - ]); - - return back(); - } -} diff --git a/api/app/Http/Controllers/Settings/ProfileController.php b/api/app/Http/Controllers/Settings/ProfileController.php deleted file mode 100644 index a6cb7e1..0000000 --- a/api/app/Http/Controllers/Settings/ProfileController.php +++ /dev/null @@ -1,63 +0,0 @@ - $request->user() instanceof MustVerifyEmail, - 'status' => $request->session()->get('status'), - ]); - } - - /** - * Update the user's profile settings. - */ - public function update(ProfileUpdateRequest $request): RedirectResponse - { - $request->user()->fill($request->validated()); - - if ($request->user()->isDirty('email')) { - $request->user()->email_verified_at = null; - } - - $request->user()->save(); - - return to_route('profile.edit'); - } - - /** - * Delete the user's account. - */ - public function destroy(Request $request): RedirectResponse - { - $request->validate([ - 'password' => ['required', 'current_password'], - ]); - - $user = $request->user(); - - Auth::logout(); - - $user->delete(); - - $request->session()->invalidate(); - $request->session()->regenerateToken(); - - return redirect('/'); - } -} diff --git a/api/app/Http/Middleware/HandleInertiaRequests.php b/api/app/Http/Middleware/HandleInertiaRequests.php deleted file mode 100644 index 5119b57..0000000 --- a/api/app/Http/Middleware/HandleInertiaRequests.php +++ /dev/null @@ -1,50 +0,0 @@ - - */ - public function share(Request $request): array - { - [$message, $author] = str(Inspiring::quotes()->random())->explode('-'); - - return array_merge(parent::share($request), [ - ...parent::share($request), - 'name' => config('app.name'), - 'quote' => ['message' => trim($message), 'author' => trim($author)], - 'auth' => [ - 'user' => $request->user(), - ], - ]); - } -} diff --git a/api/app/Models/Character.php b/api/app/Models/Character.php index 8052a82..72ab59e 100644 --- a/api/app/Models/Character.php +++ b/api/app/Models/Character.php @@ -23,6 +23,8 @@ class Character extends Model 'occupation_category', 'avatar', 'credits', + 'monthly_income', + 'monthly_expenses', 'main_group_id', 'current_location_id', 'is_traveling', diff --git a/api/app/Models/Forum.php b/api/app/Models/Forum.php index 8c1a432..37ddd29 100644 --- a/api/app/Models/Forum.php +++ b/api/app/Models/Forum.php @@ -23,6 +23,7 @@ class Forum extends Model 'display_order', 'topics_count', 'posts_count', + 'last_post_id', ]; protected function casts(): array @@ -58,4 +59,27 @@ public function charactersHere(): HasMany { return $this->hasMany(Character::class, 'current_location_id'); } + + public function lastPost(): BelongsTo + { + return $this->belongsTo(Post::class, 'last_post_id'); + } + + /** + * Remonte la chaîne des parents (du plus proche à la racine). + * + * @return array + */ + public function ancestors(): array + { + $ancestors = []; + $current = $this->parent; + + while ($current !== null) { + $ancestors[] = $current; + $current = $current->parent; + } + + return $ancestors; + } } diff --git a/api/app/Models/Profile.php b/api/app/Models/Profile.php index 77f3567..a25e294 100644 --- a/api/app/Models/Profile.php +++ b/api/app/Models/Profile.php @@ -18,6 +18,7 @@ class Profile extends Model 'username', 'avatar_url', 'title_hrp', + 'bio_hrp', 'role', 'active_character_id', 'last_seen', diff --git a/api/app/Services/ForumActivity.php b/api/app/Services/ForumActivity.php new file mode 100644 index 0000000..d58d9ef --- /dev/null +++ b/api/app/Services/ForumActivity.php @@ -0,0 +1,31 @@ +posts_count += 1; + + if ($isNewTopic) { + $current->topics_count += 1; + } + + $current->last_post_id = $post->id; + $current->save(); + + $current = $current->parent; + } + } +} diff --git a/api/bootstrap/app.php b/api/bootstrap/app.php index 15615f1..ae59fec 100644 --- a/api/bootstrap/app.php +++ b/api/bootstrap/app.php @@ -1,10 +1,8 @@ withRouting( @@ -15,11 +13,6 @@ ) ->withMiddleware(function (Middleware $middleware) { $middleware->statefulApi(); - - $middleware->web(append: [ - HandleInertiaRequests::class, - AddLinkHeadersForPreloadedAssets::class, - ]); }) ->withExceptions(function (Exceptions $exceptions) { // diff --git a/api/components.json b/api/components.json deleted file mode 100644 index 14024c7..0000000 --- a/api/components.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema.json", - "style": "default", - "rsc": false, - "tsx": true, - "tailwind": { - "config": "tailwind.config.js", - "css": "resources/css/app.css", - "baseColor": "neutral", - "cssVariables": true, - "prefix": "" - }, - "aliases": { - "components": "@/components", - "utils": "@/lib/utils", - "ui": "@/components/ui", - "lib": "@/lib", - "hooks": "@/hooks" - }, - "iconLibrary": "lucide" -} diff --git a/api/composer.json b/api/composer.json index 36ccbd3..8e998f7 100644 --- a/api/composer.json +++ b/api/composer.json @@ -10,12 +10,10 @@ "license": "MIT", "require": { "php": "^8.2", - "inertiajs/inertia-laravel": "^2.0", "laravel/fortify": "^1.37", "laravel/framework": "^12.0", "laravel/sanctum": "^4.3", - "laravel/tinker": "^2.10.1", - "tightenco/ziggy": "^2.4" + "laravel/tinker": "^2.10.1" }, "require-dev": { "fakerphp/faker": "^1.23", @@ -56,7 +54,7 @@ ], "dev": [ "Composer\\Config::disableProcessTimeout", - "npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite" + "npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" --names=server,queue,logs" ] }, "extra": { diff --git a/api/composer.lock b/api/composer.lock index d731e2c..357aea9 100644 --- a/api/composer.lock +++ b/api/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b929e7d9a590952a61c211dbee807c88", + "content-hash": "caba420742e86168a47742ee8c3cdc2d", "packages": [ { "name": "bacon/bacon-qr-code", @@ -1211,79 +1211,6 @@ ], "time": "2026-06-23T13:02:23+00:00" }, - { - "name": "inertiajs/inertia-laravel", - "version": "v2.0.24", - "source": { - "type": "git", - "url": "https://github.com/inertiajs/inertia-laravel.git", - "reference": "ea345adad12f110edbbc4bef03b69c2374a535d4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/inertiajs/inertia-laravel/zipball/ea345adad12f110edbbc4bef03b69c2374a535d4", - "reference": "ea345adad12f110edbbc4bef03b69c2374a535d4", - "shasum": "" - }, - "require": { - "ext-json": "*", - "laravel/framework": "^10.0|^11.0|^12.0|^13.0", - "php": "^8.1.0", - "symfony/console": "^6.2|^7.0|^8.0" - }, - "conflict": { - "laravel/boost": "<2.2.0" - }, - "require-dev": { - "guzzlehttp/guzzle": "^7.2", - "larastan/larastan": "^3.0", - "laravel/pint": "^1.16", - "mockery/mockery": "^1.3.3", - "orchestra/testbench": "^8.0|^9.2|^10.0|^11.0", - "phpunit/phpunit": "^10.4|^11.5|^12.0", - "roave/security-advisories": "dev-master" - }, - "suggest": { - "ext-pcntl": "Recommended when running the Inertia SSR server via the `inertia:start-ssr` artisan command." - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Inertia\\ServiceProvider" - ] - } - }, - "autoload": { - "files": [ - "./helpers.php" - ], - "psr-4": { - "Inertia\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jonathan Reinink", - "email": "jonathan@reinink.ca", - "homepage": "https://reinink.ca" - } - ], - "description": "The Laravel adapter for Inertia.js.", - "keywords": [ - "inertia", - "laravel" - ], - "support": { - "issues": "https://github.com/inertiajs/inertia-laravel/issues", - "source": "https://github.com/inertiajs/inertia-laravel/tree/v2.0.24" - }, - "time": "2026-04-10T14:36:44+00:00" - }, { "name": "laravel/fortify", "version": "v1.37.2", @@ -7095,76 +7022,6 @@ ], "time": "2026-06-08T20:24:16+00:00" }, - { - "name": "tightenco/ziggy", - "version": "v2.6.3", - "source": { - "type": "git", - "url": "https://github.com/tighten/ziggy.git", - "reference": "14c5744f155182188419f7729d96e0ed7225e73b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/tighten/ziggy/zipball/14c5744f155182188419f7729d96e0ed7225e73b", - "reference": "14c5744f155182188419f7729d96e0ed7225e73b", - "shasum": "" - }, - "require": { - "ext-json": "*", - "laravel/framework": ">=9.0", - "php": ">=8.1" - }, - "require-dev": { - "laravel/folio": "^1.1", - "orchestra/testbench": "^8.0 || ^9.0 || ^10.0 || ^11.0", - "pestphp/pest": "^2.0 || ^3.0 || ^4.0", - "pestphp/pest-plugin-laravel": "^2.0 || ^3.0 || ^4.0" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Tighten\\Ziggy\\ZiggyServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Tighten\\Ziggy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Coulbourne", - "email": "daniel@tighten.co" - }, - { - "name": "Jake Bathman", - "email": "jake@tighten.co" - }, - { - "name": "Jacob Baker-Kretzmar", - "email": "jacob@tighten.co" - } - ], - "description": "Use your Laravel named routes in JavaScript.", - "homepage": "https://github.com/tighten/ziggy", - "keywords": [ - "Ziggy", - "javascript", - "laravel", - "routes" - ], - "support": { - "issues": "https://github.com/tighten/ziggy/issues", - "source": "https://github.com/tighten/ziggy/tree/v2.6.3" - }, - "time": "2026-06-23T21:57:52+00:00" - }, { "name": "tijsverkoyen/css-to-inline-styles", "version": "v2.4.0", diff --git a/api/config/database.php b/api/config/database.php index 8910562..a345903 100644 --- a/api/config/database.php +++ b/api/config/database.php @@ -1,6 +1,7 @@ true, 'engine' => null, 'options' => extension_loaded('pdo_mysql') ? array_filter([ - PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), + Mysql::ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), ]) : [], ], @@ -78,7 +79,7 @@ 'strict' => true, 'engine' => null, 'options' => extension_loaded('pdo_mysql') ? array_filter([ - PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), + Mysql::ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), ]) : [], ], diff --git a/api/database/migrations/2026_07_03_200000_add_front_fields_to_profiles_characters_forums.php b/api/database/migrations/2026_07_03_200000_add_front_fields_to_profiles_characters_forums.php new file mode 100644 index 0000000..a3dff26 --- /dev/null +++ b/api/database/migrations/2026_07_03_200000_add_front_fields_to_profiles_characters_forums.php @@ -0,0 +1,41 @@ +text('bio_hrp')->nullable()->after('title_hrp'); + }); + + Schema::table('characters', function (Blueprint $table) { + $table->integer('monthly_income')->default(0)->after('credits'); + $table->integer('monthly_expenses')->default(0)->after('monthly_income'); + }); + + Schema::table('forums', function (Blueprint $table) { + $table->unsignedBigInteger('last_post_id')->nullable()->after('posts_count'); + $table->foreign('last_post_id')->references('id')->on('posts')->nullOnDelete(); + }); + } + + public function down(): void + { + Schema::table('forums', function (Blueprint $table) { + $table->dropForeign(['last_post_id']); + $table->dropColumn('last_post_id'); + }); + + Schema::table('characters', function (Blueprint $table) { + $table->dropColumn(['monthly_income', 'monthly_expenses']); + }); + + Schema::table('profiles', function (Blueprint $table) { + $table->dropColumn('bio_hrp'); + }); + } +}; diff --git a/api/package-lock.json b/api/package-lock.json deleted file mode 100644 index 95c1288..0000000 --- a/api/package-lock.json +++ /dev/null @@ -1,4162 +0,0 @@ -{ - "name": "api", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "dependencies": { - "@headlessui/react": "^2.2.0", - "@inertiajs/react": "^2.0.0", - "@radix-ui/react-avatar": "^1.1.3", - "@radix-ui/react-checkbox": "^1.1.4", - "@radix-ui/react-collapsible": "^1.1.3", - "@radix-ui/react-dialog": "^1.1.6", - "@radix-ui/react-dropdown-menu": "^2.1.6", - "@radix-ui/react-label": "^2.1.2", - "@radix-ui/react-navigation-menu": "^1.2.5", - "@radix-ui/react-select": "^2.1.6", - "@radix-ui/react-separator": "^1.1.2", - "@radix-ui/react-slot": "^1.1.2", - "@radix-ui/react-toggle": "^1.1.2", - "@radix-ui/react-toggle-group": "^1.1.2", - "@radix-ui/react-tooltip": "^1.1.8", - "@tailwindcss/vite": "^4.0.6", - "@types/react": "^19.0.3", - "@types/react-dom": "^19.0.2", - "@vitejs/plugin-react": "^4.3.4", - "class-variance-authority": "^0.7.1", - "clsx": "^2.1.1", - "laravel-vite-plugin": "^1.0", - "lucide-react": "^0.475.0", - "react": "^19.0.0", - "react-dom": "^19.0.0", - "tailwind-merge": "^3.0.1", - "tailwindcss": "^4.0.0", - "tailwindcss-animate": "^1.0.7", - "typescript": "^5.7.2", - "vite": "^6.0" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", - "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", - "license": "MIT", - "dependencies": { - "@babel/helper-validator-identifier": "^7.29.7", - "js-tokens": "^4.0.0", - "picocolors": "^1.1.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/compat-data": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", - "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/core": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", - "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", - "license": "MIT", - "peer": true, - "dependencies": { - "@babel/code-frame": "^7.29.7", - "@babel/generator": "^7.29.7", - "@babel/helper-compilation-targets": "^7.29.7", - "@babel/helper-module-transforms": "^7.29.7", - "@babel/helpers": "^7.29.7", - "@babel/parser": "^7.29.7", - "@babel/template": "^7.29.7", - "@babel/traverse": "^7.29.7", - "@babel/types": "^7.29.7", - "@jridgewell/remapping": "^2.3.5", - "convert-source-map": "^2.0.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.3", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" - } - }, - "node_modules/@babel/generator": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz", - "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==", - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.29.7", - "@babel/types": "^7.29.7", - "@jridgewell/gen-mapping": "^0.3.12", - "@jridgewell/trace-mapping": "^0.3.28", - "jsesc": "^3.0.2" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-compilation-targets": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", - "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", - "license": "MIT", - "dependencies": { - "@babel/compat-data": "^7.29.7", - "@babel/helper-validator-option": "^7.29.7", - "browserslist": "^4.24.0", - "lru-cache": "^5.1.1", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-globals": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", - "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-imports": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", - "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", - "license": "MIT", - "dependencies": { - "@babel/traverse": "^7.29.7", - "@babel/types": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-transforms": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", - "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", - "license": "MIT", - "dependencies": { - "@babel/helper-module-imports": "^7.29.7", - "@babel/helper-validator-identifier": "^7.29.7", - "@babel/traverse": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-plugin-utils": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz", - "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-string-parser": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", - "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", - "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-option": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", - "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helpers": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz", - "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==", - "license": "MIT", - "dependencies": { - "@babel/template": "^7.29.7", - "@babel/types": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/parser": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz", - "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==", - "license": "MIT", - "dependencies": { - "@babel/types": "^7.29.7" - }, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/plugin-transform-react-jsx-self": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.29.7.tgz", - "integrity": "sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw==", - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-react-jsx-source": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.29.7.tgz", - "integrity": "sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q==", - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/template": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", - "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.29.7", - "@babel/parser": "^7.29.7", - "@babel/types": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz", - "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==", - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.29.7", - "@babel/generator": "^7.29.7", - "@babel/helper-globals": "^7.29.7", - "@babel/parser": "^7.29.7", - "@babel/template": "^7.29.7", - "@babel/types": "^7.29.7", - "debug": "^4.3.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/types": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz", - "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==", - "license": "MIT", - "dependencies": { - "@babel/helper-string-parser": "^7.29.7", - "@babel/helper-validator-identifier": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", - "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", - "cpu": [ - "ppc64" - ], - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz", - "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", - "cpu": [ - "arm" - ], - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", - "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz", - "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", - "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", - "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", - "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", - "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", - "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", - "cpu": [ - "arm" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", - "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", - "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", - "cpu": [ - "ia32" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", - "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", - "cpu": [ - "loong64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", - "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", - "cpu": [ - "mips64el" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", - "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", - "cpu": [ - "ppc64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", - "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", - "cpu": [ - "riscv64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", - "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", - "cpu": [ - "s390x" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", - "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", - "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", - "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", - "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", - "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", - "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", - "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", - "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", - "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", - "cpu": [ - "ia32" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", - "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@floating-ui/core": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.5.tgz", - "integrity": "sha512-1Ih4WTWyw0+lKyFMcBHGbb5U5FtuHJuujoyyr5zTaWS5EYMeT6Jb2AuDeftsCsEuchO+mM2ij5+q9crhydzLhQ==", - "license": "MIT", - "dependencies": { - "@floating-ui/utils": "^0.2.11" - } - }, - "node_modules/@floating-ui/dom": { - "version": "1.7.6", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.6.tgz", - "integrity": "sha512-9gZSAI5XM36880PPMm//9dfiEngYoC6Am2izES1FF406YFsjvyBMmeJ2g4SAju3xWwtuynNRFL2s9hgxpLI5SQ==", - "license": "MIT", - "dependencies": { - "@floating-ui/core": "^1.7.5", - "@floating-ui/utils": "^0.2.11" - } - }, - "node_modules/@floating-ui/react": { - "version": "0.26.28", - "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.26.28.tgz", - "integrity": "sha512-yORQuuAtVpiRjpMhdc0wJj06b9JFjrYF4qp96j++v2NBpbi6SEGF7donUJ3TMieerQ6qVkAv1tgr7L4r5roTqw==", - "license": "MIT", - "dependencies": { - "@floating-ui/react-dom": "^2.1.2", - "@floating-ui/utils": "^0.2.8", - "tabbable": "^6.0.0" - }, - "peerDependencies": { - "react": ">=16.8.0", - "react-dom": ">=16.8.0" - } - }, - "node_modules/@floating-ui/react-dom": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.8.tgz", - "integrity": "sha512-cC52bHwM/n/CxS87FH0yWdngEZrjdtLW/qVruo68qg+prK7ZQ4YGdut2GyDVpoGeAYe/h899rVeOVm6Oi40k2A==", - "license": "MIT", - "dependencies": { - "@floating-ui/dom": "^1.7.6" - }, - "peerDependencies": { - "react": ">=16.8.0", - "react-dom": ">=16.8.0" - } - }, - "node_modules/@floating-ui/utils": { - "version": "0.2.11", - "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.11.tgz", - "integrity": "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==", - "license": "MIT" - }, - "node_modules/@headlessui/react": { - "version": "2.2.10", - "resolved": "https://registry.npmjs.org/@headlessui/react/-/react-2.2.10.tgz", - "integrity": "sha512-5pVLNK9wlpxTUTy9GpgbX/SdcRh+HBnPktjM2wbiLTH4p+2EPHBO1aoSryUCuKUIItdDWO9ITlhUL8UnUN/oIA==", - "license": "MIT", - "dependencies": { - "@floating-ui/react": "^0.26.16", - "@react-aria/focus": "^3.20.2", - "@react-aria/interactions": "^3.25.0", - "@tanstack/react-virtual": "^3.13.9", - "use-sync-external-store": "^1.5.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "react": "^18 || ^19 || ^19.0.0-rc", - "react-dom": "^18 || ^19 || ^19.0.0-rc" - } - }, - "node_modules/@inertiajs/core": { - "version": "2.3.27", - "resolved": "https://registry.npmjs.org/@inertiajs/core/-/core-2.3.27.tgz", - "integrity": "sha512-UYoKpg/OrpcoLqb9nDmQh+QhQ4dI5B2ZT3LfhSfNWnRUcpMyd/MagcoVeck3zDfEcQscvFMhiZUD/lXpbuixQQ==", - "license": "MIT", - "dependencies": { - "@types/lodash-es": "^4.17.12", - "axios": "^1.16.0", - "laravel-precognition": "^1.0.2", - "lodash-es": "^4.18.1", - "qs": "^6.15.0" - } - }, - "node_modules/@inertiajs/react": { - "version": "2.3.27", - "resolved": "https://registry.npmjs.org/@inertiajs/react/-/react-2.3.27.tgz", - "integrity": "sha512-30YVDJAbTGYH1/Hb0ThYpuxA152m2FZWhP8yqXC8GD2Hq1rID8Mp3wxnclEJADksYvGkmEC9jW2a2yAgpTrczw==", - "license": "MIT", - "dependencies": { - "@inertiajs/core": "2.3.27", - "@types/lodash-es": "^4.17.12", - "laravel-precognition": "^1.0.2", - "lodash-es": "^4.18.1" - }, - "peerDependencies": { - "react": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", - "react-dom": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - } - }, - "node_modules/@internationalized/date": { - "version": "3.12.2", - "resolved": "https://registry.npmjs.org/@internationalized/date/-/date-3.12.2.tgz", - "integrity": "sha512-FY1Y+H64NDs+HAF6omlnWxm3mEpfgaCSWtL5l551ZZfImA+kGjPFgrnJrGjH6lfmLL0g8Z/mBu1R3kufeCp6Jw==", - "license": "Apache-2.0", - "dependencies": { - "@swc/helpers": "^0.5.0" - } - }, - "node_modules/@internationalized/number": { - "version": "3.6.7", - "resolved": "https://registry.npmjs.org/@internationalized/number/-/number-3.6.7.tgz", - "integrity": "sha512-3ji1fcrT+FPAK86UqEhB/psHixYo6niWPJtt7+qRaYFynt/BaJG8GhAPimtWUpEiVSTq8ZM8L5psMxGquiB/Vg==", - "license": "Apache-2.0", - "dependencies": { - "@swc/helpers": "^0.5.0" - } - }, - "node_modules/@internationalized/string": { - "version": "3.2.9", - "resolved": "https://registry.npmjs.org/@internationalized/string/-/string-3.2.9.tgz", - "integrity": "sha512-kzP/M/mbQxODlmOt4bIQZ2SBVUWUSqMLXooXixnX7noche8WHaQcA+nwFN1K2KCF/cp+LDUhcJsCicwkvhD1pg==", - "license": "Apache-2.0", - "dependencies": { - "@swc/helpers": "^0.5.0" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.13", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", - "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "node_modules/@jridgewell/remapping": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", - "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", - "license": "MIT", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", - "license": "MIT" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.31", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", - "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@radix-ui/number": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.1.2.tgz", - "integrity": "sha512-ceTwaxc4I5IOi97DgCotl3pqiyRGvffcc0oOsE2dQYaJOFIDsDt4VWG6xEbg1QePv9QWausCEIppud/tJ1wNig==", - "license": "MIT" - }, - "node_modules/@radix-ui/primitive": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.4.tgz", - "integrity": "sha512-7AdCK9PQyiljKoBDbN8OuctCbd/esdwZPQ8RtOE3SsyQtUpiPb+ND75q0jEhC1m1ecBI0MFNeLJvwIh9iKHRcQ==", - "license": "MIT" - }, - "node_modules/@radix-ui/react-arrow": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/@radix-ui/react-arrow/-/react-arrow-1.1.11.tgz", - "integrity": "sha512-Kdil9BB1rIFC/khmf4hC35bn8701AJcizTU7G7cUbEbk5XqqbjDuHW60uUfKqO5WojjZcbAW51Q7P0hRmMLw8A==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-primitive": "2.1.7" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-avatar": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-avatar/-/react-avatar-1.2.1.tgz", - "integrity": "sha512-+8PWoLLZv3AVb5m0pvoiOca/bQGzc9vPVb+982HB2x3Un0DpYEPM3zLMl4oqRpBsocJuNqLkiv/HXTnTrlwr4g==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-context": "1.1.4", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-use-callback-ref": "1.1.2", - "@radix-ui/react-use-is-hydrated": "0.1.1", - "@radix-ui/react-use-layout-effect": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-checkbox": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/@radix-ui/react-checkbox/-/react-checkbox-1.3.6.tgz", - "integrity": "sha512-eUEUoGMDpfkgHWSE97ZZaUJtzR1M7EKnNIpD1Q16+8JR9NWghcaqMulx9PuCQ720w0UclfYn6FEbCdd5Hx087g==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.4", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.1.4", - "@radix-ui/react-presence": "1.1.6", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-use-controllable-state": "1.2.3", - "@radix-ui/react-use-previous": "1.1.2", - "@radix-ui/react-use-size": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-collapsible": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/@radix-ui/react-collapsible/-/react-collapsible-1.1.15.tgz", - "integrity": "sha512-8A1zibu5skAQ+UVbaeNH5hVMibiFCRJzgMuM14LTWGttnTZKQL9jwYnhAbHRuxrtCqPXa4JvvnVUq1pTNgyZYw==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.4", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.1.4", - "@radix-ui/react-id": "1.1.2", - "@radix-ui/react-presence": "1.1.6", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-use-controllable-state": "1.2.3", - "@radix-ui/react-use-layout-effect": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-collection": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.1.11.tgz", - "integrity": "sha512-djW9+zeg137KQdlPtmE8xnaD+K2rcXXMWFrSg0hsmYZ6HRbdTA7tDHFgpaW9+huWVEu0RCabL+985T4TA0BE7g==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.1.4", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-slot": "1.3.0" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-compose-refs": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.3.tgz", - "integrity": "sha512-rYOP8OMnuuPMQF1uhPVlGNcCDlkokKqGFE3JcxFViIkAXP7EvFWUliJAstrapypaBLJNHbZL6jGhbVDGTwmVhA==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-context": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.1.4.tgz", - "integrity": "sha512-QwH4PO5urrbO+FaGd5Aglg+YJgWTyyuZ3g/6mKvsqraLkglDdckw9JafgL5McL5VEJ6EPNduPaT3ZE9BttDAqg==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-dialog": { - "version": "1.1.18", - "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.1.18.tgz", - "integrity": "sha512-apa28mldjMgORmE6g/w3sCcA0Y9UAVeeDVoozN4i7kOw12mLl9RBchfzK3Nn6qxOWjrZhK1Lfy7f07kyzxtnBw==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.4", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.1.4", - "@radix-ui/react-dismissable-layer": "1.1.14", - "@radix-ui/react-focus-guards": "1.1.4", - "@radix-ui/react-focus-scope": "1.1.11", - "@radix-ui/react-id": "1.1.2", - "@radix-ui/react-portal": "1.1.13", - "@radix-ui/react-presence": "1.1.6", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-slot": "1.3.0", - "@radix-ui/react-use-controllable-state": "1.2.3", - "aria-hidden": "^1.2.4", - "react-remove-scroll": "^2.7.2" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-direction": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.1.2.tgz", - "integrity": "sha512-C3vFhbyi4SW3PmbAi6Awpu4OzJtd0MxGurvSsYtr7p7nM8RNB3VAF3CUmnp2j50knpkrRcB7+ycVXzgLgF6yNA==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-dismissable-layer": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.14.tgz", - "integrity": "sha512-4lUhWTWAjbDIqFrAPWJ3WqBOpO5YchVZ88X3nh6H9Lu5AFi5nCUeTPj3D8FSDmabmFeRe9ME0BDA4MwKTha5GQ==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.4", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-use-callback-ref": "1.1.2", - "@radix-ui/react-use-effect-event": "0.0.3" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-dropdown-menu": { - "version": "2.1.19", - "resolved": "https://registry.npmjs.org/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.1.19.tgz", - "integrity": "sha512-HZccBkbK0LOi8nYKIp5jll/zIRW0cCOmG6WWyqsSpmXCU+ZlcBbTqIwlBvPCu886C5RVu6c/kHV7xSP8IgYNHw==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.4", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.1.4", - "@radix-ui/react-id": "1.1.2", - "@radix-ui/react-menu": "2.1.19", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-use-controllable-state": "1.2.3" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-focus-guards": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.1.4.tgz", - "integrity": "sha512-cot/aB/mOm0IYVYTTmQcEEK1M48lZWi8FlYe5nDPQQ8NYZUlXEFgncJ9p2Kzer3RKSrY7cTTpEMLZKNo9QoP5Q==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-focus-scope": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.1.11.tgz", - "integrity": "sha512-Mn88Vg2whaRocGJNOH+DKFqYm6ySFPQaiwHNxZPyjn99B52KAEJWWY9NP83+nWdk2HM3rdov+STu9AG471Rt9w==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-use-callback-ref": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-id": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.1.2.tgz", - "integrity": "sha512-orBC88futVpqCmhX1p4cvquNHsELQ+w+vBJnuj3ftETI5bJb0bZn3Tqu3SWN2IOcPycTnMGnhwoermvISt72sA==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-use-layout-effect": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-label": { - "version": "2.1.11", - "resolved": "https://registry.npmjs.org/@radix-ui/react-label/-/react-label-2.1.11.tgz", - "integrity": "sha512-3PKvDDxOn62k0oV1n4QtNtD2vpu+zYjXR7ojLBPaO6SPvhy53yg0vAmgNeBQeJW5rV3dffoRG+HYfLBZuzw0CQ==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-primitive": "2.1.7" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-menu": { - "version": "2.1.19", - "resolved": "https://registry.npmjs.org/@radix-ui/react-menu/-/react-menu-2.1.19.tgz", - "integrity": "sha512-Mht9BVd1AIsNFVQr4KG3bIK7XQn5IXF0TL/2ObsrzOdc1loaly/+kBDL5roSCYn8j8XZkvpOD0WYLz2FQtH1Eg==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.4", - "@radix-ui/react-collection": "1.1.11", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.1.4", - "@radix-ui/react-direction": "1.1.2", - "@radix-ui/react-dismissable-layer": "1.1.14", - "@radix-ui/react-focus-guards": "1.1.4", - "@radix-ui/react-focus-scope": "1.1.11", - "@radix-ui/react-id": "1.1.2", - "@radix-ui/react-popper": "1.3.2", - "@radix-ui/react-portal": "1.1.13", - "@radix-ui/react-presence": "1.1.6", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-roving-focus": "1.1.14", - "@radix-ui/react-slot": "1.3.0", - "@radix-ui/react-use-callback-ref": "1.1.2", - "aria-hidden": "^1.2.4", - "react-remove-scroll": "^2.7.2" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-navigation-menu": { - "version": "1.2.17", - "resolved": "https://registry.npmjs.org/@radix-ui/react-navigation-menu/-/react-navigation-menu-1.2.17.tgz", - "integrity": "sha512-fYeYQvbeNn5AQk2RBbpO7koLm2YbS00UYxC/IL2sgLlninEH5UNIv+X3E0KJ1Vy4WIo+dhN9w8GNqSHhbHWCIg==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.4", - "@radix-ui/react-collection": "1.1.11", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.1.4", - "@radix-ui/react-direction": "1.1.2", - "@radix-ui/react-dismissable-layer": "1.1.14", - "@radix-ui/react-id": "1.1.2", - "@radix-ui/react-presence": "1.1.6", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-use-callback-ref": "1.1.2", - "@radix-ui/react-use-controllable-state": "1.2.3", - "@radix-ui/react-use-layout-effect": "1.1.2", - "@radix-ui/react-use-previous": "1.1.2", - "@radix-ui/react-visually-hidden": "1.2.7" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-popper": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.3.2.tgz", - "integrity": "sha512-3QXNeMkdshed1MR3LNoiCirBywRFPkD8ETJa/HlPuLwSajaQixf2ro+isoDNJlGABg9ug41XuZpINZJIle4XWg==", - "license": "MIT", - "dependencies": { - "@floating-ui/react-dom": "^2.0.0", - "@radix-ui/react-arrow": "1.1.11", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.1.4", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-use-callback-ref": "1.1.2", - "@radix-ui/react-use-layout-effect": "1.1.2", - "@radix-ui/react-use-rect": "1.1.2", - "@radix-ui/react-use-size": "1.1.2", - "@radix-ui/rect": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-portal": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.1.13.tgz", - "integrity": "sha512-z3oXfmaHLJTF1wktbjgD6cn9jiEbq3WSondB10LIuIt2m2Ym4iJlrW04/euMwENDdWDdE7z+OuY7Qyp1YpRSwA==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-use-layout-effect": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-presence": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.1.6.tgz", - "integrity": "sha512-zdTk4PlUO0E18HnZ3wYbW0KkJJxWCdiNYp6g6X1PtONFhxVkg01vliTJAmwIszU6mHiyBOoW9P0rAugl5/hULQ==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-use-layout-effect": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-primitive": { - "version": "2.1.7", - "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.7.tgz", - "integrity": "sha512-bC3NiwsprbxKjuon9l7X6BUTw7FPVzEYaL92MPEY5SCd/9hUTPXVFtVwRix7778wtRsVao+zE062gL79FZleeQ==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-slot": "1.3.0" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-roving-focus": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/@radix-ui/react-roving-focus/-/react-roving-focus-1.1.14.tgz", - "integrity": "sha512-8Qcnx9447tx/aCBgw6Jenfqg4Skq+vqab9mCBmuGNipIS5YXvL275wbKEu7+ICYHIlAPgCduUMJH1XOYewKF6Q==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.4", - "@radix-ui/react-collection": "1.1.11", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.1.4", - "@radix-ui/react-direction": "1.1.2", - "@radix-ui/react-id": "1.1.2", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-use-callback-ref": "1.1.2", - "@radix-ui/react-use-controllable-state": "1.2.3" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-select": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/@radix-ui/react-select/-/react-select-2.3.2.tgz", - "integrity": "sha512-brXD6C/V0fVK0DDbscLVw6LsXrjQ+ay8jdOBaN+tLb4vsHsAMm6Gt6eT77wHX1Eq8GPtD5rJ+RxFtfDozsb4+Q==", - "license": "MIT", - "dependencies": { - "@radix-ui/number": "1.1.2", - "@radix-ui/primitive": "1.1.4", - "@radix-ui/react-collection": "1.1.11", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.1.4", - "@radix-ui/react-direction": "1.1.2", - "@radix-ui/react-dismissable-layer": "1.1.14", - "@radix-ui/react-focus-guards": "1.1.4", - "@radix-ui/react-focus-scope": "1.1.11", - "@radix-ui/react-id": "1.1.2", - "@radix-ui/react-popper": "1.3.2", - "@radix-ui/react-portal": "1.1.13", - "@radix-ui/react-presence": "1.1.6", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-slot": "1.3.0", - "@radix-ui/react-use-callback-ref": "1.1.2", - "@radix-ui/react-use-controllable-state": "1.2.3", - "@radix-ui/react-use-layout-effect": "1.1.2", - "@radix-ui/react-use-previous": "1.1.2", - "@radix-ui/react-visually-hidden": "1.2.7", - "aria-hidden": "^1.2.4", - "react-remove-scroll": "^2.7.2" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-separator": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/@radix-ui/react-separator/-/react-separator-1.1.11.tgz", - "integrity": "sha512-jRhe86+8PF7VZ1u14eOWVOuh2BuAhALg/FT1VcMC4OHedMTRUazDnDlKTt+yxo5cRNKHMfmvZ4sSQtWDeMV4CQ==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-primitive": "2.1.7" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-slot": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.3.0.tgz", - "integrity": "sha512-MojKku4U/miO8Av4Dkb+ctMAQx7JmY96LmtDQlAarCRtd7rN52QCSzBF+XAvr5S6coSVj9HEPBgHAHKEJVk/WA==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-compose-refs": "1.1.3" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-toggle": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle/-/react-toggle-1.1.13.tgz", - "integrity": "sha512-bI2ILJrzwgmAsH05TsJ9pVrzqQwAip7OM2/krqAdYn0R16bl86UPWbe5VPHsALat0EnqpV01cGtkleaUKPNdNg==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.4", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-use-controllable-state": "1.2.3" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-toggle-group": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle-group/-/react-toggle-group-1.1.14.tgz", - "integrity": "sha512-TK1vusNKb8IRhF23FTbRgUNZ9zfs5rGIyI7LfR3h26p9LrQ060i0uW9QWeD8baZMddaaP0DBGlIa6pbZG+mitg==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.4", - "@radix-ui/react-context": "1.1.4", - "@radix-ui/react-direction": "1.1.2", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-roving-focus": "1.1.14", - "@radix-ui/react-toggle": "1.1.13", - "@radix-ui/react-use-controllable-state": "1.2.3" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-tooltip": { - "version": "1.2.11", - "resolved": "https://registry.npmjs.org/@radix-ui/react-tooltip/-/react-tooltip-1.2.11.tgz", - "integrity": "sha512-8XZ6Py3y3W2nEzAUGCN5cfVKaUi+CVApcz1d6lrNVVf2hvYEixMRkq8k9ggPKnQUpRRuOV5avt8uvxViH2jLwA==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.4", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.1.4", - "@radix-ui/react-dismissable-layer": "1.1.14", - "@radix-ui/react-id": "1.1.2", - "@radix-ui/react-popper": "1.3.2", - "@radix-ui/react-portal": "1.1.13", - "@radix-ui/react-presence": "1.1.6", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-slot": "1.3.0", - "@radix-ui/react-use-controllable-state": "1.2.3", - "@radix-ui/react-visually-hidden": "1.2.7" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-use-callback-ref": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.2.tgz", - "integrity": "sha512-xCso9j1/u8sEgP1RNHjFrXJLApL8LiqOkI1R4ywuN00rxWdYg4oQXuwKLS3i0j5NWLromUD27/4nlxj2UFVvIw==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-use-controllable-state": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.2.3.tgz", - "integrity": "sha512-PLzC90MS+ReootmjC597dvopoelpZ8Q61HJkDXZSExitIq7PL55vHNnesAHwguHK0aPfBnpdNzQtv1uliaqQrA==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-use-effect-event": "0.0.3", - "@radix-ui/react-use-layout-effect": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-use-effect-event": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-effect-event/-/react-use-effect-event-0.0.3.tgz", - "integrity": "sha512-6c8ZqvPTWILEKnyVkP53EGRCcpnJiKTC21sS/6R1GF5xKyHJJWQEPfkqlcgUkdRQivd6tb23abUwe4ngWmY0JA==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-use-layout-effect": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-use-is-hydrated": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-is-hydrated/-/react-use-is-hydrated-0.1.1.tgz", - "integrity": "sha512-qwOiz4Tjo8CNnrOLAYUMXeZwDzXgXpvK4TKQPmWLECM9XoWvA6+0Z2/7Ag3A4ivjS4ovbLJPbskkxioFyBhr8A==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-use-layout-effect": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.2.tgz", - "integrity": "sha512-jrBWOxZITuGcnjRCM2t2U5ZPkCLxD+Ym6DjfssS5haTj2iiak/DOb64JeN6OdLfLgptb6/e2kKR+ZuTrGoZTPA==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-use-previous": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-previous/-/react-use-previous-1.1.2.tgz", - "integrity": "sha512-IGBQPtRFdhN6MQ8dbegVmBq1LVZluya3F1jWY+puIcQC3MHctRwTDSBWCkL/3ZcnMJLTMJ++Z+ktmvg0F89iCw==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-use-rect": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-rect/-/react-use-rect-1.1.2.tgz", - "integrity": "sha512-d8a+bBY/FxikNPlgJJoaBHZX+zKVbWHYJGTLnLvveQgFSTntkGdEKv3JDtHrMS0DNYpllz2nRsTLGLKYttbpmw==", - "license": "MIT", - "dependencies": { - "@radix-ui/rect": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-use-size": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-size/-/react-use-size-1.1.2.tgz", - "integrity": "sha512-giWQp+4mxjBPt4KZ0MmyuykFNWfbDxKt4x+fPkRYmgRFJSbCZFzUglvMb/Kjn38tm10YP4ufiQZDx3zna4LU6w==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-use-layout-effect": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-visually-hidden": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.2.7.tgz", - "integrity": "sha512-1wNZBggTDK3GRuuQ6nP4k2yi7a6l7I5qbMPbZcRsrGsGVead/f/d5FhEzUvqFs0bcrDLx7n1zKQ3JvLR6whaaw==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-primitive": "2.1.7" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/rect": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@radix-ui/rect/-/rect-1.1.2.tgz", - "integrity": "sha512-xnXE7wG13PI+cxieVssYXlQJuYVRhH9NBoxt3KNwzghDIA69GMm7d4wXRouHIYjE+KvS6U/MsMO73NdS2MH9ZA==", - "license": "MIT" - }, - "node_modules/@react-aria/focus": { - "version": "3.22.1", - "resolved": "https://registry.npmjs.org/@react-aria/focus/-/focus-3.22.1.tgz", - "integrity": "sha512-CPxtkyrBi/HYY5P3lE/57sQ6qfa0lN8E55TOm89H0kNGv0lKt+/0zP7lWERzBjRr5IxBVrQX4gFEowBN52LPaA==", - "license": "Apache-2.0", - "dependencies": { - "@swc/helpers": "^0.5.0", - "react-aria": "^3.48.0" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1", - "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" - } - }, - "node_modules/@react-aria/interactions": { - "version": "3.28.1", - "resolved": "https://registry.npmjs.org/@react-aria/interactions/-/interactions-3.28.1.tgz", - "integrity": "sha512-Bqb+HrD5I5MHS2SKBhISYqo2SW8Y2dfzgF/Y1lIJq7xqLxheo9vzxPGEHhz+XzkgGfoqEJx8A6a3C7uiqS3HWA==", - "license": "Apache-2.0", - "dependencies": { - "@react-types/shared": "^3.34.0", - "@swc/helpers": "^0.5.0", - "react-aria": "^3.48.0" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1", - "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" - } - }, - "node_modules/@react-types/shared": { - "version": "3.36.0", - "resolved": "https://registry.npmjs.org/@react-types/shared/-/shared-3.36.0.tgz", - "integrity": "sha512-DkP/H0C2YjjS7gZWKNqOmU8a16qHPjQNdzMwmTq9SzplM6Iw0kVMTZ0OIoe6FOgGqa+FwMsE2QbPjh/n3g/jXQ==", - "license": "Apache-2.0", - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" - } - }, - "node_modules/@rolldown/pluginutils": { - "version": "1.0.0-beta.27", - "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz", - "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==", - "license": "MIT" - }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.2.tgz", - "integrity": "sha512-6o7ZLZK+BeenkZCFNDXqpbjw9bD6nuWonvS/lwQJp7NoVVxm6p3qE7qQ5jGuBjiFsgvqjD8mZAU5oWxTmbOeOg==", - "cpu": [ - "arm" - ], - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.2.tgz", - "integrity": "sha512-BaH7BllCACHoH1LguOU56UItGfUWjujlO65kS9LAodViaN4bwIKd7oeW/ZHJ/4ljr/7MIiENnNy3HJ0zXv8Zkw==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.2.tgz", - "integrity": "sha512-v39RCCvj4He82I9sFmk+M1VZ0PLM9sfsLVikjfx2hYBNALhrrOR2D3JjQA6AhlaSOgcR+RzrKY7e1+bT6SUO/A==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.2.tgz", - "integrity": "sha512-yl0y2vq3S3lHeuXhEdss6TWfKW8vkujImO12tn4ZkG/4oghr09LvdYm2RElVjokTQiUvDUGXLGsYeLqUMCKpGA==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.2.tgz", - "integrity": "sha512-tT4pvt4qXD+vEoezupCWi+a1F0vvDiksiHc+PxRlYTOH1I6/X4id9jPxTP+Fg+545euaFT1jJVs4CEdHZAU1vw==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.2.tgz", - "integrity": "sha512-6nU5F2wCW+qvCBhTn1pdIU3bzsIoF7EUwsCDRxilWGprQR6yd508YnH9+OKFCwpfS8pjZqDUmnCAr7exax0XCg==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.2.tgz", - "integrity": "sha512-n1GJHPOvpIfhi3TmrCeh6S6URt9BFCt0KQE3qvexyGCTAKpR4Lg+eWvNZEqu7epxwus/8ElT3hacYEucm49SZg==", - "cpu": [ - "arm" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.2.tgz", - "integrity": "sha512-JqgflS8wEB+UXV/vS1RpRbifGBeN4D5lz8D8oOFbFZw4vedvdOgCFAjfBmIMdW3yL10XpQQ0Ambepw6MXrhOnA==", - "cpu": [ - "arm" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.2.tgz", - "integrity": "sha512-wnFJkogWvN4jm/hQRF2UBaeUmk20j5+DmHvoyWii2b8HJDyvz1MF2OU/6ynXt2KR63rbZLWkFpoytpdc/yBuSA==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.2.tgz", - "integrity": "sha512-HVu2bp0zhvJ8xHEV9+UUs7S90VadmBSY3LcIMvozbPo4AuMGDWlz3ymHLHZPX4hR67TKTt8Qp5PJ5RBg/i+RMQ==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.2.tgz", - "integrity": "sha512-mQqqAV8QaoSgr9I2fKDLY2BAVvmKjWoGiu/cSYQonsLvtqwEn1E4QYfnCOcp5zoEqNhsDYin1s6jx/VJmrxlZg==", - "cpu": [ - "loong64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-loong64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.2.tgz", - "integrity": "sha512-IxKLoxCQ2IWi6bT2akyDUBGsOImDKB+sPp4EsTmwFQ/fMwpCKm8uLSSgP/Kx/QYUgKis6SEZ5/Nlhup0DIA0PQ==", - "cpu": [ - "loong64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.2.tgz", - "integrity": "sha512-Mk5ha2RQSgyFfmYYLkBpPnUk8D8FriBxesO1u9O75X0mHgXL1UQcH5Itl2lurWL2tj0RxV9b9tJgipac0hRY9A==", - "cpu": [ - "ppc64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-ppc64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.2.tgz", - "integrity": "sha512-CjvEnqJL/0/TQ3TXX3OPIJ/kmBellrWd4heXUmHeJlTnmwjKpSJzoehLaL6Xk0ZnMHBu9dZuFADNOrtjF4v+2w==", - "cpu": [ - "ppc64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.2.tgz", - "integrity": "sha512-1SiZbzwdkaDURsew/tSOrooKiYy7EQGT6m8ufavAi9NEyQb/6VuIxFXAL1fqa4iZe3g4NbNk4P7J32z2tw5Mgg==", - "cpu": [ - "riscv64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.2.tgz", - "integrity": "sha512-nQts12zJ3NQRoE6uYljOH89v7szzLDvG2JD/vsX+vGXU8w/At1GowTZ5/7qeFQ8m7L55rpR8Okugnuo5bgjy2Q==", - "cpu": [ - "riscv64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.2.tgz", - "integrity": "sha512-E9/ll019jhPIJgpzfZoIkBGhcz+kKNgVWYRY0zr9srBdPPFVpvOKW8VaJKUbeK+eZXyQF9ltME+Kk6affeaPgg==", - "cpu": [ - "s390x" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.2.tgz", - "integrity": "sha512-5BqxR/pshjey51iliyzTD5Xi3EN0aLmQ2lZ3lvefVV9c82BvrLo2/6OT55iifpWBufs6kdwWbuOKS841DrmK9A==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.2.tgz", - "integrity": "sha512-uNN83XxQrRAh/w0/pmAfibcwyb6YWt4gP+dpnQKPVJshAloQ785ii8CT8ZCIxkGg9opVsvAlGhFitSm6D1Jjpg==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-openbsd-x64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.2.tgz", - "integrity": "sha512-srjEIxSH3LRnJN6THczDHWQplqEMFiAJrTab0msUryh9kwNpkICf3Ea6q6MN/2cZwRFUNx5w+h6Hpi4QuHS6Zg==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ] - }, - "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.2.tgz", - "integrity": "sha512-8hOJnxgbyObnCm5AlRA3A931xX19xq80RjVTKgJOvEKWqJruP/Uf12IbAOaDjjEXYRewwHLfmF0YRIdK3OwKWA==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ] - }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.2.tgz", - "integrity": "sha512-mmF4AY1i0hG/bLWUctUq59gtmgaSIRa3cu/A3JFRp/sCNEme2bgDEiDS22P9FbnJB8NJNF4jPJiSP5RHQpUTDg==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.2.tgz", - "integrity": "sha512-DZgkknc6jhHrk46V25vbAM0zZkyP0nSDkJB8/dRkLTxv470dOmWDqGoEJl/9A0dFfS7yE3REOwNDxpHwSLSt0Q==", - "cpu": [ - "ia32" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.2.tgz", - "integrity": "sha512-T6xr6ucWSFto+VGajA8YH26LdpHRuP4YLHEKAtCWvJDOlnmWcDZVCI2Jmjr+IFHDlt2zRaTAKE4tfjTaWLgJBg==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.2.tgz", - "integrity": "sha512-BfzEnDJOt9T8M989/lA37EcJgat01wLRnoi5dQf3QzOH7jzpqTAzdDbVfRljVr5r+jzKqpbHeyOfAaXxAd0PAA==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@swc/helpers": { - "version": "0.5.23", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.23.tgz", - "integrity": "sha512-5lSsMOTXURePglDfvuAQUqkGek9Hg2kksOYay2m0+XR++b2NWYL/4sWyuvVBIs8oKnJaxkdi9whaL/sqN13afw==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.8.0" - } - }, - "node_modules/@tailwindcss/node": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.3.2.tgz", - "integrity": "sha512-yWP/sqEcBLaD8JuA6zNwxoYKr75qxTioYwlRwekj5Jr/I5GXnoJfjetH/psLUIv74cYTH2lBUEzBkinthoYcBg==", - "license": "MIT", - "dependencies": { - "@jridgewell/remapping": "^2.3.5", - "enhanced-resolve": "5.21.6", - "jiti": "^2.7.0", - "lightningcss": "1.32.0", - "magic-string": "^0.30.21", - "source-map-js": "^1.2.1", - "tailwindcss": "4.3.2" - } - }, - "node_modules/@tailwindcss/oxide": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.3.2.tgz", - "integrity": "sha512-z8ZgnzX8gdNoWLBLqBPoh/sjnxkwvf9ZuWjnO0l0yIzbLa5/9S+eC5QxGZKRobVHIC3/1BoMWjHblqWjcgFgag==", - "license": "MIT", - "engines": { - "node": ">= 20" - }, - "optionalDependencies": { - "@tailwindcss/oxide-android-arm64": "4.3.2", - "@tailwindcss/oxide-darwin-arm64": "4.3.2", - "@tailwindcss/oxide-darwin-x64": "4.3.2", - "@tailwindcss/oxide-freebsd-x64": "4.3.2", - "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.2", - "@tailwindcss/oxide-linux-arm64-gnu": "4.3.2", - "@tailwindcss/oxide-linux-arm64-musl": "4.3.2", - "@tailwindcss/oxide-linux-x64-gnu": "4.3.2", - "@tailwindcss/oxide-linux-x64-musl": "4.3.2", - "@tailwindcss/oxide-wasm32-wasi": "4.3.2", - "@tailwindcss/oxide-win32-arm64-msvc": "4.3.2", - "@tailwindcss/oxide-win32-x64-msvc": "4.3.2" - } - }, - "node_modules/@tailwindcss/oxide-android-arm64": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.3.2.tgz", - "integrity": "sha512-WHxqIuHpvZ5VtdX6GTl1Ik/Vp2YuN42Et+0CdeaVd/frQ9jAvGmvR8vLT+jk3e8/Q3x8kECB9+R17pgpp2BulA==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-darwin-arm64": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.3.2.tgz", - "integrity": "sha512-GZypeUY/IDJW3877KeM+O67vbXr3MBnbtEL4aYhNErv/JWZhye2vGSWWG9tB6iiqR2MqRNkY8IOUy4NdSZV26w==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-darwin-x64": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.3.2.tgz", - "integrity": "sha512-UIIzmefR6KO1sDU7MzRqAxC8iBpft/VhkGjTjnhoS6k7Z3rQ9wEgA1ODSiyH/tcSYssulNm4Ci3hOeK1jH7ccQ==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-freebsd-x64": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.3.2.tgz", - "integrity": "sha512-GN+uAmcI6DNspnCDwtOAZrTz6oukJnp337qZvxqCGLd3BHBzJpO0ZbTLRvJNdztOeAmTzewewGIMPb0tk2R4WA==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.3.2.tgz", - "integrity": "sha512-4ABn7qSbdHRwTiDiuWNegCyb5+2FJ4vKIKc3DmKrvAFw7MU1Lm11dIkTPwUaFdTzc7IsOpDbqBrlh0x6y36U/w==", - "cpu": [ - "arm" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.3.2.tgz", - "integrity": "sha512-wDgEIGwoM8w8pufh9LVt1PahDgNdKXrLC2qfAnV3vAmococ9RWbxeAw4pxPttd/TsJfwjyLf90Dg1y9y8I6Emw==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-linux-arm64-musl": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.3.2.tgz", - "integrity": "sha512-J5Nuk0uZQIiMTJj3LEx4sAA9tMFUoXQZFv1J6An+QGYe53HKRJuFDi0rpq/tuouCZeAbOBY3kQ6g8qeD4TUjtA==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-linux-x64-gnu": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.3.2.tgz", - "integrity": "sha512-kqCZpSKOBEJO4mz7OqWoofBZeXTAwaVGPj0ErAj7CojmhKpWVWVOnrt9dE8odoIraZq4oj3ausM37kXi+Tow8w==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-linux-x64-musl": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.3.2.tgz", - "integrity": "sha512-cixpqbh2toJDmkuCRI68nXA8ZxNmdK9Y+9v5h3MC3ZQKy/0BO8AWzlkWyRM7JAFSGBlfig4YVTPsK6MVgqz1uw==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-wasm32-wasi": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.3.2.tgz", - "integrity": "sha512-4ec2Z/LOmRsAgU23CS4xeJfcJlmRg94A/XrbGRCF1gyU/zdDfRLYDVsS+ynSZCmGNxQ1jQriQOKMQeQxBA3Isw==", - "bundleDependencies": [ - "@napi-rs/wasm-runtime", - "@emnapi/core", - "@emnapi/runtime", - "@tybys/wasm-util", - "@emnapi/wasi-threads", - "tslib" - ], - "cpu": [ - "wasm32" - ], - "license": "MIT", - "optional": true, - "dependencies": { - "@emnapi/core": "^1.11.1", - "@emnapi/runtime": "^1.11.1", - "@emnapi/wasi-threads": "^1.2.2", - "@napi-rs/wasm-runtime": "^1.1.4", - "@tybys/wasm-util": "^0.10.2", - "tslib": "^2.8.1" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.2.tgz", - "integrity": "sha512-Zyr/M0+XcYZu3bZrUytc7TXvrk0ftWfl8gN2MwekNDzhqhKRUucMPSeOzM0o0wH5AWOU49BsKRrfKxI2atCPMQ==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-win32-x64-msvc": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.3.2.tgz", - "integrity": "sha512-QI9BO7KlNZsp2GuO0jwAAj5jCDABOKXRkCk2XuKTSaNEFSdfzqswYVTtCHBNKHLsqyjFyFkqlDiwkNbTYSssMQ==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/vite": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.3.2.tgz", - "integrity": "sha512-eHpMeX4JXfVNJDEcsouTeCBubJBTcTLigeaw/NTUW6PB5ATKKXdyonnXgTBX2VuRbjz1hjfz6C5XAhr52ImQXA==", - "license": "MIT", - "dependencies": { - "@tailwindcss/node": "4.3.2", - "@tailwindcss/oxide": "4.3.2", - "tailwindcss": "4.3.2" - }, - "peerDependencies": { - "vite": "^5.2.0 || ^6 || ^7 || ^8" - } - }, - "node_modules/@tanstack/react-virtual": { - "version": "3.14.5", - "resolved": "https://registry.npmjs.org/@tanstack/react-virtual/-/react-virtual-3.14.5.tgz", - "integrity": "sha512-4EKRXh7zBLkbKbFmG3AUVkircuHd+7OdT1pocJSepxtfBd3qnrJgJ5rtPkRYyo9fmyVb2+pI2xPy5oYvMLQy6A==", - "license": "MIT", - "dependencies": { - "@tanstack/virtual-core": "3.17.3" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/tannerlinsley" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - } - }, - "node_modules/@tanstack/virtual-core": { - "version": "3.17.3", - "resolved": "https://registry.npmjs.org/@tanstack/virtual-core/-/virtual-core-3.17.3.tgz", - "integrity": "sha512-8Np/TFELpI0ySuJoVmjvOrQYXH/8sTX0Biv9szhFhY39xOdAAY+smrMxjxOum/ux3eM8MUJQsEJ0/R0UpvC8dw==", - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/tannerlinsley" - } - }, - "node_modules/@types/babel__core": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", - "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" - } - }, - "node_modules/@types/babel__generator": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", - "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", - "license": "MIT", - "dependencies": { - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__template": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", - "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__traverse": { - "version": "7.28.0", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", - "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", - "license": "MIT", - "dependencies": { - "@babel/types": "^7.28.2" - } - }, - "node_modules/@types/estree": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", - "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", - "license": "MIT" - }, - "node_modules/@types/lodash": { - "version": "4.17.24", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.24.tgz", - "integrity": "sha512-gIW7lQLZbue7lRSWEFql49QJJWThrTFFeIMJdp3eH4tKoxm1OvEPg02rm4wCCSHS0cL3/Fizimb35b7k8atwsQ==", - "license": "MIT" - }, - "node_modules/@types/lodash-es": { - "version": "4.17.12", - "resolved": "https://registry.npmjs.org/@types/lodash-es/-/lodash-es-4.17.12.tgz", - "integrity": "sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==", - "license": "MIT", - "dependencies": { - "@types/lodash": "*" - } - }, - "node_modules/@types/react": { - "version": "19.2.17", - "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.17.tgz", - "integrity": "sha512-MXfmqaVPEVgkBT/aY0aGCkRWWtByiYQXo3xdQ8r5RzuFrPiRn8Gar2tQdXSUQ2GKV3bkXckek89V8wQBY2Q/Aw==", - "license": "MIT", - "peer": true, - "dependencies": { - "csstype": "^3.2.2" - } - }, - "node_modules/@types/react-dom": { - "version": "19.2.3", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz", - "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", - "license": "MIT", - "peer": true, - "peerDependencies": { - "@types/react": "^19.2.0" - } - }, - "node_modules/@vitejs/plugin-react": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz", - "integrity": "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==", - "license": "MIT", - "dependencies": { - "@babel/core": "^7.28.0", - "@babel/plugin-transform-react-jsx-self": "^7.27.1", - "@babel/plugin-transform-react-jsx-source": "^7.27.1", - "@rolldown/pluginutils": "1.0.0-beta.27", - "@types/babel__core": "^7.20.5", - "react-refresh": "^0.17.0" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "peerDependencies": { - "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" - } - }, - "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "license": "MIT", - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/aria-hidden": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/aria-hidden/-/aria-hidden-1.2.6.tgz", - "integrity": "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA==", - "license": "MIT", - "dependencies": { - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "license": "MIT" - }, - "node_modules/axios": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.18.1.tgz", - "integrity": "sha512-3nTvFlvpn9Zu/RkHUqtc7/+al4UpRW5az71ap5zccp6e8RAYEzhMTecX8Dz1wWDYrPpUoB1HAQEGEAEvUr7S9g==", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.16.0", - "form-data": "^4.0.5", - "https-proxy-agent": "^5.0.1", - "proxy-from-env": "^2.1.0" - } - }, - "node_modules/baseline-browser-mapping": { - "version": "2.10.41", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.41.tgz", - "integrity": "sha512-WwS7MHhqGHHlaVsqRZnhvCEMS0owDX+SxRlve7JkuH7My1Ara3ZriTmCQupPfYjxMZ8I/tgxtJYr2t7taHaH4A==", - "license": "Apache-2.0", - "bin": { - "baseline-browser-mapping": "dist/cli.cjs" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/browserslist": { - "version": "4.28.4", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.4.tgz", - "integrity": "sha512-MTc8i/x9jBQd1iMw2CFGS+rwMa07eYjLR0CCTLDACl9xhxy+nIs3KeML/biicXtk9JrZ6dnnTatmc7ErPXIxqw==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "peer": true, - "dependencies": { - "baseline-browser-mapping": "^2.10.38", - "caniuse-lite": "^1.0.30001799", - "electron-to-chromium": "^1.5.376", - "node-releases": "^2.0.48", - "update-browserslist-db": "^1.2.3" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/call-bound": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", - "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "get-intrinsic": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/caniuse-lite": { - "version": "1.0.30001800", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001800.tgz", - "integrity": "sha512-MMHtuAz9Ys840zAY5F4k6fV5GaivZ9sPk+nz0mY+GYVzRBnYkN0mpqkSR92oWRQ19yQWo4HvBV/FnC16AJX8MA==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "CC-BY-4.0" - }, - "node_modules/class-variance-authority": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/class-variance-authority/-/class-variance-authority-0.7.1.tgz", - "integrity": "sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==", - "license": "Apache-2.0", - "dependencies": { - "clsx": "^2.1.1" - }, - "funding": { - "url": "https://polar.sh/cva" - } - }, - "node_modules/clsx": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", - "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "license": "MIT", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "license": "MIT" - }, - "node_modules/csstype": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", - "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", - "license": "MIT" - }, - "node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/detect-libc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", - "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", - "license": "Apache-2.0", - "engines": { - "node": ">=8" - } - }, - "node_modules/detect-node-es": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz", - "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==", - "license": "MIT" - }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/electron-to-chromium": { - "version": "1.5.385", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.385.tgz", - "integrity": "sha512-78sa/M08MNAYHQfjoWMvOlKQqZ0ElhSm/L5HNUc96VZ3b+KvDVnngFm8sYQy0XrhTRgAhggHr5abA7yTvRdo4Q==", - "license": "ISC" - }, - "node_modules/enhanced-resolve": { - "version": "5.21.6", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.21.6.tgz", - "integrity": "sha512-aNnGCvbJ/RIyWo1IuhNdVjnNF+EjH9wpzpNHt+ci/m9He9LJvUN8wrCcXjp9cWsGNAuvSpVFTx/vraAFQ8qGjQ==", - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.4", - "tapable": "^2.3.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-object-atoms": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", - "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-set-tostringtag": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", - "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/esbuild": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", - "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==", - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.25.12", - "@esbuild/android-arm": "0.25.12", - "@esbuild/android-arm64": "0.25.12", - "@esbuild/android-x64": "0.25.12", - "@esbuild/darwin-arm64": "0.25.12", - "@esbuild/darwin-x64": "0.25.12", - "@esbuild/freebsd-arm64": "0.25.12", - "@esbuild/freebsd-x64": "0.25.12", - "@esbuild/linux-arm": "0.25.12", - "@esbuild/linux-arm64": "0.25.12", - "@esbuild/linux-ia32": "0.25.12", - "@esbuild/linux-loong64": "0.25.12", - "@esbuild/linux-mips64el": "0.25.12", - "@esbuild/linux-ppc64": "0.25.12", - "@esbuild/linux-riscv64": "0.25.12", - "@esbuild/linux-s390x": "0.25.12", - "@esbuild/linux-x64": "0.25.12", - "@esbuild/netbsd-arm64": "0.25.12", - "@esbuild/netbsd-x64": "0.25.12", - "@esbuild/openbsd-arm64": "0.25.12", - "@esbuild/openbsd-x64": "0.25.12", - "@esbuild/openharmony-arm64": "0.25.12", - "@esbuild/sunos-x64": "0.25.12", - "@esbuild/win32-arm64": "0.25.12", - "@esbuild/win32-ia32": "0.25.12", - "@esbuild/win32-x64": "0.25.12" - } - }, - "node_modules/escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/fdir": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", - "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", - "license": "MIT", - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/follow-redirects": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz", - "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "license": "MIT", - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/form-data": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", - "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.4", - "mime-types": "^2.1.35" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/get-intrinsic": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "function-bind": "^1.1.2", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-nonce": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-nonce/-/get-nonce-1.0.1.tgz", - "integrity": "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/get-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "license": "MIT", - "dependencies": { - "dunder-proto": "^1.0.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "license": "ISC" - }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "license": "MIT", - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", - "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "license": "MIT", - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/jiti": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz", - "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==", - "license": "MIT", - "bin": { - "jiti": "lib/jiti-cli.mjs" - } - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "license": "MIT" - }, - "node_modules/jsesc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", - "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", - "license": "MIT", - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "license": "MIT", - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/laravel-precognition": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/laravel-precognition/-/laravel-precognition-1.0.2.tgz", - "integrity": "sha512-0H08JDdMWONrL/N314fvsO3FATJwGGlFKGkMF3nNmizVFJaWs17816iM+sX7Rp8d5hUjYCx6WLfsehSKfaTxjg==", - "license": "MIT", - "dependencies": { - "axios": "^1.4.0", - "lodash-es": "^4.17.21" - } - }, - "node_modules/laravel-vite-plugin": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/laravel-vite-plugin/-/laravel-vite-plugin-1.3.0.tgz", - "integrity": "sha512-P5qyG56YbYxM8OuYmK2OkhcKe0AksNVJUjq9LUZ5tOekU9fBn9LujYyctI4t9XoLjuMvHJXXpCoPntY1oKltuA==", - "license": "MIT", - "dependencies": { - "picocolors": "^1.0.0", - "vite-plugin-full-reload": "^1.1.0" - }, - "bin": { - "clean-orphaned-assets": "bin/clean.js" - }, - "engines": { - "node": "^18.0.0 || ^20.0.0 || >=22.0.0" - }, - "peerDependencies": { - "vite": "^5.0.0 || ^6.0.0" - } - }, - "node_modules/lightningcss": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", - "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", - "license": "MPL-2.0", - "dependencies": { - "detect-libc": "^2.0.3" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, - "optionalDependencies": { - "lightningcss-android-arm64": "1.32.0", - "lightningcss-darwin-arm64": "1.32.0", - "lightningcss-darwin-x64": "1.32.0", - "lightningcss-freebsd-x64": "1.32.0", - "lightningcss-linux-arm-gnueabihf": "1.32.0", - "lightningcss-linux-arm64-gnu": "1.32.0", - "lightningcss-linux-arm64-musl": "1.32.0", - "lightningcss-linux-x64-gnu": "1.32.0", - "lightningcss-linux-x64-musl": "1.32.0", - "lightningcss-win32-arm64-msvc": "1.32.0", - "lightningcss-win32-x64-msvc": "1.32.0" - } - }, - "node_modules/lightningcss-android-arm64": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", - "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", - "cpu": [ - "arm64" - ], - "license": "MPL-2.0", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-darwin-arm64": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", - "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", - "cpu": [ - "arm64" - ], - "license": "MPL-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-darwin-x64": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", - "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", - "cpu": [ - "x64" - ], - "license": "MPL-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-freebsd-x64": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", - "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", - "cpu": [ - "x64" - ], - "license": "MPL-2.0", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-arm-gnueabihf": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", - "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", - "cpu": [ - "arm" - ], - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-arm64-gnu": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", - "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", - "cpu": [ - "arm64" - ], - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-arm64-musl": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", - "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", - "cpu": [ - "arm64" - ], - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-x64-gnu": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", - "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", - "cpu": [ - "x64" - ], - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-x64-musl": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", - "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", - "cpu": [ - "x64" - ], - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-win32-arm64-msvc": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", - "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", - "cpu": [ - "arm64" - ], - "license": "MPL-2.0", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-win32-x64-msvc": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", - "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", - "cpu": [ - "x64" - ], - "license": "MPL-2.0", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lodash-es": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.18.1.tgz", - "integrity": "sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==", - "license": "MIT" - }, - "node_modules/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "license": "ISC", - "dependencies": { - "yallist": "^3.0.2" - } - }, - "node_modules/lucide-react": { - "version": "0.475.0", - "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.475.0.tgz", - "integrity": "sha512-NJzvVu1HwFVeZ+Gwq2q00KygM1aBhy/ZrhY9FsAgJtpB+E4R7uxRk9M2iKvHa6/vNxZydIB59htha4c2vvwvVg==", - "license": "ISC", - "peerDependencies": { - "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" - } - }, - "node_modules/magic-string": { - "version": "0.30.21", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", - "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.5" - } - }, - "node_modules/math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" - }, - "node_modules/nanoid": { - "version": "3.3.15", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.15.tgz", - "integrity": "sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/node-releases": { - "version": "2.0.50", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.50.tgz", - "integrity": "sha512-J6l92tKHX6w8Jy5nO1Vuc01NoIiRGi/d6qBKVxh+IQ8Cr3b6HbVNfKiF8ZpFKufTwpwxMmce2W3iQZ861ZRyTg==", - "license": "MIT", - "engines": { - "node": ">=18" - } - }, - "node_modules/object-inspect": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "license": "ISC" - }, - "node_modules/picomatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", - "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/postcss": { - "version": "8.5.16", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.16.tgz", - "integrity": "sha512-vuwillviilfKZsg0VGj5R/YwwcHx4SLsIOI/7K6mQkWx+l5cUHTjj5g0AasTBcyXsbfTgrwsUNmVUb5xVwyPwg==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "nanoid": "^3.3.12", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/proxy-from-env": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz", - "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==", - "license": "MIT", - "engines": { - "node": ">=10" - } - }, - "node_modules/qs": { - "version": "6.15.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz", - "integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==", - "license": "BSD-3-Clause", - "dependencies": { - "es-define-property": "^1.0.1", - "side-channel": "^1.1.1" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/react": { - "version": "19.2.7", - "resolved": "https://registry.npmjs.org/react/-/react-19.2.7.tgz", - "integrity": "sha512-HNe9WslTbXmFK8o8cmwgAeJFSBvt1bPdHCVKtaaV+WlAN36mpT4hcRpwbf3fY56ar2oIXzsBpOAiIRHAdY0OlQ==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/react-aria": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/react-aria/-/react-aria-3.50.0.tgz", - "integrity": "sha512-S0Os6QZk33fzUAKu1QLT9afoUaCBt1ZNdoiq0n2YMVgKIdNIQS8zxiZ8O9hYE6QyDkHKjD6q39LQZ+qaSAIgjw==", - "license": "Apache-2.0", - "dependencies": { - "@internationalized/date": "^3.12.2", - "@internationalized/number": "^3.6.7", - "@internationalized/string": "^3.2.9", - "@react-types/shared": "^3.36.0", - "@swc/helpers": "^0.5.0", - "aria-hidden": "^1.2.3", - "clsx": "^2.0.0", - "react-stately": "3.48.0", - "use-sync-external-store": "^1.6.0" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1", - "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" - } - }, - "node_modules/react-dom": { - "version": "19.2.7", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.7.tgz", - "integrity": "sha512-t0BRVXvbiE/o20Hfw669rLbMCDWtYZLvmJigy2f0MxsXF+71pxhR3xOkspmsO8h3ZlNzyibAmtCa3l4lYKk6gQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "scheduler": "^0.27.0" - }, - "peerDependencies": { - "react": "^19.2.7" - } - }, - "node_modules/react-refresh": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz", - "integrity": "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/react-remove-scroll": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.7.2.tgz", - "integrity": "sha512-Iqb9NjCCTt6Hf+vOdNIZGdTiH1QSqr27H/Ek9sv/a97gfueI/5h1s3yRi1nngzMUaOOToin5dI1dXKdXiF+u0Q==", - "license": "MIT", - "dependencies": { - "react-remove-scroll-bar": "^2.3.7", - "react-style-singleton": "^2.2.3", - "tslib": "^2.1.0", - "use-callback-ref": "^1.3.3", - "use-sidecar": "^1.1.3" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/react-remove-scroll-bar": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.8.tgz", - "integrity": "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==", - "license": "MIT", - "dependencies": { - "react-style-singleton": "^2.2.2", - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/react-stately": { - "version": "3.48.0", - "resolved": "https://registry.npmjs.org/react-stately/-/react-stately-3.48.0.tgz", - "integrity": "sha512-ImicSAG+lTotAe5izcs1fz49Zk48w7pDusqYg04WaPhCoej8BJ24soMu3iLXIrsi273s4P1gZrYGrqReMfgEEA==", - "license": "Apache-2.0", - "dependencies": { - "@internationalized/date": "^3.12.2", - "@internationalized/number": "^3.6.7", - "@internationalized/string": "^3.2.9", - "@react-types/shared": "^3.36.0", - "@swc/helpers": "^0.5.0", - "use-sync-external-store": "^1.6.0" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" - } - }, - "node_modules/react-style-singleton": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.3.tgz", - "integrity": "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ==", - "license": "MIT", - "dependencies": { - "get-nonce": "^1.0.0", - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/rollup": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.2.tgz", - "integrity": "sha512-RFnrW4lhXA3s3eqHDZvN654g8OTjzRfqpIRJYczCGB6HzphckVAi/Qh4tbPUbRuDi7s1Llv8g/NspLkttY3gTA==", - "license": "MIT", - "dependencies": { - "@types/estree": "1.0.9" - }, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.62.2", - "@rollup/rollup-android-arm64": "4.62.2", - "@rollup/rollup-darwin-arm64": "4.62.2", - "@rollup/rollup-darwin-x64": "4.62.2", - "@rollup/rollup-freebsd-arm64": "4.62.2", - "@rollup/rollup-freebsd-x64": "4.62.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.62.2", - "@rollup/rollup-linux-arm-musleabihf": "4.62.2", - "@rollup/rollup-linux-arm64-gnu": "4.62.2", - "@rollup/rollup-linux-arm64-musl": "4.62.2", - "@rollup/rollup-linux-loong64-gnu": "4.62.2", - "@rollup/rollup-linux-loong64-musl": "4.62.2", - "@rollup/rollup-linux-ppc64-gnu": "4.62.2", - "@rollup/rollup-linux-ppc64-musl": "4.62.2", - "@rollup/rollup-linux-riscv64-gnu": "4.62.2", - "@rollup/rollup-linux-riscv64-musl": "4.62.2", - "@rollup/rollup-linux-s390x-gnu": "4.62.2", - "@rollup/rollup-linux-x64-gnu": "4.62.2", - "@rollup/rollup-linux-x64-musl": "4.62.2", - "@rollup/rollup-openbsd-x64": "4.62.2", - "@rollup/rollup-openharmony-arm64": "4.62.2", - "@rollup/rollup-win32-arm64-msvc": "4.62.2", - "@rollup/rollup-win32-ia32-msvc": "4.62.2", - "@rollup/rollup-win32-x64-gnu": "4.62.2", - "@rollup/rollup-win32-x64-msvc": "4.62.2", - "fsevents": "~2.3.2" - } - }, - "node_modules/scheduler": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", - "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", - "license": "MIT" - }, - "node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/side-channel": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", - "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.4", - "side-channel-list": "^1.0.1", - "side-channel-map": "^1.0.1", - "side-channel-weakmap": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-list": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", - "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", - "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-weakmap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", - "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3", - "side-channel-map": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/tabbable": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.5.0.tgz", - "integrity": "sha512-wieBHXygIm7OyQOu5hQlkk62/WyCFYGlWg7L6/ZCUZwx0o398Zkn4pVmMyfYhfMG8kGrj/Krt8eIk6UKC6VzwA==", - "license": "MIT" - }, - "node_modules/tailwind-merge": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.6.0.tgz", - "integrity": "sha512-uxL7qAVQriqRQPAyK3pj66VqskWqoZ37PW94jwOTwNfq/z9oyu1V+eqrZqtR2+fCiXdYOZe/Modt8GtvqNzu+w==", - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/dcastil" - } - }, - "node_modules/tailwindcss": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.2.tgz", - "integrity": "sha512-WtctNNSH8A9jlMIqxzuYumOHU5uGZyRv0Q5svQl+oEPy5w84YpBxdb7MdqyiSPQge5jTJ6zFQLq0PFygdccSBA==", - "license": "MIT", - "peer": true - }, - "node_modules/tailwindcss-animate": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/tailwindcss-animate/-/tailwindcss-animate-1.0.7.tgz", - "integrity": "sha512-bl6mpH3T7I3UFxuvDEXLxy/VuFxBk5bbzplh7tXI68mwMokNYd1t9qPBHlnyTwfa4JGC4zP516I1hYYtQ/vspA==", - "license": "MIT", - "peerDependencies": { - "tailwindcss": ">=3.0.0 || insiders" - } - }, - "node_modules/tapable": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz", - "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==", - "license": "MIT", - "engines": { - "node": ">=6" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/tinyglobby": { - "version": "0.2.17", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", - "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", - "license": "MIT", - "dependencies": { - "fdir": "^6.5.0", - "picomatch": "^4.0.4" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/SuperchupuDev" - } - }, - "node_modules/tslib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" - }, - "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/update-browserslist-db": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", - "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/use-callback-ref": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.3.tgz", - "integrity": "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==", - "license": "MIT", - "dependencies": { - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/use-sidecar": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.3.tgz", - "integrity": "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ==", - "license": "MIT", - "dependencies": { - "detect-node-es": "^1.1.0", - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/use-sync-external-store": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz", - "integrity": "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==", - "license": "MIT", - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - } - }, - "node_modules/vite": { - "version": "6.4.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.3.tgz", - "integrity": "sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A==", - "license": "MIT", - "peer": true, - "dependencies": { - "esbuild": "^0.25.0", - "fdir": "^6.4.4", - "picomatch": "^4.0.2", - "postcss": "^8.5.3", - "rollup": "^4.34.9", - "tinyglobby": "^0.2.13" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^18.0.0 || ^20.0.0 || >=22.0.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", - "jiti": ">=1.21.0", - "less": "*", - "lightningcss": "^1.21.0", - "sass": "*", - "sass-embedded": "*", - "stylus": "*", - "sugarss": "*", - "terser": "^5.16.0", - "tsx": "^4.8.1", - "yaml": "^2.4.2" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "jiti": { - "optional": true - }, - "less": { - "optional": true - }, - "lightningcss": { - "optional": true - }, - "sass": { - "optional": true - }, - "sass-embedded": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - }, - "tsx": { - "optional": true - }, - "yaml": { - "optional": true - } - } - }, - "node_modules/vite-plugin-full-reload": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/vite-plugin-full-reload/-/vite-plugin-full-reload-1.2.0.tgz", - "integrity": "sha512-kz18NW79x0IHbxRSHm0jttP4zoO9P9gXh+n6UTwlNKnviTTEpOlum6oS9SmecrTtSr+muHEn5TUuC75UovQzcA==", - "license": "MIT", - "dependencies": { - "picocolors": "^1.0.0", - "picomatch": "^2.3.1" - } - }, - "node_modules/vite-plugin-full-reload/node_modules/picomatch": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", - "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", - "license": "MIT", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "license": "ISC" - } - } -} diff --git a/api/package.json b/api/package.json deleted file mode 100644 index 416206b..0000000 --- a/api/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "private": true, - "type": "module", - "scripts": { - "build": "vite build", - "build:ssr": "vite build && vite build --ssr", - "dev": "vite" - }, - "dependencies": { - "@headlessui/react": "^2.2.0", - "@inertiajs/react": "^2.0.0", - "@radix-ui/react-avatar": "^1.1.3", - "@radix-ui/react-checkbox": "^1.1.4", - "@radix-ui/react-collapsible": "^1.1.3", - "@radix-ui/react-dialog": "^1.1.6", - "@radix-ui/react-dropdown-menu": "^2.1.6", - "@radix-ui/react-label": "^2.1.2", - "@radix-ui/react-navigation-menu": "^1.2.5", - "@radix-ui/react-select": "^2.1.6", - "@radix-ui/react-separator": "^1.1.2", - "@radix-ui/react-slot": "^1.1.2", - "@radix-ui/react-toggle": "^1.1.2", - "@radix-ui/react-toggle-group": "^1.1.2", - "@radix-ui/react-tooltip": "^1.1.8", - "@tailwindcss/vite": "^4.0.6", - "@types/react": "^19.0.3", - "@types/react-dom": "^19.0.2", - "@vitejs/plugin-react": "^4.3.4", - "class-variance-authority": "^0.7.1", - "clsx": "^2.1.1", - "laravel-vite-plugin": "^1.0", - "lucide-react": "^0.475.0", - "react": "^19.0.0", - "react-dom": "^19.0.0", - "tailwind-merge": "^3.0.1", - "tailwindcss": "^4.0.0", - "tailwindcss-animate": "^1.0.7", - "typescript": "^5.7.2", - "vite": "^6.0" - } -} diff --git a/api/resources/css/app.css b/api/resources/css/app.css deleted file mode 100644 index fbc0436..0000000 --- a/api/resources/css/app.css +++ /dev/null @@ -1,159 +0,0 @@ -@import 'tailwindcss'; - -@plugin 'tailwindcss-animate'; - -@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php'; - -@custom-variant dark (&:is(.dark *)); - -@theme { - --font-sans: - 'Instrument Sans', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; - - --radius-lg: var(--radius); - --radius-md: calc(var(--radius) - 2px); - --radius-sm: calc(var(--radius) - 4px); - - --color-background: var(--background); - --color-foreground: var(--foreground); - - --color-card: var(--card); - --color-card-foreground: var(--card-foreground); - - --color-popover: var(--popover); - --color-popover-foreground: var(--popover-foreground); - - --color-primary: var(--primary); - --color-primary-foreground: var(--primary-foreground); - - --color-secondary: var(--secondary); - --color-secondary-foreground: var(--secondary-foreground); - - --color-muted: var(--muted); - --color-muted-foreground: var(--muted-foreground); - - --color-accent: var(--accent); - --color-accent-foreground: var(--accent-foreground); - - --color-destructive: var(--destructive); - --color-destructive-foreground: var(--destructive-foreground); - - --color-border: var(--border); - --color-input: var(--input); - --color-ring: var(--ring); - - --color-chart-1: var(--chart-1); - --color-chart-2: var(--chart-2); - --color-chart-3: var(--chart-3); - --color-chart-4: var(--chart-4); - --color-chart-5: var(--chart-5); - - --color-sidebar: var(--sidebar-background); - --color-sidebar-foreground: var(--sidebar-foreground); - --color-sidebar-primary: var(--sidebar-primary); - --color-sidebar-primary-foreground: var(--sidebar-primary-foreground); - --color-sidebar-accent: var(--sidebar-accent); - --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); - --color-sidebar-border: var(--sidebar-border); - --color-sidebar-ring: var(--sidebar-ring); -} - -/* - The default border color has changed to `currentColor` in Tailwind CSS v4, - so we've added these compatibility styles to make sure everything still - looks the same as it did with Tailwind CSS v3. - - If we ever want to remove these styles, we need to add an explicit border - color utility to any element that depends on these defaults. -*/ -@layer base { - *, - ::after, - ::before, - ::backdrop, - ::file-selector-button { - border-color: var(--color-gray-200, currentColor); - } -} - -:root { - --background: hsl(0, 0%, 100%); - --foreground: hsl(0, 0%, 3.9%); - --card: hsl(0, 0%, 100%); - --card-foreground: hsl(0, 0%, 3.9%); - --popover: hsl(0, 0%, 100%); - --popover-foreground: hsl(0, 0%, 3.9%); - --primary: hsl(0, 0%, 9%); - --primary-foreground: hsl(0, 0%, 98%); - --secondary: hsl(0, 0%, 96.1%); - --secondary-foreground: hsl(0, 0%, 9%); - --muted: hsl(0, 0%, 96.1%); - --muted-foreground: hsl(0, 0%, 45.1%); - --accent: hsl(0, 0%, 96.1%); - --accent-foreground: hsl(0, 0%, 9%); - --destructive: hsl(0, 84.2%, 60.2%); - --destructive-foreground: hsl(0, 0%, 98%); - --border: hsl(0, 0%, 92.8%); - --input: hsl(0, 0%, 89.8%); - --ring: hsl(0, 0%, 3.9%); - --chart-1: hsl(12, 76%, 61%); - --chart-2: hsl(173, 58%, 39%); - --chart-3: hsl(197, 37%, 24%); - --chart-4: hsl(43, 74%, 66%); - --chart-5: hsl(27, 87%, 67%); - --radius: 0.5rem; - --sidebar-background: hsl(0, 0%, 98%); - --sidebar-foreground: hsl(240, 5.3%, 30%); - --sidebar-primary: hsl(0, 0%, 10%); - --sidebar-primary-foreground: hsl(0, 0%, 98%); - --sidebar-accent: hsl(0, 0%, 94%); - --sidebar-accent-foreground: hsl(0, 0%, 30%); - --sidebar-border: hsl(0, 0%, 91%); - --sidebar-ring: hsl(217.2, 91.2%, 59.8%); -} - -.dark { - --background: hsl(240, 10%, 4%); - --foreground: hsl(0, 0%, 90%); - --card: hsl(240, 10%, 8%); - --card-foreground: hsl(0, 0%, 95%); - --popover: hsl(240, 10%, 8%); - --popover-foreground: hsl(0, 0%, 95%); - --primary: hsl(47, 95%, 50%); - --primary-foreground: hsl(26, 80%, 10%); - --secondary: hsl(240, 5%, 15%); - --secondary-foreground: hsl(0, 0%, 95%); - --muted: hsl(240, 5%, 12%); - --muted-foreground: hsl(240, 5%, 60%); - --accent: hsl(240, 5%, 20%); - --accent-foreground: hsl(0, 0%, 100%); - --destructive: hsl(0, 80%, 40%); - --destructive-foreground: hsl(0, 0%, 100%); - --border: hsl(240, 5%, 15%); - --input: hsl(240, 5%, 12%); - --ring: hsl(47, 95%, 50%); - --forum-bg: #0a0a0c; - --forum-border: #1f1f24; - --sidebar-background: hsl(240, 10%, 6%); - --sidebar-foreground: hsl(0, 0%, 80%); - --sidebar-primary: hsl(47, 95%, 50%); - --sidebar-primary-foreground: hsl(26, 80%, 10%); - --sidebar-accent: hsl(240, 5%, 15%); - --sidebar-accent-foreground: hsl(0, 0%, 95%); - --sidebar-border: hsl(240, 5%, 15%); - --sidebar-ring: hsl(47, 95%, 50%); -} - -@layer base { - * { - @apply border-border; - } - - body { - @apply bg-background text-foreground; - background-color: var(--forum-bg, hsl(240, 10%, 4%)); - background-image: - radial-gradient(at 0% 0%, rgba(47, 95, 255, 0.05) 0px, transparent 50%), - radial-gradient(at 100% 0%, rgba(255, 47, 47, 0.03) 0px, transparent 50%); - } -} diff --git a/api/resources/js/app.tsx b/api/resources/js/app.tsx deleted file mode 100644 index b1ce502..0000000 --- a/api/resources/js/app.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import '../css/app.css'; - -import { createInertiaApp } from '@inertiajs/react'; -import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'; -import { createRoot } from 'react-dom/client'; -import { route as routeFn } from 'ziggy-js'; -import { initializeTheme } from './hooks/use-appearance'; - -declare global { - const route: typeof routeFn; -} - -const appName = import.meta.env.VITE_APP_NAME || 'Laravel'; - -createInertiaApp({ - title: (title) => `${title} - ${appName}`, - resolve: (name) => resolvePageComponent(`./pages/${name}.tsx`, import.meta.glob('./pages/**/*.tsx')), - setup({ el, App, props }) { - const root = createRoot(el); - - root.render(); - }, - progress: { - color: '#eab308', - }, -}); - -// This will set light / dark mode on load... -initializeTheme(); diff --git a/api/resources/js/components/app-content.tsx b/api/resources/js/components/app-content.tsx deleted file mode 100644 index ae43d9e..0000000 --- a/api/resources/js/components/app-content.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { SidebarInset } from '@/components/ui/sidebar'; -import * as React from 'react'; - -interface AppContentProps extends React.ComponentProps<'div'> { - variant?: 'header' | 'sidebar'; -} - -export function AppContent({ variant = 'header', children, ...props }: AppContentProps) { - if (variant === 'sidebar') { - return {children}; - } - - return ( -
- {children} -
- ); -} diff --git a/api/resources/js/components/app-header.tsx b/api/resources/js/components/app-header.tsx deleted file mode 100644 index d151697..0000000 --- a/api/resources/js/components/app-header.tsx +++ /dev/null @@ -1,182 +0,0 @@ -import { Breadcrumbs } from '@/components/breadcrumbs'; -import { Icon } from '@/components/icon'; -import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; -import { Button } from '@/components/ui/button'; -import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from '@/components/ui/dropdown-menu'; -import { NavigationMenu, NavigationMenuItem, NavigationMenuList, navigationMenuTriggerStyle } from '@/components/ui/navigation-menu'; -import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from '@/components/ui/sheet'; -import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'; -import { UserMenuContent } from '@/components/user-menu-content'; -import { useInitials } from '@/hooks/use-initials'; -import { cn } from '@/lib/utils'; -import { type BreadcrumbItem, type NavItem, type SharedData } from '@/types'; -import { Link, usePage } from '@inertiajs/react'; -import { BookOpen, Folder, LayoutGrid, Menu, Search } from 'lucide-react'; -import AppLogo from './app-logo'; -import AppLogoIcon from './app-logo-icon'; - -const mainNavItems: NavItem[] = [ - { - title: 'Dashboard', - url: '/dashboard', - icon: LayoutGrid, - }, -]; - -const rightNavItems: NavItem[] = [ - { - title: 'Repository', - url: 'https://github.com/laravel/react-starter-kit', - icon: Folder, - }, - { - title: 'Documentation', - url: 'https://laravel.com/docs/starter-kits', - icon: BookOpen, - }, -]; - -const activeItemStyles = 'text-neutral-900 dark:bg-neutral-800 dark:text-neutral-100'; - -interface AppHeaderProps { - breadcrumbs?: BreadcrumbItem[]; -} - -export function AppHeader({ breadcrumbs = [] }: AppHeaderProps) { - const page = usePage(); - const { auth } = page.props; - const getInitials = useInitials(); - return ( - <> -
-
- {/* Mobile Menu */} -
- - - - - - Navigation Menu - - - -
-
-
- {mainNavItems.map((item) => ( - - {item.icon && } - {item.title} - - ))} -
- -
- {rightNavItems.map((item) => ( - - {item.icon && } - {item.title} - - ))} -
-
-
-
-
-
- - - - - - {/* Desktop Navigation */} -
- - - {mainNavItems.map((item, index) => ( - - - {item.icon && } - {item.title} - - {page.url === item.url && ( -
- )} -
- ))} -
-
-
- -
-
- -
- {rightNavItems.map((item) => ( - - - - - {item.title} - {item.icon && } - - - -

{item.title}

-
-
-
- ))} -
-
- - - - - - - - -
-
-
- {breadcrumbs.length > 1 && ( -
-
- -
-
- )} - - ); -} diff --git a/api/resources/js/components/app-logo-icon.tsx b/api/resources/js/components/app-logo-icon.tsx deleted file mode 100644 index 9bd62ad..0000000 --- a/api/resources/js/components/app-logo-icon.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { SVGAttributes } from 'react'; - -export default function AppLogoIcon(props: SVGAttributes) { - return ( - - - - ); -} diff --git a/api/resources/js/components/app-logo.tsx b/api/resources/js/components/app-logo.tsx deleted file mode 100644 index a03784c..0000000 --- a/api/resources/js/components/app-logo.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import AppLogoIcon from './app-logo-icon'; - -export default function AppLogo() { - return ( - <> -
- -
-
- Laravel Starter Kit -
- - ); -} diff --git a/api/resources/js/components/app-shell.tsx b/api/resources/js/components/app-shell.tsx deleted file mode 100644 index 1e57611..0000000 --- a/api/resources/js/components/app-shell.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { SidebarProvider } from '@/components/ui/sidebar'; -import { useState } from 'react'; - -interface AppShellProps { - children: React.ReactNode; - variant?: 'header' | 'sidebar'; -} - -export function AppShell({ children, variant = 'header' }: AppShellProps) { - const [isOpen, setIsOpen] = useState(() => (typeof window !== 'undefined' ? localStorage.getItem('sidebar') !== 'false' : true)); - - const handleSidebarChange = (open: boolean) => { - setIsOpen(open); - - if (typeof window !== 'undefined') { - localStorage.setItem('sidebar', String(open)); - } - }; - - if (variant === 'header') { - return
{children}
; - } - - return ( - - {children} - - ); -} diff --git a/api/resources/js/components/app-sidebar-header.tsx b/api/resources/js/components/app-sidebar-header.tsx deleted file mode 100644 index e31381e..0000000 --- a/api/resources/js/components/app-sidebar-header.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { Breadcrumbs } from '@/components/breadcrumbs'; -import { SidebarTrigger } from '@/components/ui/sidebar'; -import { type BreadcrumbItem as BreadcrumbItemType } from '@/types'; - -export function AppSidebarHeader({ breadcrumbs = [] }: { breadcrumbs?: BreadcrumbItemType[] }) { - return ( -
-
- - -
-
- ); -} diff --git a/api/resources/js/components/app-sidebar.tsx b/api/resources/js/components/app-sidebar.tsx deleted file mode 100644 index cd00fbd..0000000 --- a/api/resources/js/components/app-sidebar.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { NavFooter } from '@/components/nav-footer'; -import { NavMain } from '@/components/nav-main'; -import { NavUser } from '@/components/nav-user'; -import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem } from '@/components/ui/sidebar'; -import { type NavItem } from '@/types'; -import { Link } from '@inertiajs/react'; -import { BookOpen, Folder, LayoutGrid } from 'lucide-react'; -import AppLogo from './app-logo'; - -const mainNavItems: NavItem[] = [ - { - title: 'Dashboard', - url: '/dashboard', - icon: LayoutGrid, - }, -]; - -const footerNavItems: NavItem[] = [ - { - title: 'Repository', - url: 'https://github.com/laravel/react-starter-kit', - icon: Folder, - }, - { - title: 'Documentation', - url: 'https://laravel.com/docs/starter-kits', - icon: BookOpen, - }, -]; - -export function AppSidebar() { - return ( - - - - - - - - - - - - - - - - - - - - - - - ); -} diff --git a/api/resources/js/components/appearance-dropdown.tsx b/api/resources/js/components/appearance-dropdown.tsx deleted file mode 100644 index 89a4586..0000000 --- a/api/resources/js/components/appearance-dropdown.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import { Button } from '@/components/ui/button'; -import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/components/ui/dropdown-menu'; -import { useAppearance } from '@/hooks/use-appearance'; -import { Monitor, Moon, Sun } from 'lucide-react'; -import { HTMLAttributes } from 'react'; - -export default function AppearanceToggleDropdown({ className = '', ...props }: HTMLAttributes) { - const { appearance, updateAppearance } = useAppearance(); - - const getCurrentIcon = () => { - switch (appearance) { - case 'dark': - return ; - case 'light': - return ; - default: - return ; - } - }; - - return ( -
- - - - - - updateAppearance('light')}> - - - Light - - - updateAppearance('dark')}> - - - Dark - - - updateAppearance('system')}> - - - System - - - - -
- ); -} diff --git a/api/resources/js/components/appearance-tabs.tsx b/api/resources/js/components/appearance-tabs.tsx deleted file mode 100644 index 900b0f2..0000000 --- a/api/resources/js/components/appearance-tabs.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { Appearance, useAppearance } from '@/hooks/use-appearance'; -import { cn } from '@/lib/utils'; -import { LucideIcon, Monitor, Moon, Sun } from 'lucide-react'; -import { HTMLAttributes } from 'react'; - -export default function AppearanceToggleTab({ className = '', ...props }: HTMLAttributes) { - const { appearance, updateAppearance } = useAppearance(); - - const tabs: { value: Appearance; icon: LucideIcon; label: string }[] = [ - { value: 'light', icon: Sun, label: 'Light' }, - { value: 'dark', icon: Moon, label: 'Dark' }, - { value: 'system', icon: Monitor, label: 'System' }, - ]; - - return ( -
- {tabs.map(({ value, icon: Icon, label }) => ( - - ))} -
- ); -} diff --git a/api/resources/js/components/breadcrumbs.tsx b/api/resources/js/components/breadcrumbs.tsx deleted file mode 100644 index d92b4c1..0000000 --- a/api/resources/js/components/breadcrumbs.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from '@/components/ui/breadcrumb'; -import { type BreadcrumbItem as BreadcrumbItemType } from '@/types'; -import { Fragment } from 'react'; - -export function Breadcrumbs({ breadcrumbs }: { breadcrumbs: BreadcrumbItemType[] }) { - return ( - <> - {breadcrumbs.length > 0 && ( - - - {breadcrumbs.map((item, index) => { - const isLast = index === breadcrumbs.length - 1; - return ( - - - {isLast ? ( - {item.title} - ) : ( - {item.title} - )} - - {!isLast && } - - ); - })} - - - )} - - ); -} diff --git a/api/resources/js/components/delete-user.tsx b/api/resources/js/components/delete-user.tsx deleted file mode 100644 index 52caed2..0000000 --- a/api/resources/js/components/delete-user.tsx +++ /dev/null @@ -1,90 +0,0 @@ -import { useForm } from '@inertiajs/react'; -import { FormEventHandler, useRef } from 'react'; - -// Components... -import InputError from '@/components/input-error'; -import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; -import { Label } from '@/components/ui/label'; - -import HeadingSmall from '@/components/heading-small'; - -import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogTitle, DialogTrigger } from '@/components/ui/dialog'; - -export default function DeleteUser() { - const passwordInput = useRef(null); - const { data, setData, delete: destroy, processing, reset, errors, clearErrors } = useForm({ password: '' }); - - const deleteUser: FormEventHandler = (e) => { - e.preventDefault(); - - destroy(route('profile.destroy'), { - preserveScroll: true, - onSuccess: () => closeModal(), - onError: () => passwordInput.current?.focus(), - onFinish: () => reset(), - }); - }; - - const closeModal = () => { - clearErrors(); - reset(); - }; - - return ( -
- -
-
-

Warning

-

Please proceed with caution, this cannot be undone.

-
- - - - - - - Are you sure you want to delete your account? - - Once your account is deleted, all of its resources and data will also be permanently deleted. Please enter your password - to confirm you would like to permanently delete your account. - -
-
- - - setData('password', e.target.value)} - placeholder="Password" - autoComplete="current-password" - /> - - -
- - - - - - - - - -
-
-
-
-
- ); -} diff --git a/api/resources/js/components/heading-small.tsx b/api/resources/js/components/heading-small.tsx deleted file mode 100644 index b71a16e..0000000 --- a/api/resources/js/components/heading-small.tsx +++ /dev/null @@ -1,8 +0,0 @@ -export default function HeadingSmall({ title, description }: { title: string; description?: string }) { - return ( -
-

{title}

- {description &&

{description}

} -
- ); -} diff --git a/api/resources/js/components/heading.tsx b/api/resources/js/components/heading.tsx deleted file mode 100644 index 40b3982..0000000 --- a/api/resources/js/components/heading.tsx +++ /dev/null @@ -1,10 +0,0 @@ -export default function Heading({ title, description }: { title: string; description?: string }) { - return ( - <> -
-

{title}

- {description &&

{description}

} -
- - ); -} diff --git a/api/resources/js/components/icon.tsx b/api/resources/js/components/icon.tsx deleted file mode 100644 index fe958b4..0000000 --- a/api/resources/js/components/icon.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { cn } from '@/lib/utils'; -import { type LucideProps } from 'lucide-react'; - -interface IconProps extends Omit { - iconNode: React.ComponentType; -} - -export function Icon({ iconNode: IconComponent, className, ...props }: IconProps) { - return ; -} diff --git a/api/resources/js/components/input-error.tsx b/api/resources/js/components/input-error.tsx deleted file mode 100644 index be62fef..0000000 --- a/api/resources/js/components/input-error.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { cn } from '@/lib/utils'; -import { HTMLAttributes } from 'react'; - -export default function InputError({ message, className = '', ...props }: HTMLAttributes & { message?: string }) { - return message ? ( -

- {message} -

- ) : null; -} diff --git a/api/resources/js/components/nav-footer.tsx b/api/resources/js/components/nav-footer.tsx deleted file mode 100644 index e27a2ba..0000000 --- a/api/resources/js/components/nav-footer.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { Icon } from '@/components/icon'; -import { SidebarGroup, SidebarGroupContent, SidebarMenu, SidebarMenuButton, SidebarMenuItem } from '@/components/ui/sidebar'; -import { type NavItem } from '@/types'; - -export function NavFooter({ - items, - className, - ...props -}: React.ComponentPropsWithoutRef & { - items: NavItem[]; -}) { - return ( - - - - {items.map((item) => ( - - - - {item.icon && } - {item.title} - - - - ))} - - - - ); -} diff --git a/api/resources/js/components/nav-main.tsx b/api/resources/js/components/nav-main.tsx deleted file mode 100644 index 08a1ed5..0000000 --- a/api/resources/js/components/nav-main.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { SidebarGroup, SidebarGroupLabel, SidebarMenu, SidebarMenuButton, SidebarMenuItem } from '@/components/ui/sidebar'; -import { type NavItem } from '@/types'; -import { Link, usePage } from '@inertiajs/react'; - -export function NavMain({ items = [] }: { items: NavItem[] }) { - const page = usePage(); - return ( - - Platform - - {items.map((item) => ( - - - - {item.icon && } - {item.title} - - - - ))} - - - ); -} diff --git a/api/resources/js/components/nav-user.tsx b/api/resources/js/components/nav-user.tsx deleted file mode 100644 index 1210250..0000000 --- a/api/resources/js/components/nav-user.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from '@/components/ui/dropdown-menu'; -import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar } from '@/components/ui/sidebar'; -import { UserInfo } from '@/components/user-info'; -import { UserMenuContent } from '@/components/user-menu-content'; -import { useIsMobile } from '@/hooks/use-mobile'; -import { type SharedData } from '@/types'; -import { usePage } from '@inertiajs/react'; -import { ChevronsUpDown } from 'lucide-react'; - -export function NavUser() { - const { auth } = usePage().props; - const { state } = useSidebar(); - const isMobile = useIsMobile(); - - return ( - - - - - - - - - - - - - - - - ); -} diff --git a/api/resources/js/components/text-link.tsx b/api/resources/js/components/text-link.tsx deleted file mode 100644 index 1c2ddb8..0000000 --- a/api/resources/js/components/text-link.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { cn } from '@/lib/utils'; -import { Link } from '@inertiajs/react'; -import { ComponentProps } from 'react'; - -type LinkProps = ComponentProps; - -export default function TextLink({ className = '', children, ...props }: LinkProps) { - return ( - - {children} - - ); -} diff --git a/api/resources/js/components/ui/alert.tsx b/api/resources/js/components/ui/alert.tsx deleted file mode 100644 index 884d738..0000000 --- a/api/resources/js/components/ui/alert.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { cva, type VariantProps } from 'class-variance-authority'; -import * as React from 'react'; - -import { cn } from '@/lib/utils'; - -const alertVariants = cva( - 'relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground', - { - variants: { - variant: { - default: 'bg-background text-foreground', - destructive: 'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive', - }, - }, - defaultVariants: { - variant: 'default', - }, - }, -); - -const Alert = React.forwardRef & VariantProps>( - ({ className, variant, ...props }, ref) =>
, -); -Alert.displayName = 'Alert'; - -const AlertTitle = React.forwardRef>(({ className, ...props }, ref) => ( -
-)); -AlertTitle.displayName = 'AlertTitle'; - -const AlertDescription = React.forwardRef>(({ className, ...props }, ref) => ( -
-)); -AlertDescription.displayName = 'AlertDescription'; - -export { Alert, AlertDescription, AlertTitle }; diff --git a/api/resources/js/components/ui/avatar.tsx b/api/resources/js/components/ui/avatar.tsx deleted file mode 100644 index 4e3c2b1..0000000 --- a/api/resources/js/components/ui/avatar.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import * as AvatarPrimitive from '@radix-ui/react-avatar'; -import * as React from 'react'; - -import { cn } from '@/lib/utils'; - -const Avatar = React.forwardRef, React.ComponentPropsWithoutRef>( - ({ className, ...props }, ref) => ( - - ), -); -Avatar.displayName = AvatarPrimitive.Root.displayName; - -const AvatarImage = React.forwardRef, React.ComponentPropsWithoutRef>( - ({ className, ...props }, ref) => , -); -AvatarImage.displayName = AvatarPrimitive.Image.displayName; - -const AvatarFallback = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); -AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName; - -export { Avatar, AvatarFallback, AvatarImage }; diff --git a/api/resources/js/components/ui/badge.tsx b/api/resources/js/components/ui/badge.tsx deleted file mode 100644 index 4e6c1c8..0000000 --- a/api/resources/js/components/ui/badge.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { cva, type VariantProps } from 'class-variance-authority'; -import * as React from 'react'; - -import { cn } from '@/lib/utils'; - -const badgeVariants = cva( - 'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2', - { - variants: { - variant: { - default: 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80', - secondary: 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80', - destructive: 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80', - outline: 'text-foreground', - }, - }, - defaultVariants: { - variant: 'default', - }, - }, -); - -export interface BadgeProps extends React.HTMLAttributes, VariantProps {} - -function Badge({ className, variant, ...props }: BadgeProps) { - return
; -} - -export { Badge, badgeVariants }; diff --git a/api/resources/js/components/ui/breadcrumb.tsx b/api/resources/js/components/ui/breadcrumb.tsx deleted file mode 100644 index 6cee541..0000000 --- a/api/resources/js/components/ui/breadcrumb.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import { Slot } from '@radix-ui/react-slot'; -import { ChevronRight, MoreHorizontal } from 'lucide-react'; -import * as React from 'react'; - -import { cn } from '@/lib/utils'; - -const Breadcrumb = React.forwardRef< - HTMLElement, - React.ComponentPropsWithoutRef<'nav'> & { - separator?: React.ReactNode; - } ->(({ ...props }, ref) => - - - - -
-
{children}
-
-
-
- ); -} diff --git a/api/resources/js/lib/utils.ts b/api/resources/js/lib/utils.ts deleted file mode 100644 index dd53ea8..0000000 --- a/api/resources/js/lib/utils.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { type ClassValue, clsx } from 'clsx'; -import { twMerge } from 'tailwind-merge'; - -export function cn(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)); -} diff --git a/api/resources/js/pages/auth/confirm-password.tsx b/api/resources/js/pages/auth/confirm-password.tsx deleted file mode 100644 index 5b3e7db..0000000 --- a/api/resources/js/pages/auth/confirm-password.tsx +++ /dev/null @@ -1,60 +0,0 @@ -// Components -import { Head, useForm } from '@inertiajs/react'; -import { LoaderCircle } from 'lucide-react'; -import { FormEventHandler } from 'react'; - -import InputError from '@/components/input-error'; -import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; -import { Label } from '@/components/ui/label'; -import AuthLayout from '@/layouts/auth-layout'; - -export default function ConfirmPassword() { - const { data, setData, post, processing, errors, reset } = useForm({ - password: '', - }); - - const submit: FormEventHandler = (e) => { - e.preventDefault(); - - post(route('password.confirm'), { - onFinish: () => reset('password'), - }); - }; - - return ( - - - -
-
-
- - setData('password', e.target.value)} - /> - - -
- -
- -
-
-
-
- ); -} diff --git a/api/resources/js/pages/auth/forgot-password.tsx b/api/resources/js/pages/auth/forgot-password.tsx deleted file mode 100644 index 82e1716..0000000 --- a/api/resources/js/pages/auth/forgot-password.tsx +++ /dev/null @@ -1,63 +0,0 @@ -// Components -import { Head, useForm } from '@inertiajs/react'; -import { LoaderCircle } from 'lucide-react'; -import { FormEventHandler } from 'react'; - -import InputError from '@/components/input-error'; -import TextLink from '@/components/text-link'; -import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; -import { Label } from '@/components/ui/label'; -import AuthLayout from '@/layouts/auth-layout'; - -export default function ForgotPassword({ status }: { status?: string }) { - const { data, setData, post, processing, errors } = useForm({ - email: '', - }); - - const submit: FormEventHandler = (e) => { - e.preventDefault(); - - post(route('password.email')); - }; - - return ( - - - - {status &&
{status}
} - -
-
-
- - setData('email', e.target.value)} - placeholder="email@example.com" - /> - - -
- -
- -
-
- -
- Or, return to - log in -
-
-
- ); -} diff --git a/api/resources/js/pages/auth/login.tsx b/api/resources/js/pages/auth/login.tsx deleted file mode 100644 index 0c329cd..0000000 --- a/api/resources/js/pages/auth/login.tsx +++ /dev/null @@ -1,104 +0,0 @@ -import { Head, useForm } from '@inertiajs/react'; -import { LoaderCircle } from 'lucide-react'; -import { FormEventHandler } from 'react'; - -import InputError from '@/components/input-error'; -import TextLink from '@/components/text-link'; -import { Button } from '@/components/ui/button'; -import { Checkbox } from '@/components/ui/checkbox'; -import { Input } from '@/components/ui/input'; -import { Label } from '@/components/ui/label'; -import AuthLayout from '@/layouts/auth-layout'; - -interface LoginForm { - email: string; - password: string; - remember: boolean; -} - -interface LoginProps { - status?: string; - canResetPassword: boolean; -} - -export default function Login({ status, canResetPassword }: LoginProps) { - const { data, setData, post, processing, errors, reset } = useForm({ - email: '', - password: '', - remember: false, - }); - - const submit: FormEventHandler = (e) => { - e.preventDefault(); - post(route('login'), { - onFinish: () => reset('password'), - }); - }; - - return ( - - - -
-
-
- - setData('email', e.target.value)} - placeholder="email@example.com" - /> - -
- -
-
- - {canResetPassword && ( - - Forgot password? - - )} -
- setData('password', e.target.value)} - placeholder="Password" - /> - -
- -
- - -
- - -
- -
- Don't have an account?{' '} - - Sign up - -
-
- - {status &&
{status}
} -
- ); -} diff --git a/api/resources/js/pages/auth/register.tsx b/api/resources/js/pages/auth/register.tsx deleted file mode 100644 index 39fd411..0000000 --- a/api/resources/js/pages/auth/register.tsx +++ /dev/null @@ -1,119 +0,0 @@ -import { Head, useForm } from '@inertiajs/react'; -import { LoaderCircle } from 'lucide-react'; -import { FormEventHandler } from 'react'; - -import InputError from '@/components/input-error'; -import TextLink from '@/components/text-link'; -import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; -import { Label } from '@/components/ui/label'; -import AuthLayout from '@/layouts/auth-layout'; - -interface RegisterForm { - name: string; - email: string; - password: string; - password_confirmation: string; -} - -export default function Register() { - const { data, setData, post, processing, errors, reset } = useForm({ - name: '', - email: '', - password: '', - password_confirmation: '', - }); - - const submit: FormEventHandler = (e) => { - e.preventDefault(); - post(route('register'), { - onFinish: () => reset('password', 'password_confirmation'), - }); - }; - - return ( - - -
-
-
- - setData('name', e.target.value)} - disabled={processing} - placeholder="Full name" - /> - -
- -
- - setData('email', e.target.value)} - disabled={processing} - placeholder="email@example.com" - /> - -
- -
- - setData('password', e.target.value)} - disabled={processing} - placeholder="Password" - /> - -
- -
- - setData('password_confirmation', e.target.value)} - disabled={processing} - placeholder="Confirm password" - /> - -
- - -
- -
- Already have an account?{' '} - - Log in - -
-
-
- ); -} diff --git a/api/resources/js/pages/auth/reset-password.tsx b/api/resources/js/pages/auth/reset-password.tsx deleted file mode 100644 index 220d2ff..0000000 --- a/api/resources/js/pages/auth/reset-password.tsx +++ /dev/null @@ -1,98 +0,0 @@ -import { Head, useForm } from '@inertiajs/react'; -import { LoaderCircle } from 'lucide-react'; -import { FormEventHandler } from 'react'; - -import InputError from '@/components/input-error'; -import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; -import { Label } from '@/components/ui/label'; -import AuthLayout from '@/layouts/auth-layout'; - -interface ResetPasswordProps { - token: string; - email: string; -} - -interface ResetPasswordForm { - token: string; - email: string; - password: string; - password_confirmation: string; -} - -export default function ResetPassword({ token, email }: ResetPasswordProps) { - const { data, setData, post, processing, errors, reset } = useForm({ - token: token, - email: email, - password: '', - password_confirmation: '', - }); - - const submit: FormEventHandler = (e) => { - e.preventDefault(); - post(route('password.store'), { - onFinish: () => reset('password', 'password_confirmation'), - }); - }; - - return ( - - - -
-
-
- - setData('email', e.target.value)} - /> - -
- -
- - setData('password', e.target.value)} - placeholder="Password" - /> - -
- -
- - setData('password_confirmation', e.target.value)} - placeholder="Confirm password" - /> - -
- - -
-
-
- ); -} diff --git a/api/resources/js/pages/auth/verify-email.tsx b/api/resources/js/pages/auth/verify-email.tsx deleted file mode 100644 index b4f7846..0000000 --- a/api/resources/js/pages/auth/verify-email.tsx +++ /dev/null @@ -1,41 +0,0 @@ -// Components -import { Head, useForm } from '@inertiajs/react'; -import { LoaderCircle } from 'lucide-react'; -import { FormEventHandler } from 'react'; - -import TextLink from '@/components/text-link'; -import { Button } from '@/components/ui/button'; -import AuthLayout from '@/layouts/auth-layout'; - -export default function VerifyEmail({ status }: { status?: string }) { - const { post, processing } = useForm({}); - - const submit: FormEventHandler = (e) => { - e.preventDefault(); - - post(route('verification.send')); - }; - - return ( - - - - {status === 'verification-link-sent' && ( -
- A new verification link has been sent to the email address you provided during registration. -
- )} - -
- - - - Log out - -
-
- ); -} diff --git a/api/resources/js/pages/dashboard.tsx b/api/resources/js/pages/dashboard.tsx deleted file mode 100644 index 53baa94..0000000 --- a/api/resources/js/pages/dashboard.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { PlaceholderPattern } from '@/components/ui/placeholder-pattern'; -import AppLayout from '@/layouts/app-layout'; -import { type BreadcrumbItem } from '@/types'; -import { Head } from '@inertiajs/react'; - -const breadcrumbs: BreadcrumbItem[] = [ - { - title: 'Dashboard', - href: '/dashboard', - }, -]; - -export default function Dashboard() { - return ( - - -
-
-
- -
-
- -
-
- -
-
-
- -
-
-
- ); -} diff --git a/api/resources/js/pages/settings/appearance.tsx b/api/resources/js/pages/settings/appearance.tsx deleted file mode 100644 index 5099b25..0000000 --- a/api/resources/js/pages/settings/appearance.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { Head } from '@inertiajs/react'; - -import AppearanceTabs from '@/components/appearance-tabs'; -import HeadingSmall from '@/components/heading-small'; -import { type BreadcrumbItem } from '@/types'; - -import AppLayout from '@/layouts/app-layout'; -import SettingsLayout from '@/layouts/settings/layout'; - -const breadcrumbs: BreadcrumbItem[] = [ - { - title: 'Appearance settings', - href: '/settings/appearance', - }, -]; - -export default function Appearance() { - return ( - - - - -
- - -
-
-
- ); -} diff --git a/api/resources/js/pages/settings/password.tsx b/api/resources/js/pages/settings/password.tsx deleted file mode 100644 index 04b710d..0000000 --- a/api/resources/js/pages/settings/password.tsx +++ /dev/null @@ -1,128 +0,0 @@ -import InputError from '@/components/input-error'; -import AppLayout from '@/layouts/app-layout'; -import SettingsLayout from '@/layouts/settings/layout'; -import { type BreadcrumbItem } from '@/types'; -import { Transition } from '@headlessui/react'; -import { Head, useForm } from '@inertiajs/react'; -import { FormEventHandler, useRef } from 'react'; - -import HeadingSmall from '@/components/heading-small'; -import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; -import { Label } from '@/components/ui/label'; - -const breadcrumbs: BreadcrumbItem[] = [ - { - title: 'Password settings', - href: '/settings/password', - }, -]; - -export default function Password() { - const passwordInput = useRef(null); - const currentPasswordInput = useRef(null); - - const { data, setData, errors, put, reset, processing, recentlySuccessful } = useForm({ - current_password: '', - password: '', - password_confirmation: '', - }); - - const updatePassword: FormEventHandler = (e) => { - e.preventDefault(); - - put(route('password.update'), { - preserveScroll: true, - onSuccess: () => reset(), - onError: (errors) => { - if (errors.password) { - reset('password', 'password_confirmation'); - passwordInput.current?.focus(); - } - - if (errors.current_password) { - reset('current_password'); - currentPasswordInput.current?.focus(); - } - }, - }); - }; - - return ( - - - - -
- - -
-
- - - setData('current_password', e.target.value)} - type="password" - className="mt-1 block w-full" - autoComplete="current-password" - placeholder="Current password" - /> - - -
- -
- - - setData('password', e.target.value)} - type="password" - className="mt-1 block w-full" - autoComplete="new-password" - placeholder="New password" - /> - - -
- -
- - - setData('password_confirmation', e.target.value)} - type="password" - className="mt-1 block w-full" - autoComplete="new-password" - placeholder="Confirm password" - /> - - -
- -
- - - -

Saved

-
-
-
-
-
-
- ); -} diff --git a/api/resources/js/pages/settings/profile.tsx b/api/resources/js/pages/settings/profile.tsx deleted file mode 100644 index fe571db..0000000 --- a/api/resources/js/pages/settings/profile.tsx +++ /dev/null @@ -1,120 +0,0 @@ -import { type BreadcrumbItem, type SharedData } from '@/types'; -import { Transition } from '@headlessui/react'; -import { Head, Link, useForm, usePage } from '@inertiajs/react'; -import { FormEventHandler } from 'react'; - -import DeleteUser from '@/components/delete-user'; -import HeadingSmall from '@/components/heading-small'; -import InputError from '@/components/input-error'; -import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; -import { Label } from '@/components/ui/label'; -import AppLayout from '@/layouts/app-layout'; -import SettingsLayout from '@/layouts/settings/layout'; - -const breadcrumbs: BreadcrumbItem[] = [ - { - title: 'Profile settings', - href: '/settings/profile', - }, -]; - -export default function Profile({ mustVerifyEmail, status }: { mustVerifyEmail: boolean; status?: string }) { - const { auth } = usePage().props; - - const { data, setData, patch, errors, processing, recentlySuccessful } = useForm({ - name: auth.user.name, - email: auth.user.email, - }); - - const submit: FormEventHandler = (e) => { - e.preventDefault(); - - patch(route('profile.update')); - }; - - return ( - - - - -
- - -
-
- - - setData('name', e.target.value)} - required - autoComplete="name" - placeholder="Full name" - /> - - -
- -
- - - setData('email', e.target.value)} - required - autoComplete="username" - placeholder="Email address" - /> - - -
- - {mustVerifyEmail && auth.user.email_verified_at === null && ( -
-

- Your email address is unverified. - - Click here to re-send the verification email. - -

- - {status === 'verification-link-sent' && ( -
- A new verification link has been sent to your email address. -
- )} -
- )} - -
- - - -

Saved

-
-
-
-
- - -
-
- ); -} diff --git a/api/resources/js/pages/welcome.tsx b/api/resources/js/pages/welcome.tsx deleted file mode 100644 index 5ee0ae6..0000000 --- a/api/resources/js/pages/welcome.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { Button } from '@/components/ui/button'; -import { Head } from '@inertiajs/react'; - -export default function Welcome() { - return ( - <> - -
-
-
-

- Migration Laravel -

-

- Swor -

-

- Portail vers vos aventures Star Wars Roleplay — monolithe Laravel + Inertia + - React. -

-
- -
- - -
- -

- Composant Button porté depuis{' '} - front/src/shared/components/ui/Button.tsx -

-
-
- - ); -} diff --git a/api/resources/js/ssr.jsx b/api/resources/js/ssr.jsx deleted file mode 100644 index 94c8270..0000000 --- a/api/resources/js/ssr.jsx +++ /dev/null @@ -1,21 +0,0 @@ -/* prettier-ignore */ -import { -createInertiaApp -} from '@inertiajs/react'; -import createServer from '@inertiajs/react/server'; -import ReactDOMServer from 'react-dom/server'; - -createServer((page) => - createInertiaApp({ - page, - render: ReactDOMServer.renderToString, - resolve: (name) => { - const pages = import.meta.glob('./pages/**/*.tsx', { - eager: true, - }); - return pages[`./pages/${name}.tsx`]; - }, - // prettier-ignore - setup: ({ App, props }) => , - }), -); diff --git a/api/resources/js/types/index.ts b/api/resources/js/types/index.ts deleted file mode 100644 index 9929c24..0000000 --- a/api/resources/js/types/index.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { LucideIcon } from 'lucide-react'; - -export interface Auth { - user: User; -} - -export interface BreadcrumbItem { - title: string; - href: string; -} - -export interface NavGroup { - title: string; - items: NavItem[]; -} - -export interface NavItem { - title: string; - url: string; - icon?: LucideIcon | null; - isActive?: boolean; -} - -export interface SharedData { - name: string; - quote: { message: string; author: string }; - auth: Auth; - [key: string]: unknown; -} - -export interface User { - id: number; - name: string; - email: string; - avatar?: string; - email_verified_at: string | null; - created_at: string; - updated_at: string; - [key: string]: unknown; // This allows for additional properties... -} diff --git a/api/resources/js/types/vite-env.d.ts b/api/resources/js/types/vite-env.d.ts deleted file mode 100644 index 11f02fe..0000000 --- a/api/resources/js/types/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/api/resources/views/.gitkeep b/api/resources/views/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/api/resources/views/app.blade.php b/api/resources/views/app.blade.php deleted file mode 100644 index f4c8265..0000000 --- a/api/resources/views/app.blade.php +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - {{ config('app.name', 'Laravel') }} - - - - - @routes - @viteReactRefresh - @vite(['resources/js/app.tsx', "resources/js/pages/{$page['component']}.tsx"]) - @inertiaHead - - - @inertia - - diff --git a/api/routes/api.php b/api/routes/api.php index 85e81c1..c7609fb 100644 --- a/api/routes/api.php +++ b/api/routes/api.php @@ -8,6 +8,18 @@ use App\Http\Controllers\Api\V1\Auth\RegisterController; use App\Http\Controllers\Api\V1\Auth\ResetPasswordController; use App\Http\Controllers\Api\V1\Auth\UserController; +use App\Http\Controllers\Api\V1\CharacterController; +use App\Http\Controllers\Api\V1\CommunityController; +use App\Http\Controllers\Api\V1\Forum\ForumCategoryController; +use App\Http\Controllers\Api\V1\Forum\ForumController; +use App\Http\Controllers\Api\V1\Forum\PostController; +use App\Http\Controllers\Api\V1\Forum\TopicController; +use App\Http\Controllers\Api\V1\GroupController; +use App\Http\Controllers\Api\V1\MeController; +use App\Http\Controllers\Api\V1\PortalController; +use App\Http\Controllers\Api\V1\ProfileController; +use App\Http\Controllers\Api\V1\StatsController; +use App\Http\Controllers\Api\V1\UploadController; use Illuminate\Support\Facades\Route; Route::prefix('v1')->group(function () { @@ -25,4 +37,50 @@ Route::delete('user', DeleteAccountController::class); }); }); + + // Lecture publique + Route::get('stats', StatsController::class); + Route::get('portal', PortalController::class); + Route::get('staff', [CommunityController::class, 'staff']); + Route::get('online-users', [CommunityController::class, 'online']); + + Route::get('forum/categories', [ForumCategoryController::class, 'index']); + Route::get('forum/categories/{category}', [ForumCategoryController::class, 'show']); + Route::get('forums', [ForumController::class, 'index']); + Route::get('forums/{forum}', [ForumController::class, 'show']); + Route::get('topics/{topic}', [TopicController::class, 'show']); + Route::post('topics/{topic}/views', [TopicController::class, 'incrementViews']); + + Route::get('groups', [GroupController::class, 'index']); + Route::get('groups/{group}', [GroupController::class, 'show']); + + Route::get('profiles/{profile}', [ProfileController::class, 'show']); + Route::get('profiles/{profile}/characters', [ProfileController::class, 'characters']); + + Route::get('characters/{character}', [CharacterController::class, 'show']); + Route::get('characters/{character}/inventory', [CharacterController::class, 'inventory']); + Route::get('characters/{character}/ship', [CharacterController::class, 'ship']); + Route::get('characters/{character}/economy', [CharacterController::class, 'economy']); + + // Actions authentifiées (session Sanctum) + Route::middleware('auth:sanctum')->group(function () { + Route::get('me', [MeController::class, 'show']); + Route::patch('me/profile', [MeController::class, 'updateProfile']); + Route::put('me/active-character', [MeController::class, 'setActiveCharacter']); + Route::post('me/heartbeat', [MeController::class, 'heartbeat']); + + Route::post('forums/{forum}/topics', [TopicController::class, 'store']); + Route::post('topics/{topic}/posts', [PostController::class, 'store']); + + Route::post('characters', [CharacterController::class, 'store']); + Route::patch('characters/{character}', [CharacterController::class, 'update']); + + // Administration + Route::middleware('can:admin')->group(function () { + Route::post('forums', [ForumController::class, 'store']); + Route::patch('forums/{forum}', [ForumController::class, 'update']); + Route::delete('forums/{forum}', [ForumController::class, 'destroy']); + Route::post('uploads', [UploadController::class, 'store']); + }); + }); }); diff --git a/api/routes/auth.php b/api/routes/auth.php deleted file mode 100644 index 7862ed4..0000000 --- a/api/routes/auth.php +++ /dev/null @@ -1,56 +0,0 @@ -group(function () { - Route::get('register', [RegisteredUserController::class, 'create']) - ->name('register'); - - Route::post('register', [RegisteredUserController::class, 'store']); - - Route::get('login', [AuthenticatedSessionController::class, 'create']) - ->name('login'); - - Route::post('login', [AuthenticatedSessionController::class, 'store']); - - Route::get('forgot-password', [PasswordResetLinkController::class, 'create']) - ->name('password.request'); - - Route::post('forgot-password', [PasswordResetLinkController::class, 'store']) - ->name('password.email'); - - Route::get('reset-password/{token}', [NewPasswordController::class, 'create']) - ->name('password.reset'); - - Route::post('reset-password', [NewPasswordController::class, 'store']) - ->name('password.store'); -}); - -Route::middleware('auth')->group(function () { - Route::get('verify-email', EmailVerificationPromptController::class) - ->name('verification.notice'); - - Route::get('verify-email/{id}/{hash}', VerifyEmailController::class) - ->middleware(['signed', 'throttle:6,1']) - ->name('verification.verify'); - - Route::post('email/verification-notification', [EmailVerificationNotificationController::class, 'store']) - ->middleware('throttle:6,1') - ->name('verification.send'); - - Route::get('confirm-password', [ConfirmablePasswordController::class, 'show']) - ->name('password.confirm'); - - Route::post('confirm-password', [ConfirmablePasswordController::class, 'store']); - - Route::post('logout', [AuthenticatedSessionController::class, 'destroy']) - ->name('logout'); -}); diff --git a/api/routes/settings.php b/api/routes/settings.php deleted file mode 100644 index 9503137..0000000 --- a/api/routes/settings.php +++ /dev/null @@ -1,21 +0,0 @@ -group(function () { - Route::redirect('settings', 'settings/profile'); - - Route::get('settings/profile', [ProfileController::class, 'edit'])->name('profile.edit'); - Route::patch('settings/profile', [ProfileController::class, 'update'])->name('profile.update'); - Route::delete('settings/profile', [ProfileController::class, 'destroy'])->name('profile.destroy'); - - Route::get('settings/password', [PasswordController::class, 'edit'])->name('password.edit'); - Route::put('settings/password', [PasswordController::class, 'update'])->name('password.update'); - - Route::get('settings/appearance', function () { - return Inertia::render('settings/appearance'); - })->name('appearance'); -}); diff --git a/api/routes/web.php b/api/routes/web.php index 6d7b389..4829cd6 100644 --- a/api/routes/web.php +++ b/api/routes/web.php @@ -2,21 +2,9 @@ use App\Http\Controllers\Auth\VerifyEmailController; use Illuminate\Support\Facades\Route; -use Inertia\Inertia; -Route::get('/', function () { - return Inertia::render('welcome'); -})->name('home'); - -Route::middleware(['auth'])->group(function () { - Route::get('dashboard', function () { - return Inertia::render('dashboard'); - })->name('dashboard'); -}); +Route::get('/', fn () => redirect(config('app.frontend_url'))); Route::get('/email/verify/{id}/{hash}', VerifyEmailController::class) ->middleware(['signed', 'throttle:6,1']) ->name('verification.verify'); - -require __DIR__.'/settings.php'; -require __DIR__.'/auth.php'; diff --git a/api/tests/Feature/Api/GameApiTest.php b/api/tests/Feature/Api/GameApiTest.php new file mode 100644 index 0000000..8a1f0a2 --- /dev/null +++ b/api/tests/Feature/Api/GameApiTest.php @@ -0,0 +1,263 @@ +withoutMiddleware(ValidateCsrfToken::class); + } + + private function makeForum(array $forumAttributes = []): Forum + { + $category = ForumCategory::create([ + 'name' => 'Hors-RP', + 'display_order' => 1, + ]); + + return Forum::create([ + 'category_id' => $category->id, + 'name' => 'Annonces', + 'type' => 'forum', + 'display_order' => 1, + ...$forumAttributes, + ]); + } + + public function test_stats_endpoint_returns_totals(): void + { + User::factory()->count(2)->create(); + + $this->getJson('/api/v1/stats') + ->assertOk() + ->assertJsonStructure([ + 'total_users', 'total_topics', 'total_posts', 'online_count', + 'latest_user', 'factions_by_era', + ]) + ->assertJsonPath('total_users', 2); + } + + public function test_topic_and_reply_flow_updates_counters_and_last_post(): void + { + $user = User::factory()->create(); + $parent = $this->makeForum(); + $child = Forum::create([ + 'category_id' => $parent->category_id, + 'parent_id' => $parent->id, + 'name' => 'Sous-forum', + 'type' => 'location', + 'display_order' => 1, + ]); + + $topicResponse = $this->actingAs($user)->postJson("/api/v1/forums/{$child->id}/topics", [ + 'title' => 'Premier sujet', + 'content' => 'Il était une fois dans une galaxie lointaine.', + ]); + $topicResponse->assertCreated(); + $topicId = $topicResponse->json('id'); + + $this->actingAs($user)->postJson("/api/v1/topics/{$topicId}/posts", [ + 'content' => 'Première réponse.', + ])->assertCreated(); + + $child->refresh(); + $parent->refresh(); + + $this->assertSame(1, $child->topics_count); + $this->assertSame(2, $child->posts_count); + $this->assertSame(1, $parent->topics_count); + $this->assertSame(2, $parent->posts_count); + $this->assertNotNull($child->last_post_id); + $this->assertSame($child->last_post_id, $parent->last_post_id); + + $show = $this->getJson("/api/v1/topics/{$topicId}")->assertOk(); + $this->assertSame(1, $show->json('topic.replies_count')); + $this->assertCount(2, $show->json('topic.posts')); + $this->assertSame('Sous-forum', $show->json('topic.forum.name')); + $this->assertSame('Annonces', $show->json('ancestors.0.name')); + + $this->postJson("/api/v1/topics/{$topicId}/views")->assertNoContent(); + $this->assertSame(1, $show->json('topic.views_count') + 1 - $show->json('topic.views_count')); + } + + public function test_guest_cannot_post_topic(): void + { + $forum = $this->makeForum(); + + $this->postJson("/api/v1/forums/{$forum->id}/topics", [ + 'title' => 'Interdit', + 'content' => 'Non.', + ])->assertUnauthorized(); + } + + public function test_character_creation_sets_faction_membership_and_active_character(): void + { + $user = User::factory()->create(); + $group = Faction::create([ + 'name' => 'Ordre Jedi', + 'color' => '#3b82f6', + 'era' => 'CLONE_WARS', + ]); + + $response = $this->actingAs($user)->postJson('/api/v1/characters', [ + 'name' => 'Dax Valen', + 'species' => 'Humain', + 'class' => 'Jedi', + 'occupation_category' => 'FORCE', + 'era' => 'CLONE_WARS', + 'main_group_id' => $group->id, + 'skills' => ['Saut de Force', 'Télékynésie', 'Sens de la Force'], + 'starting_item' => "Sabre Laser d'entraînement", + ]); + + $response->assertCreated() + ->assertJsonPath('faction', 'Ordre Jedi') + ->assertJsonPath('credits', 2000); + + $characterId = $response->json('id'); + + $this->assertDatabaseHas('group_members', [ + 'group_id' => $group->id, + 'character_id' => $characterId, + ]); + + $this->assertSame($characterId, $user->profile->fresh()->active_character_id); + + $me = $this->actingAs($user)->getJson('/api/v1/me')->assertOk(); + $this->assertSame('Dax Valen', $me->json('active_character.name')); + } + + public function test_character_limit_is_enforced(): void + { + $user = User::factory()->create(); + + for ($i = 0; $i < 6; $i++) { + Character::create([ + 'user_id' => $user->id, + 'name' => "Perso {$i}", + 'class' => 'Soldat', + 'faction' => 'Indépendant', + ]); + } + + $this->actingAs($user)->postJson('/api/v1/characters', [ + 'name' => 'Un de trop', + 'species' => 'Humain', + 'class' => 'Soldat', + 'occupation_category' => 'COMBAT', + 'era' => 'CLONE_WARS', + ])->assertUnprocessable(); + } + + public function test_character_economy_can_be_updated_by_owner_only(): void + { + $owner = User::factory()->create(); + $other = User::factory()->create(); + $character = Character::create([ + 'user_id' => $owner->id, + 'name' => 'Dax', + 'class' => 'Contrebandier', + 'faction' => 'Indépendant', + ]); + + $this->actingAs($other)->patchJson("/api/v1/characters/{$character->id}", [ + 'monthly_income' => 500, + ])->assertForbidden(); + + $this->actingAs($owner)->patchJson("/api/v1/characters/{$character->id}", [ + 'monthly_income' => 500, + 'monthly_expenses' => 120, + ])->assertOk(); + + $economy = $this->getJson("/api/v1/characters/{$character->id}/economy")->assertOk(); + $this->assertSame(500, $economy->json('monthly_income')); + } + + public function test_me_profile_update_and_heartbeat(): void + { + $user = User::factory()->create(); + + $this->actingAs($user)->patchJson('/api/v1/me/profile', [ + 'username' => 'DarkTak', + 'bio_hrp' => 'GM du forum.', + ])->assertOk()->assertJsonPath('username', 'DarkTak'); + + $this->actingAs($user)->postJson('/api/v1/me/heartbeat')->assertNoContent(); + + $online = $this->getJson('/api/v1/online-users')->assertOk(); + $this->assertSame('DarkTak', $online->json('0.username')); + } + + public function test_forum_administration_requires_admin_role(): void + { + $member = User::factory()->create(); + $admin = User::factory()->create(); + $admin->profile->update(['role' => UserRole::Admin]); + + $category = ForumCategory::create(['name' => 'RP', 'display_order' => 1]); + + $payload = [ + 'name' => 'Tatooine', + 'category_id' => $category->id, + 'type' => 'planet', + ]; + + $this->actingAs($member)->postJson('/api/v1/forums', $payload)->assertForbidden(); + + $created = $this->actingAs($admin)->postJson('/api/v1/forums', $payload)->assertCreated(); + $forumId = $created->json('id'); + + $this->actingAs($admin)->patchJson("/api/v1/forums/{$forumId}", [ + 'name' => 'Tatooine — Mos Eisley', + ])->assertOk()->assertJsonPath('name', 'Tatooine — Mos Eisley'); + + $fallback = Forum::create([ + 'category_id' => $category->id, + 'name' => 'Corbeille', + 'type' => 'forum', + ]); + + $this->actingAs($admin)->deleteJson("/api/v1/forums/{$forumId}", [ + 'move_topics_to' => $fallback->id, + ])->assertNoContent(); + + $this->assertDatabaseMissing('forums', ['id' => $forumId]); + } + + public function test_groups_endpoint_lists_factions_with_member_counts(): void + { + $user = User::factory()->create(); + $group = Faction::create(['name' => 'Empire', 'color' => '#ef4444', 'era' => 'GALACTIC_CIVIL_WAR']); + Character::create([ + 'user_id' => $user->id, + 'name' => 'Vader', + 'class' => 'Sith', + 'faction' => 'Empire', + 'main_group_id' => $group->id, + ]); + + $this->getJson('/api/v1/groups') + ->assertOk() + ->assertJsonPath('0.name', 'Empire') + ->assertJsonPath('0.characters_count', 1); + + $this->getJson("/api/v1/groups/{$group->id}") + ->assertOk() + ->assertJsonPath('characters.0.name', 'Vader'); + } +} diff --git a/api/tests/Feature/Auth/AuthenticationTest.php b/api/tests/Feature/Auth/AuthenticationTest.php deleted file mode 100644 index c59d166..0000000 --- a/api/tests/Feature/Auth/AuthenticationTest.php +++ /dev/null @@ -1,54 +0,0 @@ -get('/login'); - - $response->assertStatus(200); - } - - public function test_users_can_authenticate_using_the_login_screen() - { - $user = User::factory()->create(); - - $response = $this->post('/login', [ - 'email' => $user->email, - 'password' => 'password', - ]); - - $this->assertAuthenticated(); - $response->assertRedirect(route('dashboard', absolute: false)); - } - - public function test_users_can_not_authenticate_with_invalid_password() - { - $user = User::factory()->create(); - - $this->post('/login', [ - 'email' => $user->email, - 'password' => 'wrong-password', - ]); - - $this->assertGuest(); - } - - public function test_users_can_logout() - { - $user = User::factory()->create(); - - $response = $this->actingAs($user)->post('/logout'); - - $this->assertGuest(); - $response->assertRedirect('/'); - } -} diff --git a/api/tests/Feature/Auth/EmailVerificationTest.php b/api/tests/Feature/Auth/EmailVerificationTest.php deleted file mode 100644 index aaaa536..0000000 --- a/api/tests/Feature/Auth/EmailVerificationTest.php +++ /dev/null @@ -1,58 +0,0 @@ -unverified()->create(); - - $response = $this->actingAs($user)->get('/verify-email'); - - $response->assertStatus(200); - } - - public function test_email_can_be_verified() - { - $user = User::factory()->unverified()->create(); - - Event::fake(); - - $verificationUrl = URL::temporarySignedRoute( - 'verification.verify', - now()->addMinutes(60), - ['id' => $user->id, 'hash' => sha1($user->getEmailForVerification())] - ); - - $response = $this->get($verificationUrl); - - Event::assertDispatched(Verified::class); - $this->assertTrue($user->fresh()->hasVerifiedEmail()); - $response->assertRedirect(config('app.frontend_url').'/auth/login?verified=1'); - } - - public function test_email_is_not_verified_with_invalid_hash() - { - $user = User::factory()->unverified()->create(); - - $verificationUrl = URL::temporarySignedRoute( - 'verification.verify', - now()->addMinutes(60), - ['id' => $user->id, 'hash' => sha1('wrong-email')] - ); - - $this->get($verificationUrl)->assertForbidden(); - - $this->assertFalse($user->fresh()->hasVerifiedEmail()); - } -} diff --git a/api/tests/Feature/Auth/PasswordConfirmationTest.php b/api/tests/Feature/Auth/PasswordConfirmationTest.php deleted file mode 100644 index d2072ff..0000000 --- a/api/tests/Feature/Auth/PasswordConfirmationTest.php +++ /dev/null @@ -1,44 +0,0 @@ -create(); - - $response = $this->actingAs($user)->get('/confirm-password'); - - $response->assertStatus(200); - } - - public function test_password_can_be_confirmed() - { - $user = User::factory()->create(); - - $response = $this->actingAs($user)->post('/confirm-password', [ - 'password' => 'password', - ]); - - $response->assertRedirect(); - $response->assertSessionHasNoErrors(); - } - - public function test_password_is_not_confirmed_with_invalid_password() - { - $user = User::factory()->create(); - - $response = $this->actingAs($user)->post('/confirm-password', [ - 'password' => 'wrong-password', - ]); - - $response->assertSessionHasErrors(); - } -} diff --git a/api/tests/Feature/Auth/PasswordResetTest.php b/api/tests/Feature/Auth/PasswordResetTest.php deleted file mode 100644 index 3c7441f..0000000 --- a/api/tests/Feature/Auth/PasswordResetTest.php +++ /dev/null @@ -1,73 +0,0 @@ -get('/forgot-password'); - - $response->assertStatus(200); - } - - public function test_reset_password_link_can_be_requested() - { - Notification::fake(); - - $user = User::factory()->create(); - - $this->post('/forgot-password', ['email' => $user->email]); - - Notification::assertSentTo($user, ResetPassword::class); - } - - public function test_reset_password_screen_can_be_rendered() - { - Notification::fake(); - - $user = User::factory()->create(); - - $this->post('/forgot-password', ['email' => $user->email]); - - Notification::assertSentTo($user, ResetPassword::class, function ($notification) { - $response = $this->get('/reset-password/'.$notification->token); - - $response->assertStatus(200); - - return true; - }); - } - - public function test_password_can_be_reset_with_valid_token() - { - Notification::fake(); - - $user = User::factory()->create(); - - $this->post('/forgot-password', ['email' => $user->email]); - - Notification::assertSentTo($user, ResetPassword::class, function ($notification) use ($user) { - $response = $this->post('/reset-password', [ - 'token' => $notification->token, - 'email' => $user->email, - 'password' => 'password', - 'password_confirmation' => 'password', - ]); - - $response - ->assertSessionHasNoErrors() - ->assertRedirect(route('login')); - - return true; - }); - } -} diff --git a/api/tests/Feature/Auth/RegistrationTest.php b/api/tests/Feature/Auth/RegistrationTest.php deleted file mode 100644 index d0c3ea2..0000000 --- a/api/tests/Feature/Auth/RegistrationTest.php +++ /dev/null @@ -1,31 +0,0 @@ -get('/register'); - - $response->assertStatus(200); - } - - public function test_new_users_can_register() - { - $response = $this->post('/register', [ - 'name' => 'Test User', - 'email' => 'test@example.com', - 'password' => 'password', - 'password_confirmation' => 'password', - ]); - - $this->assertAuthenticated(); - $response->assertRedirect(route('dashboard', absolute: false)); - } -} diff --git a/api/tests/Feature/DashboardTest.php b/api/tests/Feature/DashboardTest.php deleted file mode 100644 index 8585ade..0000000 --- a/api/tests/Feature/DashboardTest.php +++ /dev/null @@ -1,24 +0,0 @@ -get('/dashboard')->assertRedirect('/login'); - } - - public function test_authenticated_users_can_visit_the_dashboard() - { - $this->actingAs($user = User::factory()->create()); - - $this->get('/dashboard')->assertOk(); - } -} diff --git a/api/tests/Feature/Settings/PasswordUpdateTest.php b/api/tests/Feature/Settings/PasswordUpdateTest.php deleted file mode 100644 index 64e9189..0000000 --- a/api/tests/Feature/Settings/PasswordUpdateTest.php +++ /dev/null @@ -1,51 +0,0 @@ -create(); - - $response = $this - ->actingAs($user) - ->from('/settings/password') - ->put('/settings/password', [ - 'current_password' => 'password', - 'password' => 'new-password', - 'password_confirmation' => 'new-password', - ]); - - $response - ->assertSessionHasNoErrors() - ->assertRedirect('/settings/password'); - - $this->assertTrue(Hash::check('new-password', $user->refresh()->password)); - } - - public function test_correct_password_must_be_provided_to_update_password() - { - $user = User::factory()->create(); - - $response = $this - ->actingAs($user) - ->from('/settings/password') - ->put('/settings/password', [ - 'current_password' => 'wrong-password', - 'password' => 'new-password', - 'password_confirmation' => 'new-password', - ]); - - $response - ->assertSessionHasErrors('current_password') - ->assertRedirect('/settings/password'); - } -} diff --git a/api/tests/Feature/Settings/ProfileUpdateTest.php b/api/tests/Feature/Settings/ProfileUpdateTest.php deleted file mode 100644 index 7d51214..0000000 --- a/api/tests/Feature/Settings/ProfileUpdateTest.php +++ /dev/null @@ -1,99 +0,0 @@ -create(); - - $response = $this - ->actingAs($user) - ->get('/settings/profile'); - - $response->assertOk(); - } - - public function test_profile_information_can_be_updated() - { - $user = User::factory()->create(); - - $response = $this - ->actingAs($user) - ->patch('/settings/profile', [ - 'name' => 'Test User', - 'email' => 'test@example.com', - ]); - - $response - ->assertSessionHasNoErrors() - ->assertRedirect('/settings/profile'); - - $user->refresh(); - - $this->assertSame('Test User', $user->name); - $this->assertSame('test@example.com', $user->email); - $this->assertNull($user->email_verified_at); - } - - public function test_email_verification_status_is_unchanged_when_the_email_address_is_unchanged() - { - $user = User::factory()->create(); - - $response = $this - ->actingAs($user) - ->patch('/settings/profile', [ - 'name' => 'Test User', - 'email' => $user->email, - ]); - - $response - ->assertSessionHasNoErrors() - ->assertRedirect('/settings/profile'); - - $this->assertNotNull($user->refresh()->email_verified_at); - } - - public function test_user_can_delete_their_account() - { - $user = User::factory()->create(); - - $response = $this - ->actingAs($user) - ->delete('/settings/profile', [ - 'password' => 'password', - ]); - - $response - ->assertSessionHasNoErrors() - ->assertRedirect('/'); - - $this->assertGuest(); - $this->assertNull($user->fresh()); - } - - public function test_correct_password_must_be_provided_to_delete_account() - { - $user = User::factory()->create(); - - $response = $this - ->actingAs($user) - ->from('/settings/profile') - ->delete('/settings/profile', [ - 'password' => 'wrong-password', - ]); - - $response - ->assertSessionHasErrors('password') - ->assertRedirect('/settings/profile'); - - $this->assertNotNull($user->fresh()); - } -} diff --git a/api/tsconfig.json b/api/tsconfig.json deleted file mode 100644 index cdfd267..0000000 --- a/api/tsconfig.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - - /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - - /* Language and Environment */ - "target": "ESNext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, - // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - - /* Modules */ - "module": "ESNext" /* Specify what module code is generated. */, - // "rootDir": "./", /* Specify the root folder within your source files. */ - "moduleResolution": "bundler" /* Specify how TypeScript looks up a file from a given module specifier. */, - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ - // "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */ - // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ - // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ - // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ - // "noUncheckedSideEffectImports": true, /* Check side effect imports. */ - // "resolveJsonModule": true, /* Enable importing .json files. */ - // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - - /* JavaScript Support */ - "allowJs": true /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */, - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - - /* Emit */ - // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - "noEmit": true /* Disable emitting files from a compilation. */, - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - // "outDir": "./", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - - /* Interop Constraints */ - "isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */, - // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ - // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, - - /* Type Checking */ - "strict": true /* Enable all strict type-checking options. */, - "noImplicitAny": true /* Enable error reporting for expressions and declarations with an implied 'any' type. */, - // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */ - // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */, - "baseUrl": ".", - "paths": { - "@/*": ["./resources/js/*"], - "ziggy-js": ["./vendor/tightenco/ziggy"] - }, - "jsx": "react-jsx" - }, - "include": ["resources/js/**/*.ts", "resources/js/**/*.tsx"] -} diff --git a/api/vite.config.js b/api/vite.config.js deleted file mode 100644 index fc3be2f..0000000 --- a/api/vite.config.js +++ /dev/null @@ -1,21 +0,0 @@ -import react from '@vitejs/plugin-react'; -import laravel from 'laravel-vite-plugin'; -import { - defineConfig -} from 'vite'; -import tailwindcss from "@tailwindcss/vite"; - -export default defineConfig({ - plugins: [ - laravel({ - input: ['resources/css/app.css', 'resources/js/app.tsx'], - ssr: 'resources/js/ssr.jsx', - refresh: true, - }), - react(), - tailwindcss(), - ], - esbuild: { - jsx: 'automatic', - }, -}); \ No newline at end of file diff --git a/back/Dockerfile b/back/Dockerfile deleted file mode 100644 index 45ec257..0000000 --- a/back/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM node:20-alpine - -WORKDIR /app - -COPY package*.json ./ -RUN npm install - -COPY . . - -EXPOSE 3001 - -CMD ["npm", "run", "dev"] - - diff --git a/back/env.local.example b/back/env.local.example deleted file mode 100644 index 59e93b0..0000000 --- a/back/env.local.example +++ /dev/null @@ -1,6 +0,0 @@ -# Configuration locale pour le Back Office (Admin) -NEXT_PUBLIC_SUPABASE_URL=http://localhost:54321 -NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InN3b3ItdjIiLCJyb2xlIjoiYW5vbiIsImlhdCI6MTYwMDAwMDAwMCwiZXhwIjoyMDAwMDAwMDAwfQ.placeholder-anon-key -SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InN3b3ItdjIiLCJyb2xlIjoic2VydmljZV9yb2xlIiwiaWF0IjoxNjAwMDAwMDAwMCwiZXhwIjoyMDAwMDAwMDAwfQ.placeholder-service-key - - diff --git a/back/package.json b/back/package.json deleted file mode 100644 index 42e3713..0000000 --- a/back/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "swor-back-bo", - "version": "0.1.0", - "private": true, - "scripts": { - "dev": "next dev -p 3001", - "build": "next build", - "start": "next start -p 3001", - "lint": "next lint" - }, - "dependencies": { - "next": "latest", - "react": "latest", - "react-dom": "latest", - "lucide-react": "latest", - "@supabase/supabase-js": "^2.39.0" - }, - "devDependencies": { - "typescript": "latest", - "@types/node": "latest", - "@types/react": "latest", - "@types/react-dom": "latest", - "tailwindcss": "latest", - "postcss": "latest", - "autoprefixer": "latest" - } -} - - diff --git a/back/src/app/layout.tsx b/back/src/app/layout.tsx deleted file mode 100644 index 598035c..0000000 --- a/back/src/app/layout.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import './globals.css' -import { Inter } from 'next/font/google' - -const inter = Inter({ subsets: ['latin'] }) - -export const metadata = { - title: 'SWOR - Admin', - description: 'Back Office pour Star Wars Roleplay', -} - -export default function RootLayout({ - children, -}: { - children: React.ReactNode -}) { - return ( - - {children} - - ) -} - - diff --git a/back/src/app/page.tsx b/back/src/app/page.tsx deleted file mode 100644 index 844f163..0000000 --- a/back/src/app/page.tsx +++ /dev/null @@ -1,10 +0,0 @@ -export default function AdminPage() { - return ( -
-

SWOR - Back Office (Admin)

-

Bienvenue sur l'interface d'administration.

-
- ); -} - - diff --git a/back/tsconfig.json b/back/tsconfig.json deleted file mode 100644 index c1a1454..0000000 --- a/back/tsconfig.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2017", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], - "allowJs": true, - "skipLibCheck": true, - "strict": false, - "noEmit": true, - "incremental": true, - "module": "esnext", - "esModuleInterop": true, - "moduleResolution": "bundler", - "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "react-jsx", - "plugins": [ - { - "name": "next" - } - ] - }, - "include": [ - "next-env.d.ts", - ".next/types/**/*.ts", - ".next/dev/types/**/*.ts", - "**/*.mts", - "**/*.ts", - "**/*.tsx" - ], - "exclude": [ - "node_modules" - ] -} diff --git a/deploy/nginx/swor.conf.example b/deploy/nginx/swor.conf.example index 5bec120..1c1a778 100644 --- a/deploy/nginx/swor.conf.example +++ b/deploy/nginx/swor.conf.example @@ -16,15 +16,15 @@ server { } } -# API Supabase — api.swor.fr +# API Laravel — api.swor.fr server { listen 80; server_name api.swor.fr; - client_max_body_size 50m; + client_max_body_size 10m; location / { - proxy_pass http://127.0.0.1:54321; + proxy_pass http://127.0.0.1:8080; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 18f3b69..8913d97 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -1,19 +1,72 @@ -include: - - docker/supabase/docker-compose.yml - +# Production : front Next.js + API Laravel + Postgres. +# docker compose -f docker-compose.prod.yml --env-file .env.production up -d --build services: + db: + image: postgres:16-alpine + container_name: swor-db + restart: unless-stopped + environment: + POSTGRES_DB: ${POSTGRES_DB:-swor} + POSTGRES_USER: ${POSTGRES_USER:-postgres} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD requis} + volumes: + - swor-db-data:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 5s + timeout: 5s + retries: 10 + + api: + container_name: swor-api + build: + context: ./api + restart: unless-stopped + ports: + - "127.0.0.1:8080:80" + environment: + APP_ENV: production + APP_DEBUG: "false" + APP_KEY: ${APP_KEY:?APP_KEY requis} + APP_URL: ${API_URL:-https://api.swor.fr} + FRONTEND_URL: ${SITE_URL:-https://swor.fr} + SANCTUM_STATEFUL_DOMAINS: ${SANCTUM_STATEFUL_DOMAINS:-swor.fr,www.swor.fr} + SESSION_DOMAIN: ${SESSION_DOMAIN:-.swor.fr} + SESSION_SECURE_COOKIE: "true" + DB_CONNECTION: pgsql + DB_HOST: db + DB_PORT: 5432 + DB_DATABASE: ${POSTGRES_DB:-swor} + DB_USERNAME: ${POSTGRES_USER:-postgres} + DB_PASSWORD: ${POSTGRES_PASSWORD} + MAIL_MAILER: smtp + MAIL_HOST: ${SMTP_HOST:-} + MAIL_PORT: ${SMTP_PORT:-587} + MAIL_USERNAME: ${SMTP_USER:-} + MAIL_PASSWORD: ${SMTP_PASS:-} + MAIL_FROM_ADDRESS: ${SMTP_ADMIN_EMAIL:-noreply@swor.fr} + MAIL_FROM_NAME: Swor + volumes: + - swor-api-storage:/var/www/html/storage/app + depends_on: + db: + condition: service_healthy + front: container_name: swor-front build: context: . dockerfile: front/Dockerfile.prod args: - NEXT_PUBLIC_SUPABASE_URL: ${PUBLIC_SUPABASE_URL} - NEXT_PUBLIC_SUPABASE_ANON_KEY: ${ANON_KEY} + NEXT_PUBLIC_API_URL: ${API_URL:-https://api.swor.fr} restart: unless-stopped ports: - "127.0.0.1:3000:3000" environment: - NODE_ENV=production depends_on: - - kong + - api + +volumes: + swor-db-data: + swor-api-storage: diff --git a/docker-compose.yml b/docker-compose.yml index 3efab2b..e5e13e6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,21 +1,23 @@ -include: - - docker/supabase/docker-compose.yml - +# Développement : uniquement la base Postgres. +# L'API (php artisan serve) et le front (next dev) tournent en local. services: - front: - container_name: swor-front - build: - context: ./front - dockerfile: Dockerfile.dev + db: + image: postgres:16-alpine + container_name: swor-db + restart: unless-stopped ports: - - "3000:3000" - volumes: - - ./front:/app - - /app/node_modules + - "${POSTGRES_PORT:-54322}:5432" environment: - - NEXT_PUBLIC_SUPABASE_URL=http://localhost:54321 - - NEXT_PUBLIC_SUPABASE_ANON_KEY=${ANON_KEY} - - SUPABASE_INTERNAL_URL=http://supabase-kong:8000 - depends_on: - - kong + POSTGRES_DB: swor + POSTGRES_USER: postgres + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres} + volumes: + - swor-db-data:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 5s + timeout: 5s + retries: 10 +volumes: + swor-db-data: diff --git a/docker/supabase/docker-compose.yml b/docker/supabase/docker-compose.yml deleted file mode 100644 index 3e3c572..0000000 --- a/docker/supabase/docker-compose.yml +++ /dev/null @@ -1,148 +0,0 @@ -# Docker Compose for Self-Hosted Supabase -# This is a simplified version of the official Supabase self-hosting setup. - -services: - db: - container_name: supabase-db - image: supabase/postgres:15.1.0.147 - healthcheck: - test: ["CMD", "pg_isready", "-U", "postgres"] - interval: 5s - timeout: 5s - retries: 10 - environment: - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} - PGPASSWORD: ${POSTGRES_PASSWORD} - POSTGRES_DB: postgres - POSTGRES_USER: postgres - AUTHENTICATOR_PASSWORD: ${AUTHENTICATOR_PASSWORD} - volumes: - - ./volumes/db/data:/var/lib/postgresql/data - - ./volumes/db/init:/docker-entrypoint-initdb.d - ports: - - ${POSTGRES_PORT}:5432 - - kong: - container_name: supabase-kong - image: kong:2.8.1 - restart: unless-stopped - depends_on: - db: - condition: service_healthy - environment: - KONG_DATABASE: "off" - KONG_DECLARATIVE_CONFIG: /var/lib/kong/kong.yml - KONG_PROXY_LISTEN: 0.0.0.0:8000 - KONG_ADMIN_LISTEN: 0.0.0.0:8001 - KONG_PROXY_ACCESS_LOG: /dev/stdout - KONG_ADMIN_ACCESS_LOG: /dev/stdout - KONG_PROXY_ERROR_LOG: /dev/stderr - KONG_ADMIN_ERROR_LOG: /dev/stderr - volumes: - - ./kong.yml:/var/lib/kong/kong.yml - ports: - - ${KONG_PORT}:8000 - - ${KONG_ADMIN_PORT}:8001 - - auth: - container_name: supabase-auth - image: supabase/gotrue:v2.152.0 - depends_on: - db: - condition: service_healthy - healthcheck: - test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8081/health"] - timeout: 5s - interval: 5s - retries: 10 - environment: - GOTRUE_DB_DRIVER: postgres - GOTRUE_DB_DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@db:5432/postgres?sslmode=disable&search_path=auth - GOTRUE_API_EXTERNAL_URL: http://localhost:54321/auth/v1 - API_EXTERNAL_URL: http://localhost:54321/auth/v1 - GOTRUE_SITE_URL: ${SITE_URL} - GOTRUE_OPERATOR_TOKEN: ${OPERATOR_TOKEN} - GOTRUE_JWT_SECRET: ${JWT_SECRET} - GOTRUE_JWT_EXP: ${JWT_EXPIRY} - GOTRUE_EXTERNAL_EMAIL_ENABLED: ${ENABLE_EMAIL_SIGNUP} - GOTRUE_MAILER_AUTOCONFIRM: ${ENABLE_EMAIL_AUTOCONFIRM} - GOTRUE_SMTP_ADMIN_EMAIL: ${SMTP_ADMIN_EMAIL} - GOTRUE_SMTP_HOST: ${SMTP_HOST} - GOTRUE_SMTP_PORT: ${SMTP_PORT} - GOTRUE_SMTP_USER: ${SMTP_USER} - GOTRUE_SMTP_PASS: ${SMTP_PASS} - GOTRUE_SMTP_SENDER_NAME: ${SMTP_SENDER_NAME} - GOTRUE_DB_MAX_POOL_SIZE: ${DB_MAX_POOL_SIZE} - GOTRUE_JWT_DEFAULT_GROUP_NAME: authenticated - - rest: - container_name: supabase-rest - image: postgrest/postgrest:v12.0.2 - depends_on: - db: - condition: service_healthy - environment: - PGRST_DB_URI: postgres://authenticator:${AUTHENTICATOR_PASSWORD}@db:5432/postgres - PGRST_DB_SCHEMA: public - PGRST_DB_ANON_ROLE: anon - PGRST_JWT_SECRET: ${JWT_SECRET} - PGRST_DB_USE_LEGACY_GUCS: "false" - - realtime: - container_name: supabase-realtime - image: supabase/realtime:v2.30.23 - depends_on: - db: - condition: service_healthy - environment: - DB_HOST: db - DB_PORT: 5432 - DB_NAME: postgres - DB_USER: postgres - DB_PASSWORD: ${POSTGRES_PASSWORD} - DB_SSL: "false" - PORT: 4000 - JWT_SECRET: ${JWT_SECRET} - REPLICATION_MODE: RLS - REPLICATION_SLOT_NAME: supabase_realtime_replication_slot - PUBLICATION_NAME: supabase_realtime_publication - SECURE_CHANNELS: "true" - RLIMIT_NOFILE: 1048576 - SECRET_KEY_BASE: ${JWT_SECRET} - APP_NAME: swor-v2-realtime - - storage: - container_name: supabase-storage - image: supabase/storage-api:v0.40.4 - depends_on: - db: - condition: service_healthy - rest: - condition: service_started - environment: - ANON_KEY: ${ANON_KEY} - SERVICE_KEY: ${SERVICE_ROLE_KEY} - POSTGREST_URL: http://rest:3000 - PGRST_JWT_SECRET: ${JWT_SECRET} - DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@db:5432/postgres - FILE_SIZE_LIMIT: 52428800 - STORAGE_BACKEND: file - FILE_STORAGE_BACKEND_PATH: /var/lib/storage - TENANT_ID: default - REGION: local - GLOBAL_S3_BUCKET: screenshots - volumes: - - ./volumes/storage:/var/lib/storage - - studio: - container_name: supabase-studio - image: supabase/studio:latest - environment: - SUPABASE_URL: http://kong:8000 - API_URL: http://localhost:${KONG_PORT} - SUPABASE_ANON_KEY: ${ANON_KEY} - SUPABASE_SERVICE_KEY: ${SERVICE_ROLE_KEY} - JWT_SECRET: ${JWT_SECRET} - ports: - - ${STUDIO_PORT}:3000 - diff --git a/docker/supabase/env.example b/docker/supabase/env.example deleted file mode 100644 index 1ac3bdb..0000000 --- a/docker/supabase/env.example +++ /dev/null @@ -1,36 +0,0 @@ -# Supabase Self-Hosting Environment Variables -# DONT COMMIT REAL SECRETS TO GIT - -POSTGRES_PASSWORD=postgres -POSTGRES_PORT=54322 - -# Mot de passe du rôle Postgres "authenticator" (utilisé par PostgREST) -AUTHENTICATOR_PASSWORD=postgres - -KONG_PORT=54321 -KONG_ADMIN_PORT=54325 -STUDIO_PORT=54323 - -# JWT Secret (Must be at least 32 characters) -JWT_SECRET=super-secret-jwt-token-with-at-least-32-characters-long -JWT_EXPIRY=3600 - -# API Keys -# You can generate these or use defaults for local development -ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InN3b3ItdjIiLCJyb2xlIjoiYW5vbiIsImlhdCI6MTYwMDAwMDAwMCwiZXhwIjoyMDAwMDAwMDAwfQ.placeholder-anon-key -SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InN3b3ItdjIiLCJyb2xlIjoic2VydmljZV9yb2xlIiwiaWF0IjoxNjAwMDAwMDAwMCwiZXhwIjoyMDAwMDAwMDAwfQ.placeholder-service-key - -# Auth -SITE_URL=http://localhost:3000 -OPERATOR_TOKEN=operator-token -ENABLE_EMAIL_SIGNUP=true -ENABLE_EMAIL_AUTOCONFIRM=true -SMTP_ADMIN_EMAIL=admin@example.com -SMTP_HOST=smtp.example.com -SMTP_PORT=587 -SMTP_USER=user -SMTP_PASS=pass -SMTP_SENDER_NAME=Supabase -DB_MAX_POOL_SIZE=20 - - diff --git a/docker/supabase/kong.yml b/docker/supabase/kong.yml deleted file mode 100644 index 5776055..0000000 --- a/docker/supabase/kong.yml +++ /dev/null @@ -1,52 +0,0 @@ -_format_version: "1.1" - -plugins: - - name: cors - config: - origins: - - "*" - methods: - - GET - - POST - - PUT - - PATCH - - DELETE - - OPTIONS - headers: - - "*" - exposed_headers: - - "*" - max_age: 3600 - preflight_continue: false - -services: - - name: auth - url: http://auth:8081 - routes: - - name: auth-route - paths: - - /auth/v1 - strip_path: true - - - name: rest - url: http://rest:3000 - routes: - - name: rest-route - paths: - - /rest/v1 - strip_path: true - - name: realtime - url: http://realtime:4000 - routes: - - name: realtime-route - paths: - - /realtime/v1 - strip_path: true - - name: storage - url: http://storage:8080 - routes: - - name: storage-route - paths: - - /storage/v1 - strip_path: true - diff --git a/docker/supabase/volumes/db/init/00_cleanup_atlas.sql b/docker/supabase/volumes/db/init/00_cleanup_atlas.sql deleted file mode 100644 index 3c9aa18..0000000 --- a/docker/supabase/volumes/db/init/00_cleanup_atlas.sql +++ /dev/null @@ -1,36 +0,0 @@ --- ================================================================================= --- SCRIPT D'ARCHIVAGE ET NETTOYAGE DES ANCIENS FORUMS GALACTIQUES --- ================================================================================= - -DO $$ -DECLARE - archive_forum_id INTEGER; -BEGIN - -- 1. S'assurer que la catégorie Archives existe (au cas où 01 n'a pas encore tourné) - INSERT INTO public.forum_categories (id, name, description, era, required_role, display_order) - VALUES (7, 'Archives', 'Anciens messages et archives de la galaxie.', NULL, NULL, 150) - ON CONFLICT (id) DO NOTHING; - - -- 2. Trouver l'ID du forum Archives Galactiques - SELECT id INTO archive_forum_id FROM public.forums WHERE name = 'Archives Galactiques' LIMIT 1; - - -- Si le forum n'existe pas, on le crée dans la catégorie 7 - IF archive_forum_id IS NULL THEN - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (7, 'Archives Galactiques', 'Le passé de la galaxie, préservé pour l''éternité.', 'forum', 1) - RETURNING id INTO archive_forum_id; - END IF; - - -- 3. Déplacer tous les sujets des forums appartenant aux ères (catégories 2, 3, 4) vers les archives - UPDATE public.topics - SET forum_id = archive_forum_id - WHERE forum_id IN ( - SELECT id FROM public.forums WHERE category_id IN (2, 3, 4) - ); - - -- 4. Supprimer tous les forums des ères pour repartir de zéro - -- On ne supprime que ceux des catégories 2, 3, 4 - DELETE FROM public.forums WHERE category_id IN (2, 3, 4); - - RAISE NOTICE 'Archivage terminé et anciens forums supprimés.'; -END $$; diff --git a/docker/supabase/volumes/db/init/00_roles.sql b/docker/supabase/volumes/db/init/00_roles.sql deleted file mode 100644 index 29c3166..0000000 --- a/docker/supabase/volumes/db/init/00_roles.sql +++ /dev/null @@ -1,56 +0,0 @@ --- Create Supabase schemas -CREATE SCHEMA IF NOT EXISTS auth; -CREATE SCHEMA IF NOT EXISTS storage; -CREATE SCHEMA IF NOT EXISTS realtime; - --- Helper functions for auth -CREATE OR REPLACE FUNCTION auth.uid() RETURNS uuid AS $$ - SELECT nullif(current_setting('request.jwt.claim.sub', true), '')::uuid; -$$ LANGUAGE SQL STABLE; - -CREATE OR REPLACE FUNCTION auth.role() RETURNS text AS $$ - SELECT nullif(current_setting('request.jwt.claim.role', true), '')::text; -$$ LANGUAGE SQL STABLE; - -CREATE OR REPLACE FUNCTION auth.email() RETURNS text AS $$ - SELECT nullif(current_setting('request.jwt.claim.email', true), '')::text; -$$ LANGUAGE SQL STABLE; - --- Create Supabase roles if they don't exist -DO $$ -BEGIN - IF NOT EXISTS (SELECT FROM pg_catalog.pg_roles WHERE rolname = 'anon') THEN - CREATE ROLE anon NOLOGIN; - END IF; - IF NOT EXISTS (SELECT FROM pg_catalog.pg_roles WHERE rolname = 'authenticated') THEN - CREATE ROLE authenticated NOLOGIN; - END IF; - IF NOT EXISTS (SELECT FROM pg_catalog.pg_roles WHERE rolname = 'service_role') THEN - CREATE ROLE service_role NOLOGIN BYPASSRLS; - END IF; - IF NOT EXISTS (SELECT FROM pg_catalog.pg_roles WHERE rolname = 'supabase_admin') THEN - CREATE ROLE supabase_admin WITH SUPERUSER CREATEROLE CREATEDB REPLICATION BYPASSRLS; - END IF; - IF NOT EXISTS (SELECT FROM pg_catalog.pg_roles WHERE rolname = 'authenticator') THEN - -- Le mot de passe est défini par 00z_set_authenticator_password.sh (variable AUTHENTICATOR_PASSWORD) - CREATE ROLE authenticator NOINHERIT; - END IF; -END -$$; - -GRANT anon, authenticated, service_role TO authenticator; -GRANT ALL ON SCHEMA public TO postgres; -GRANT ALL ON SCHEMA public TO supabase_admin; -GRANT ALL ON SCHEMA auth TO supabase_admin; -GRANT ALL ON SCHEMA storage TO supabase_admin; -GRANT ALL ON SCHEMA realtime TO supabase_admin; - --- Additional permissions for Supabase roles to access public schema -GRANT USAGE ON SCHEMA public TO anon, authenticated, service_role; -GRANT ALL ON ALL TABLES IN SCHEMA public TO service_role; -GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO service_role; -GRANT ALL ON ALL FUNCTIONS IN SCHEMA public TO service_role; -GRANT SELECT ON ALL TABLES IN SCHEMA public TO anon, authenticated; -GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO anon, authenticated; -GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO anon, authenticated; - diff --git a/docker/supabase/volumes/db/init/00z_set_authenticator_password.sh b/docker/supabase/volumes/db/init/00z_set_authenticator_password.sh deleted file mode 100755 index 33634a3..0000000 --- a/docker/supabase/volumes/db/init/00z_set_authenticator_password.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# Définit le mot de passe du rôle authenticator depuis l'environnement, -# pour ne pas le committer en dur dans les scripts SQL. -set -e - -psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" \ - -c "ALTER ROLE authenticator WITH LOGIN PASSWORD '${AUTHENTICATOR_PASSWORD:-postgres}'" diff --git a/docker/supabase/volumes/db/init/01_core_schema.sql b/docker/supabase/volumes/db/init/01_core_schema.sql deleted file mode 100644 index 0e15fda..0000000 --- a/docker/supabase/volumes/db/init/01_core_schema.sql +++ /dev/null @@ -1,468 +0,0 @@ --- ============================================ --- EXTENSIONS --- ============================================ -CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; - --- ============================================ --- ENUMS --- ============================================ -DO $$ BEGIN - CREATE TYPE public.item_type AS ENUM ('weapon', 'armor', 'consumable', 'tool', 'misc'); -EXCEPTION WHEN duplicate_object THEN null; END $$; - -DO $$ BEGIN - CREATE TYPE public.item_rarity AS ENUM ('common', 'uncommon', 'rare', 'epic', 'legendary'); -EXCEPTION WHEN duplicate_object THEN null; END $$; - -DO $$ BEGIN - CREATE TYPE public.economy_type AS ENUM ('income', 'expense'); -EXCEPTION WHEN duplicate_object THEN null; END $$; - -DO $$ BEGIN - CREATE TYPE public.ship_module_type AS ENUM ('engine', 'shield', 'weapon', 'utility'); -EXCEPTION WHEN duplicate_object THEN null; END $$; - -DO $$ BEGIN - CREATE TYPE public.ship_module_status AS ENUM ('active', 'damaged', 'offline'); -EXCEPTION WHEN duplicate_object THEN null; END $$; - -DO $$ BEGIN - CREATE TYPE public.forum_type AS ENUM ('category', 'region', 'sector', 'planet', 'location', 'forum'); -EXCEPTION WHEN duplicate_object THEN null; END $$; - -DO $$ BEGIN - CREATE TYPE public.user_role AS ENUM ('user', 'moderator', 'admin', 'game_master'); -EXCEPTION WHEN duplicate_object THEN null; END $$; - --- ============================================ --- TABLES --- ============================================ - --- PROFILES -CREATE TABLE IF NOT EXISTS public.profiles ( - id UUID PRIMARY KEY REFERENCES auth.users(id) ON DELETE CASCADE, - username TEXT UNIQUE, - avatar_url TEXT, - title_hrp TEXT, -- Added for frontend compatibility - role public.user_role DEFAULT 'user', - active_character_id UUID, - last_seen TIMESTAMPTZ DEFAULT NOW(), - created_at TIMESTAMPTZ DEFAULT NOW(), - updated_at TIMESTAMPTZ DEFAULT NOW() -); - --- Trigger to create profile on signup -CREATE OR REPLACE FUNCTION public.handle_new_user() -RETURNS trigger AS $$ -BEGIN - INSERT INTO public.profiles (id, username, role) - VALUES (new.id, COALESCE(new.raw_user_meta_data->>'username', new.email), 'user') - ON CONFLICT (id) DO NOTHING; - RETURN new; -END; -$$ LANGUAGE plpgsql SECURITY DEFINER; - -DROP TRIGGER IF EXISTS on_auth_user_created ON auth.users; -CREATE TRIGGER on_auth_user_created - AFTER INSERT ON auth.users - FOR EACH ROW EXECUTE FUNCTION public.handle_new_user(); - --- FORUM CATEGORIES -CREATE TABLE IF NOT EXISTS public.forum_categories ( - id SERIAL PRIMARY KEY, - name TEXT NOT NULL, - description TEXT, - era TEXT, - required_role public.user_role, - display_order INTEGER DEFAULT 0, - image_url TEXT, - created_at TIMESTAMPTZ DEFAULT NOW() -); - --- FORUMS -CREATE TABLE IF NOT EXISTS public.forums ( - id SERIAL PRIMARY KEY, - category_id INTEGER REFERENCES public.forum_categories(id) ON DELETE SET NULL, - parent_id INTEGER REFERENCES public.forums(id) ON DELETE CASCADE, - name TEXT NOT NULL, - description TEXT, - type public.forum_type NOT NULL, - coordinates JSONB, - image_url TEXT, - header_image_url TEXT, - required_role public.user_role, - display_order INTEGER DEFAULT 0, - topics_count INTEGER DEFAULT 0, - posts_count INTEGER DEFAULT 0, - created_at TIMESTAMPTZ DEFAULT NOW(), - updated_at TIMESTAMPTZ DEFAULT NOW() -); - --- GROUPS (Système de factions) -CREATE TABLE IF NOT EXISTS public.groups ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - name TEXT NOT NULL, - description TEXT, - color TEXT, - era TEXT, -- Added for era-specific groups - is_official BOOLEAN DEFAULT FALSE, - created_at TIMESTAMPTZ DEFAULT NOW() -); - --- CHARACTERS -CREATE TABLE IF NOT EXISTS public.characters ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - user_id UUID NOT NULL REFERENCES public.profiles(id) ON DELETE CASCADE, - name TEXT NOT NULL, - title TEXT, - class TEXT NOT NULL, - faction TEXT NOT NULL, - species TEXT DEFAULT 'Humain', - era TEXT NOT NULL DEFAULT 'Guerre Civile', - occupation_category TEXT DEFAULT 'Civil', - avatar TEXT, - credits INTEGER DEFAULT 2000, - main_group_id UUID REFERENCES public.groups(id) ON DELETE SET NULL, - current_location_id INTEGER REFERENCES public.forums(id), - is_traveling BOOLEAN DEFAULT FALSE, - travel_start_time TIMESTAMPTZ, - travel_end_time TIMESTAMPTZ, - travel_origin_id INTEGER REFERENCES public.forums(id), - travel_destination_id INTEGER REFERENCES public.forums(id), - physical_description TEXT, - personality TEXT, - background_history TEXT, - likes TEXT, - dislikes TEXT, - skills TEXT[] DEFAULT '{}', - starting_item TEXT, - hrp_notes TEXT, - is_active BOOLEAN DEFAULT TRUE, - created_at TIMESTAMPTZ DEFAULT NOW(), - updated_at TIMESTAMPTZ DEFAULT NOW() -); - --- GROUP MEMBERS -CREATE TABLE IF NOT EXISTS public.group_members ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - group_id UUID NOT NULL REFERENCES public.groups(id) ON DELETE CASCADE, - character_id UUID NOT NULL REFERENCES public.characters(id) ON DELETE CASCADE, - role TEXT DEFAULT 'member', - joined_at TIMESTAMPTZ DEFAULT NOW(), - UNIQUE(group_id, character_id) -); - --- Foreign key for active character in profile -ALTER TABLE public.profiles -ADD CONSTRAINT profiles_active_character_id_fkey -FOREIGN KEY (active_character_id) REFERENCES public.characters(id) ON DELETE SET NULL; - --- TOPICS -CREATE TABLE IF NOT EXISTS public.topics ( - id SERIAL PRIMARY KEY, - forum_id INTEGER NOT NULL REFERENCES public.forums(id) ON DELETE CASCADE, - author_id UUID NOT NULL REFERENCES public.profiles(id) ON DELETE CASCADE, - character_id UUID REFERENCES public.characters(id) ON DELETE SET NULL, - title TEXT NOT NULL, - replies_count INTEGER DEFAULT 0, - views_count INTEGER DEFAULT 0, - is_pinned BOOLEAN DEFAULT FALSE, - is_locked BOOLEAN DEFAULT FALSE, - last_post_id INTEGER, - created_at TIMESTAMPTZ DEFAULT NOW(), - updated_at TIMESTAMPTZ DEFAULT NOW() -); - --- POSTS -CREATE TABLE IF NOT EXISTS public.posts ( - id SERIAL PRIMARY KEY, - topic_id INTEGER NOT NULL REFERENCES public.topics(id) ON DELETE CASCADE, - author_id UUID NOT NULL REFERENCES public.profiles(id) ON DELETE CASCADE, - character_id UUID REFERENCES public.characters(id) ON DELETE SET NULL, - content TEXT NOT NULL, - created_at TIMESTAMPTZ DEFAULT NOW(), - updated_at TIMESTAMPTZ DEFAULT NOW() -); - --- CHAT -CREATE TABLE IF NOT EXISTS public.chat_messages ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - user_id UUID NOT NULL REFERENCES public.profiles(id) ON DELETE CASCADE, - character_id UUID REFERENCES public.characters(id) ON DELETE SET NULL, - text TEXT NOT NULL, - created_at TIMESTAMPTZ DEFAULT NOW() -); - --- ECONOMY -CREATE TABLE IF NOT EXISTS public.items_catalog ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - name TEXT NOT NULL, - description TEXT, - weight DECIMAL(10, 2) NOT NULL, - type public.item_type NOT NULL, - rarity public.item_rarity NOT NULL, - base_price INTEGER, - created_at TIMESTAMPTZ DEFAULT NOW() -); - -CREATE TABLE IF NOT EXISTS public.character_inventory ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - character_id UUID NOT NULL REFERENCES public.characters(id) ON DELETE CASCADE, - item_id UUID NOT NULL REFERENCES public.items_catalog(id) ON DELETE CASCADE, - quantity INTEGER DEFAULT 1, - acquired_at TIMESTAMPTZ DEFAULT NOW(), - UNIQUE(character_id, item_id) -); - -CREATE TABLE IF NOT EXISTS public.economy_history ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - character_id UUID NOT NULL REFERENCES public.characters(id) ON DELETE CASCADE, - date DATE NOT NULL DEFAULT CURRENT_DATE, - description TEXT NOT NULL, - amount INTEGER NOT NULL, - type public.economy_type NOT NULL, - created_at TIMESTAMPTZ DEFAULT NOW() -); - --- SHIPS -CREATE TABLE IF NOT EXISTS public.ships ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - character_id UUID UNIQUE REFERENCES public.characters(id) ON DELETE CASCADE, - name TEXT NOT NULL, - model TEXT NOT NULL, - cargo_capacity INTEGER NOT NULL, - current_cargo_weight INTEGER DEFAULT 0, - created_at TIMESTAMPTZ DEFAULT NOW(), - updated_at TIMESTAMPTZ DEFAULT NOW() -); - -CREATE TABLE IF NOT EXISTS public.ship_modules ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - ship_id UUID NOT NULL REFERENCES public.ships(id) ON DELETE CASCADE, - name TEXT NOT NULL, - type public.ship_module_type NOT NULL, - status public.ship_module_status DEFAULT 'active', - stats JSONB DEFAULT '{}', - created_at TIMESTAMPTZ DEFAULT NOW() -); - --- WIKI -CREATE TABLE IF NOT EXISTS public.wiki_categories ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - title TEXT NOT NULL, - icon TEXT, - display_order INTEGER DEFAULT 0, - created_at TIMESTAMPTZ DEFAULT NOW() -); - -CREATE TABLE IF NOT EXISTS public.wiki_sub_categories ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - category_id UUID NOT NULL REFERENCES public.wiki_categories(id) ON DELETE CASCADE, - title TEXT NOT NULL, - display_order INTEGER DEFAULT 0, - created_at TIMESTAMPTZ DEFAULT NOW() -); - -CREATE TABLE IF NOT EXISTS public.wiki_articles ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - sub_category_id UUID REFERENCES public.wiki_sub_categories(id) ON DELETE SET NULL, - title TEXT NOT NULL, - excerpt TEXT, - content TEXT NOT NULL, - metadata JSONB DEFAULT '{}', - category TEXT, - image TEXT, - related_articles UUID[] DEFAULT ARRAY[]::UUID[], - created_at TIMESTAMPTZ DEFAULT NOW(), - updated_at TIMESTAMPTZ DEFAULT NOW() -); - --- ============================================ --- SECURITY (RLS) --- ============================================ -ALTER TABLE public.profiles ENABLE ROW LEVEL SECURITY; -ALTER TABLE public.characters ENABLE ROW LEVEL SECURITY; -ALTER TABLE public.chat_messages ENABLE ROW LEVEL SECURITY; -ALTER TABLE public.forum_categories ENABLE ROW LEVEL SECURITY; -ALTER TABLE public.forums ENABLE ROW LEVEL SECURITY; -ALTER TABLE public.topics ENABLE ROW LEVEL SECURITY; -ALTER TABLE public.posts ENABLE ROW LEVEL SECURITY; -ALTER TABLE public.groups ENABLE ROW LEVEL SECURITY; -ALTER TABLE public.group_members ENABLE ROW LEVEL SECURITY; - --- Profiles -CREATE POLICY "Public profiles are viewable by everyone" ON public.profiles FOR SELECT USING (true); -CREATE POLICY "Users can update own profile" ON public.profiles FOR UPDATE USING (auth.uid() = id) WITH CHECK (auth.uid() = id); - --- Characters -CREATE POLICY "Characters are viewable by everyone" ON public.characters FOR SELECT USING (true); -CREATE POLICY "Users can insert own characters" ON public.characters FOR INSERT WITH CHECK (auth.uid() = user_id); -CREATE POLICY "Users can update own characters" ON public.characters FOR UPDATE USING (auth.uid() = user_id); - --- Forums -CREATE POLICY "Categories are viewable by everyone" ON public.forum_categories FOR SELECT USING (true); -CREATE POLICY "Forums are viewable by everyone" ON public.forums FOR SELECT USING (true); - --- Topics & Posts -CREATE POLICY "Topics are viewable by everyone" ON public.topics FOR SELECT USING (true); -CREATE POLICY "Users can insert topics" ON public.topics FOR INSERT WITH CHECK (auth.uid() IS NOT NULL); -CREATE POLICY "Users can update own topics" ON public.topics FOR UPDATE USING (auth.uid() = author_id); - -CREATE POLICY "Posts are viewable by everyone" ON public.posts FOR SELECT USING (true); -CREATE POLICY "Users can insert posts" ON public.posts FOR INSERT WITH CHECK (auth.uid() IS NOT NULL); -CREATE POLICY "Users can update own posts" ON public.posts FOR UPDATE USING (auth.uid() = author_id); - --- Chat -CREATE POLICY "Chat messages are viewable by everyone" ON public.chat_messages FOR SELECT USING (true); -CREATE POLICY "Users can insert own messages" ON public.chat_messages FOR INSERT WITH CHECK (auth.uid() = user_id); - --- Groups -CREATE POLICY "Groups are viewable by everyone" ON public.groups FOR SELECT USING (true); - --- Group Members -CREATE POLICY "Group members are viewable by everyone" ON public.group_members FOR SELECT USING (true); -CREATE POLICY "Users can insert group members for their characters" ON public.group_members FOR INSERT WITH CHECK ( - EXISTS ( - SELECT 1 FROM public.characters - WHERE id = character_id AND user_id = auth.uid() - ) -); - --- ============================================ --- FUNCTIONS & TRIGGERS --- ============================================ - --- Updated At Update -CREATE OR REPLACE FUNCTION public.update_updated_at_column() -RETURNS TRIGGER AS $$ -BEGIN - NEW.updated_at = NOW(); - RETURN NEW; -END; -$$ LANGUAGE plpgsql; - -CREATE TRIGGER update_profiles_updated_at BEFORE UPDATE ON public.profiles FOR EACH ROW EXECUTE FUNCTION public.update_updated_at_column(); -CREATE TRIGGER update_characters_updated_at BEFORE UPDATE ON public.characters FOR EACH ROW EXECUTE FUNCTION public.update_updated_at_column(); -CREATE TRIGGER update_forums_updated_at BEFORE UPDATE ON public.forums FOR EACH ROW EXECUTE FUNCTION public.update_updated_at_column(); -CREATE TRIGGER update_topics_updated_at BEFORE UPDATE ON public.topics FOR EACH ROW EXECUTE FUNCTION public.update_updated_at_column(); -CREATE TRIGGER update_posts_updated_at BEFORE UPDATE ON public.posts FOR EACH ROW EXECUTE FUNCTION public.update_updated_at_column(); - --- Topic Counts Triggers (Recursive) -CREATE OR REPLACE FUNCTION public.update_forum_counts() -RETURNS TRIGGER AS $$ -DECLARE - current_forum_id INTEGER; -BEGIN - IF (TG_OP = 'INSERT') THEN - current_forum_id := NEW.forum_id; - WHILE current_forum_id IS NOT NULL LOOP - UPDATE public.forums SET topics_count = topics_count + 1 WHERE id = current_forum_id; - SELECT parent_id INTO current_forum_id FROM public.forums WHERE id = current_forum_id; - END LOOP; - ELSIF (TG_OP = 'DELETE') THEN - current_forum_id := OLD.forum_id; - WHILE current_forum_id IS NOT NULL LOOP - UPDATE public.forums SET topics_count = topics_count - 1 WHERE id = current_forum_id; - SELECT parent_id INTO current_forum_id FROM public.forums WHERE id = current_forum_id; - END LOOP; - END IF; - RETURN NULL; -END; -$$ LANGUAGE plpgsql; - -CREATE TRIGGER on_topic_created_deleted - AFTER INSERT OR DELETE ON public.topics - FOR EACH ROW EXECUTE FUNCTION public.update_forum_counts(); - -CREATE OR REPLACE FUNCTION public.update_post_counts() -RETURNS TRIGGER AS $$ -DECLARE - current_forum_id INTEGER; -BEGIN - IF (TG_OP = 'INSERT') THEN - UPDATE public.topics SET replies_count = replies_count + 1, updated_at = NOW() WHERE id = NEW.topic_id; - SELECT forum_id INTO current_forum_id FROM public.topics WHERE id = NEW.topic_id; - WHILE current_forum_id IS NOT NULL LOOP - UPDATE public.forums SET posts_count = posts_count + 1 WHERE id = current_forum_id; - SELECT parent_id INTO current_forum_id FROM public.forums WHERE id = current_forum_id; - END LOOP; - ELSIF (TG_OP = 'DELETE') THEN - UPDATE public.topics SET replies_count = replies_count - 1 WHERE id = OLD.topic_id; - SELECT forum_id INTO current_forum_id FROM public.topics WHERE id = OLD.topic_id; - WHILE current_forum_id IS NOT NULL LOOP - UPDATE public.forums SET posts_count = posts_count - 1 WHERE id = current_forum_id; - SELECT parent_id INTO current_forum_id FROM public.forums WHERE id = current_forum_id; - END LOOP; - END IF; - RETURN NULL; -END; -$$ LANGUAGE plpgsql; - -CREATE TRIGGER on_post_created_deleted - AFTER INSERT OR DELETE ON public.posts - FOR EACH ROW EXECUTE FUNCTION public.update_post_counts(); - - - --- RPC: Get Global Stats for Footer -CREATE OR REPLACE FUNCTION public.get_global_stats() -RETURNS json AS $$ -DECLARE - total_posts bigint; - total_topics bigint; - total_users bigint; - latest_user json; - guests_count int := 2; -- Simulé - factions_by_era json; -BEGIN - SELECT count(*) INTO total_posts FROM public.posts; - SELECT count(*) INTO total_topics FROM public.topics; - SELECT count(*) INTO total_users FROM public.profiles; - - SELECT json_build_object('id', id, 'username', username) - INTO latest_user - FROM public.profiles - ORDER BY created_at DESC - LIMIT 1; - - -- Stats des factions par ère - SELECT json_object_agg(era_group, faction_list) INTO factions_by_era - FROM ( - SELECT COALESCE(era, 'Général') as era_group, - json_agg(json_build_object('id', id, 'name', name, 'color', color, 'member_count', - (SELECT count(*) FROM public.characters WHERE main_group_id = g.id) - )) as faction_list - FROM public.groups g - GROUP BY era - ) t; - - RETURN json_build_object( - 'total_posts', total_posts, - 'total_topics', total_topics, - 'total_users', total_users, - 'latest_user', latest_user, - 'guests_count', guests_count, - 'online_record', json_build_object('count', total_users + guests_count, 'date', now()), - 'factions_by_era', factions_by_era, - 'birthdays_today', '[]'::json, -- Pour éviter les erreurs dans le front - 'birthdays_week', '[]'::json - ); -END; -$$ LANGUAGE plpgsql SECURITY DEFINER; - --- Grant access to the RPC function -GRANT EXECUTE ON FUNCTION public.get_global_stats() TO anon; -GRANT EXECUTE ON FUNCTION public.get_global_stats() TO authenticated; - --- RPC: Increment Topic Views -CREATE OR REPLACE FUNCTION public.increment_topic_views(topic_id integer) -RETURNS void AS $$ -BEGIN - UPDATE public.topics - SET views_count = views_count + 1 - WHERE id = topic_id; -END; -$$ LANGUAGE plpgsql SECURITY DEFINER; - -GRANT EXECUTE ON FUNCTION public.increment_topic_views(integer) TO anon; -GRANT EXECUTE ON FUNCTION public.increment_topic_views(integer) TO authenticated; diff --git a/docker/supabase/volumes/db/init/02_categories.sql b/docker/supabase/volumes/db/init/02_categories.sql deleted file mode 100644 index 73d3746..0000000 --- a/docker/supabase/volumes/db/init/02_categories.sql +++ /dev/null @@ -1,19 +0,0 @@ --- ================================================================================= --- SEED 01 : CATÉGORIES DE BASE --- ================================================================================= - -INSERT INTO public.forum_categories (id, name, description, era, required_role, display_order) -VALUES -(1, 'Holonews', 'Communications officielles et informations vitales.', NULL, NULL, 1), -(2, 'Guerre des Clones', 'Un conflit galactique total opposant la République Galactique à la Confédération des Systèmes Indépendants (CSI).', 'Old Republic', NULL, 10), -(3, 'Guerre Civile Galactique', 'L''ombre de l''Empire Galactique s''étend sur la galaxie, étouffant toute velléité de liberté sous une poigne de fer.', 'Galactic Empire', NULL, 20), -(4, 'Nouvelle République', 'La galaxie respire à nouveau, mais son souffle est encore court. Sur les ruines de l''Empire Galactique, la Nouvelle République tente de tisser une toile d''espoir et de justice.', 'New Republic', NULL, 30), -(5, 'Social', 'Echanges entre joueurs et support.', NULL, NULL, 40), -(6, 'Administratif', 'Espaces réservés à l''équipe du forum.', NULL, 'moderator', 100), -(7, 'Archives', 'Anciens messages et archives de la galaxie.', NULL, NULL, 150) -ON CONFLICT (id) DO UPDATE SET - name = EXCLUDED.name, - description = EXCLUDED.description, - era = EXCLUDED.era, - required_role = EXCLUDED.required_role, - display_order = EXCLUDED.display_order; diff --git a/docker/supabase/volumes/db/init/03_forums_hrp.sql b/docker/supabase/volumes/db/init/03_forums_hrp.sql deleted file mode 100644 index 7ce8364..0000000 --- a/docker/supabase/volumes/db/init/03_forums_hrp.sql +++ /dev/null @@ -1,60 +0,0 @@ --- ================================================================================= --- SEED 02 : FORUMS HORS-RP --- ================================================================================= - -DO $$ -BEGIN - -- Annonces - IF NOT EXISTS (SELECT 1 FROM public.forums WHERE name = 'Annonces' AND category_id = 1) THEN - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (1, 'Annonces', 'Les dernières nouvelles du front et du projet.', 'forum', 1); - END IF; - - -- Présentations - IF NOT EXISTS (SELECT 1 FROM public.forums WHERE name = 'Présentations' AND category_id = 1) THEN - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (1, 'Présentations', 'Faites-vous connaître de la galaxie.', 'forum', 2); - END IF; - - -- Création de personnage - IF NOT EXISTS (SELECT 1 FROM public.forums WHERE name = 'Création de personnage' AND category_id = 1) THEN - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (1, 'Création de personnage', 'Lieu de naissance des futures légendes.', 'forum', 3); - END IF; - - -- Discussions - IF NOT EXISTS (SELECT 1 FROM public.forums WHERE name = 'Discussions' AND category_id = 5) THEN - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (5, 'Discussions', 'Parler de tout et de rien (HRP).', 'forum', 1); - END IF; - - -- Suggestions - IF NOT EXISTS (SELECT 1 FROM public.forums WHERE name = 'Suggestions' AND category_id = 5) THEN - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (5, 'Suggestions', 'Aidez-nous à améliorer votre expérience.', 'forum', 2); - END IF; - - -- Signaler un bug - IF NOT EXISTS (SELECT 1 FROM public.forums WHERE name = 'Signaler un bug' AND category_id = 5) THEN - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (5, 'Signaler un bug', 'Rapportez les anomalies techniques ici.', 'forum', 3); - END IF; - - -- Modérateurs - IF NOT EXISTS (SELECT 1 FROM public.forums WHERE name = 'Modérateurs' AND category_id = 6) THEN - INSERT INTO public.forums (category_id, name, description, type, required_role, display_order) - VALUES (6, 'Modérateurs', 'Coordination de la modération et des Smodos.', 'forum', 'moderator', 1); - END IF; - - -- Administrateurs - IF NOT EXISTS (SELECT 1 FROM public.forums WHERE name = 'Administrateurs' AND category_id = 6) THEN - INSERT INTO public.forums (category_id, name, description, type, required_role, display_order) - VALUES (6, 'Administrateurs', 'Décisions de haut niveau et gestion technique.', 'forum', 'admin', 2); - END IF; - - -- Archives Galactiques - IF NOT EXISTS (SELECT 1 FROM public.forums WHERE name = 'Archives Galactiques' AND category_id = 7) THEN - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (7, 'Archives Galactiques', 'Le passé de la galaxie, préservé pour l''éternité.', 'forum', 1); - END IF; -END $$; diff --git a/docker/supabase/volumes/db/init/04_atlas_clone_wars.sql b/docker/supabase/volumes/db/init/04_atlas_clone_wars.sql deleted file mode 100644 index 8a4b7e7..0000000 --- a/docker/supabase/volumes/db/init/04_atlas_clone_wars.sql +++ /dev/null @@ -1,111 +0,0 @@ --- ================================================================================= --- SEED 03 : ATLAS GALACTIQUE - GUERRE DES CLONES (REFONTE TOTALE) --- ================================================================================= - -DO $$ -DECLARE - reg_id INTEGER; - zone_id INTEGER; -BEGIN - -- ========================================== - -- 1. NOYAU GALACTIQUE (BASTION DE LA RÉPUBLIQUE) - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (2, 'Noyau Galactique', 'Le centre de gravité de la civilisation, siège du pouvoir galactique et bastion inexpugnable de la République.', 'region', 1) - RETURNING id INTO reg_id; - - -- ZONE : Le Centre Politique - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (2, reg_id, 'Le Centre Politique', 'Le cœur battant de la démocratie galactique, où les décisions qui forgent l''histoire sont prises sous le dôme du Sénat.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (2, zone_id, 'Coruscant', 'Cité-monde étincelante et capitale de la République, Coruscant est le centre névralgique de l''effort de guerre. Tandis que le Sénat Galactique résonne des débats passionnés sur la militarisation, le Temple Jedi surplombe la ville, servant de quartier général aux généraux Jedi qui coordonnent les armées de clones à travers la galaxie. Les niveaux supérieurs respirent l''opulence, mais l''ombre du conflit s''étend jusque dans les bas-fonds, où les espions séparatistes et les trafiquants profitent du chaos politique.', 'planet'), - (2, zone_id, 'Alderaan', 'Perle de beauté et de culture, Alderaan demeure l''un des plus fermes soutiens diplomatiques de la République. Sous l''égide de la Maison Organa, la planète prône la paix et la résolution pacifique des conflits, bien que sa position stratégique dans le Noyau en fasse une cible de choix pour les intrigues politiques séparatistes. Ses paysages de montagnes enneigées et de plaines verdoyantes offrent un contraste frappant avec la violence qui ravage le reste de la galaxie.', 'planet'); - - -- ZONE : Les Mondes Fondateurs - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (2, reg_id, 'Les Mondes Fondateurs', 'Bastions industriels et historiques produisant la puissance navale nécessaire à la défense du Noyau.', 'region', 2) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (2, zone_id, 'Corellia', 'Réputée pour ses chantiers navals orbitaux et ses pilotes intrépides, Corellia est la forge des vaisseaux de ligne de la République. La planète est un tourbillon d''activité industrielle où les ingénieurs travaillent sans relâche pour produire les croiseurs qui affronteront les flottes de la CSI. Bien que loyale, Corellia conserve un esprit d''indépendance farouche, et ses spatioports sont des nids de rumeurs et de contrebande.', 'planet'), - (2, zone_id, 'Kuat', 'Dominée par les immenses anneaux de construction des Kuat Drive Yards, cette planète est le joyau industriel de la République. C''est ici que naissent les redoutables destroyers stellaires de classe Venator. La sécurité y est absolue, car la perte de Kuat signifierait la fin de la suprématie navale républicaine. L''aristocratie locale, immensément riche, tire les ficelles de l''économie de guerre avec une efficacité glaciale.', 'planet'); - - -- ========================================== - -- 2. BORDURES INTÉRIEURE & MÉDIANE (CHAMPS DE BATAILLE) - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (2, 'Bordures Intérieure & Médiane', 'Zones de transition vitales, parsemées de mondes stratégiques servant de boucliers au Noyau.', 'region', 2) - RETURNING id INTO reg_id; - - -- ZONE : Secteur de l''Expansion - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (2, reg_id, 'Secteur de l''Expansion', 'Région riche en ressources, disputée avec acharnement entre les deux factions.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (2, zone_id, 'Naboo', 'D''une beauté bucolique, Naboo est un symbole de résistance contre l''avidité des corporations. Bien que la planète ait été le théâtre de l''invasion par la Fédération du Commerce, elle reste un allié précieux de la République. Ses plaines et ses cités sous-marines sont protégées par les forces de sécurité royales et les Gungans, toujours prêts à repousser toute nouvelle incursion séparatiste.', 'planet'), - (2, zone_id, 'Devaron', 'Monde de montagnes escarpées et de jungles denses, Devaron est une plaque tournante stratégique sur la route commerciale du Noyau. La planète est le siège d''une lutte politique intense entre les partisans de la neutralité et ceux qui souhaitent rejoindre la République, tandis que les forêts environnantes cachent souvent des avant-postes secrets et des camps d''entraînement pour les forces spéciales.', 'planet'); - - -- ZONE : Théâtres de Siège - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (2, reg_id, 'Théâtres de Siège', 'Mondes devenus des symboles de la guerre d''usure où clones et droïdes s''affrontent sans fin.', 'region', 2) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (2, zone_id, 'Kashyyyk', 'Le monde forestier des Wookiees est un champ de bataille vertical. Les séparatistes convoitent les ressources et la position stratégique de la planète, menant des assauts massifs contre les cités dans les arbres. Les Wookiees, alliés naturels de la République, combattent avec une bravoure légendaire aux côtés des clones, transformant chaque niveau de la canopée en un piège mortel pour les droïdes de combat.', 'planet'), - (2, zone_id, 'Christophsis', 'Cité de cristal étincelante, Christophsis est devenue le théâtre d''un siège mémorable. Ses ressources minérales et sa position sur les routes de la Bordure en font une cible prioritaire pour la CSI. Les combats de rue y sont acharnés, chaque bloc d''habitation cristallin pouvant devenir une forteresse. La population civile, prise entre deux feux, tente de survivre dans les ruines de ce qui fut autrefois l''une des plus belles villes de la galaxie.', 'planet'); - - -- ========================================== - -- 3. BORDURE EXTÉRIEURE (L''ENFER DE LA GUERRE) - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (2, 'Bordure Extérieure', 'Vaste étendue sauvage où la loi de la République s''efface devant la puissance des séparatistes et des cartels.', 'region', 3) - RETURNING id INTO reg_id; - - -- ZONE : Les Bastions de la CSI - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (2, reg_id, 'Les Bastions de la CSI', 'Le cœur industriel et militaire de la Confédération des Systèmes Indépendants.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (2, zone_id, 'Geonosis', 'Planète de poussière et de roche, Geonosis est le berceau de la CSI. Ses usines souterraines massives produisent les légions de droïdes qui s''abattent sur la galaxie. C''est ici que la première bataille de la guerre a éclaté, et la planète reste un bastion lourdement défendu, hanté par le bourdonnement des Geonosiens et la chaleur des fonderies.', 'planet'), - (2, zone_id, 'Mustafar', 'Enfer volcanique et monde minier, Mustafar abrite des installations secrètes de haute importance pour le Conseil Séparatiste. Les rivières de lave et les infrastructures flottantes créent un environnement hostile où seuls les plus désespérés ou les plus loyaux osent s''aventurer. C''est un lieu de retraite pour les leaders de la CSI, loin du regard de la République.', 'planet'), - (2, zone_id, 'Utapau', 'Monde de gouffres et de cités troglodytes, Utapau tente de maintenir une neutralité fragile dans un conflit qui la dépasse. Cependant, ses vastes grottes offrent des cachettes idéales pour les flottes séparatistes en attente. La population locale, pacifique mais fière, observe avec inquiétude l''ombre des destroyers qui plane au-dessus de leurs puits vertigineux.', 'planet'); - - -- ZONE : Mondes de Frontière - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (2, reg_id, 'Mondes de Frontière', 'Frontières sauvages où le destin de la galaxie se joue dans des batailles isolées.', 'region', 2) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (2, zone_id, 'Kamino', 'Monde océanique perpétuellement balayé par les tempêtes, Kamino est le secret le mieux gardé de la République. Dans les cités immaculées de Tipoca, les Kaminoans produisent et entraînent les millions de soldats clones qui constituent la Grande Armée de la République. La sécurité y est draconienne, car toute attaque contre Kamino menacerait directement le renouvellement des troupes républicaines.', 'planet'), - (2, zone_id, 'Tatooine', 'Désert impitoyable dominé par les Hutts, Tatooine est une plaque tournante pour les mercenaires, les chasseurs de primes et les fugitifs. Bien qu''officiellement hors de la juridiction de la République, sa position sur les routes de la Bordure en fait un point de passage crucial. Les escarmouches entre les forces séparatistes et les intérêts locaux y sont fréquentes, tandis que les Jedi y mènent parfois des missions de reconnaissance discrètes.', 'planet'), - (2, zone_id, 'Ryloth', 'Monde natal des Twi''leks, Ryloth est dévasté par l''occupation séparatiste qui cherche à s''emparer de ses ressources en Ryll. La résistance locale, menée par des guerriers intrépides, lutte pied à pied dans les canyons et les cavernes pour libérer leur peuple. La République envoie souvent des contingents de clones pour soutenir ces insurgés, transformant la planète en un symbole de lutte pour la liberté.', 'planet'); - - -- ========================================== - -- 4. ESPACE INCONNU & MONDES SECRETS - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (2, 'Espace Inconnu & Mondes Secrets', 'Régions mystérieuses et oubliées où la Force et les secrets anciens dominent.', 'region', 4) - RETURNING id INTO reg_id; - - -- ZONE : Mystères de la Force - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (2, reg_id, 'Mystères de la Force', 'Lieux de pouvoir et de légende, accessibles uniquement aux initiés ou par pur hasard.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (2, zone_id, 'Ilum', 'Planète glacée et secrète, Ilum est le lieu sacré où les Jedi viennent récolter les cristaux Kyber pour leurs sabres laser. Ses grottes cristallines sont imprégnées de la Force, offrant des visions et des défis à ceux qui cherchent la sagesse. En temps de guerre, la protection d''Ilum est devenue une priorité absolue pour l''Ordre Jedi, afin d''éviter que ses secrets ne tombent entre les mains des Sith.', 'planet'), - (2, zone_id, 'Mortis', 'Un monolithe éthéré flottant dans l''espace, Mortis est un royaume qui défie les lois de la physique galactique. On dit qu''il est le foyer des "Élus" de la Force, des entités représentant l''Équilibre, le Côté Lumineux et le Côté Obscur. Peu ont trouvé le chemin de Mortis, et ceux qui en reviennent sont changés à jamais par les révélations sur la nature profonde de la Force.', 'planet'); - - -- ZONE : Frontières de l''Ombre - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (2, reg_id, 'Frontières de l''Ombre', 'Mondes hantés par des puissances anciennes et des cultures guerrières.', 'region', 2) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (2, zone_id, 'Dathomir', 'Monde de brumes rouges et de forêts de pierre, Dathomir est le domaine des Sœurs de la Nuit et des Frères de la Nuit. Imprégnée d''une magie obscure et ancienne, la planète est un lieu de danger constant. Les séparatistes ont tenté de forger des alliances avec ces clans puissants, mais la loyauté sur Dathomir est aussi changeante que les ombres qui hantent ses paysages désolés.', 'planet'); - -END $$; diff --git a/docker/supabase/volumes/db/init/05_atlas_civil_war.sql b/docker/supabase/volumes/db/init/05_atlas_civil_war.sql deleted file mode 100644 index f0bf719..0000000 --- a/docker/supabase/volumes/db/init/05_atlas_civil_war.sql +++ /dev/null @@ -1,106 +0,0 @@ --- ================================================================================= --- SEED 04 : ATLAS GALACTIQUE - GUERRE CIVILE GALACTIQUE (REFONTE TOTALE) --- ================================================================================= - -DO $$ -DECLARE - reg_id INTEGER; - zone_id INTEGER; -BEGIN - -- ========================================== - -- 1. LE CENTRE IMPÉRIAL (L'ORDRE NOUVEAU) - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (3, 'Le Centre Impérial', 'Le bastion de la puissance impériale, où la surveillance est absolue et la discipline de fer garantit la paix de l''Empereur.', 'region', 1) - RETURNING id INTO reg_id; - - -- ZONE : Le Cœur de l''Empire - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (3, reg_id, 'Le Cœur de l''Empire', 'Le centre politique et industriel de la galaxie, entièrement dévoué à la gloire de l''Empire Galactique.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (3, zone_id, 'Coruscant', 'Ancienne capitale de la République, Coruscant est devenue le Centre Impérial. Le Palais de l''Empereur, autrefois le Temple Jedi, domine désormais une planète transformée par une bureaucratie étouffante et une surveillance constante du BSI. Les niveaux supérieurs sont réservés à l''élite impériale, tandis que les bas-fonds sont devenus des foyers de dissidence réprimés avec une brutalité implacable. Chaque bloc urbain est un rappel de l''Ordre Nouveau, où la peur a remplacé la démocratie.', 'planet'), - (3, zone_id, 'Kuat', 'Les chantiers navals de Kuat Drive Yards sont le poumon militaire de l''Empire. Sous une occupation militaire stricte, les ouvriers produisent les Destroyers Stellaires qui patrouillent la galaxie. L''anneau orbital de Kuat est l''une des structures les mieux défendues au monde, un symbole de la puissance navale impériale. Toute trace de l''ancienne culture aristocratique a été mise au service de l''effort de guerre impérial.', 'planet'); - - -- ZONE : Mondes de Discipline - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (3, reg_id, 'Mondes de Discipline', 'Bastions de formation et de propagande où les futurs officiers et soldats de l''Empire sont forgés.', 'region', 2) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (3, zone_id, 'Eriadu', 'Monde industriel et foyer de la famille Tarkin, Eriadu est le modèle de la discipline impériale en Bordure Extérieure. La planète est une cité-monde polluée mais efficace, où l''ordre est maintenu par une garnison massive. C''est un centre de commandement régional crucial pour la coordination des opérations anti-insurrectionnelles dans les secteurs périphériques.', 'planet'), - (3, zone_id, 'Carida', 'Siège de l''Académie Impériale, Carida est la forge où sont formés les Stormtroopers et les officiers de l''élite. Ses environnements variés, des déserts brûlants aux pôles glacés, servent de terrains d''entraînement impitoyables. La planète est un bastion de loyauté inébranlable, où chaque citoyen est éduqué dans le culte de l''Empereur et la supériorité de l''Ordre Nouveau.', 'planet'); - - -- ========================================== - -- 2. BORDURES DE LA RÉBELLION (L'ÉTINCELLE DE L'ESPOIR) - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (3, 'Bordures de la Rébellion', 'Zones de conflit et refuges pour ceux qui refusent de se plier à la tyrannie impériale.', 'region', 2) - RETURNING id INTO reg_id; - - -- ZONE : Bases Clandestines - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (3, reg_id, 'Bases Clandestines', 'Lieux secrets où l''Alliance Rebelle regroupe ses forces et planifie ses frappes contre l''Empire.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (3, zone_id, 'Yavin IV', 'Lune forestière luxuriante abritant d''anciens temples Massassi, Yavin IV sert de base principale à l''Alliance Rebelle. Sous la canopée épaisse, les rebelles ont installé leurs hangars et leurs centres de communication, espérant que l''isolement de la lune les protégera des patrouilles impériales. C''est un lieu chargé d''histoire et d''espoir, où chaque pilote sait que la prochaine mission pourrait être la dernière.', 'planet'), - (3, zone_id, 'Hoth', 'Monde de glace désolé aux confins de la Bordure Extérieure, Hoth est le dernier refuge de la Base Echo. Les rebelles y luttent contre des températures mortelles et une faune hostile pour maintenir leur présence secrète. L''isolement total de la planète est sa seule défense contre la puissance écrasante de la flotte impériale qui traque sans relâche l''étincelle de la révolte.', 'planet'), - (3, zone_id, 'Dantooine', 'Ancienne base rebelle désormais abandonnée, Dantooine reste un monde agraire paisible mais marqué par le passage de l''Alliance. Les ruines des installations rebelles sont parfois fouillées par des patrouilles impériales, tandis que la population locale tente de rester neutre, craignant des représailles pour avoir autrefois hébergé les "traîtres" républicains.', 'planet'); - - -- ZONE : Mondes en Révolte - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (3, reg_id, 'Mondes en Révolte', 'Systèmes courageux qui soutiennent ouvertement ou secrètement l''Alliance pour la Restauration de la République.', 'region', 2) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (2, zone_id, 'Mon Cala', 'Monde océanique dont les chantiers navals produisent les croiseurs stellaires de l''Alliance. Les Mon Calamaris et les Quarrens ont uni leurs forces après avoir été exploités par l''Empire, transformant leurs cités flottantes en bastions de résistance navale. La planète est en état de siège permanent, protégée par une flotte rebelle déterminée à défendre son principal centre de production.', 'planet'), - (3, zone_id, 'Sullust', 'Monde volcanique dont l''industrie est contrôlée par la corporation SoroSuub, Sullust est un terrain de lutte entre les collaborateurs impériaux et les syndicats rebelles. Ses vastes réseaux de tunnels et ses usines géothermiques sont le théâtre de sabotages et de guérilla urbaine, alors que l''Alliance cherche à rallier ce monde industriel crucial à sa cause.', 'planet'), - (3, zone_id, 'Chandrila', 'Foyer de Mon Mothma, Chandrila est un symbole de résistance diplomatique. Bien que sous surveillance impériale, la planète conserve ses traditions démocratiques et sert de lien secret entre les sénateurs dissidents et l''Alliance armée. Ses paysages sereins cachent une agitation politique intense et un réseau d''espionnage sophistiqué.', 'planet'); - - -- ========================================== - -- 3. LA BORDURE EXTÉRIEURE (ZONE DE NON-DROIT) - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (3, 'La Bordure Extérieure', 'Vaste étendue sauvage où l''autorité impériale est contestée par les cartels criminels et la nature elle-même.', 'region', 3) - RETURNING id INTO reg_id; - - -- ZONE : L''Espace Hutt & Crime - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (3, reg_id, 'L''Espace Hutt & Crime', 'Territoires dominés par les syndicats du crime, où tout s''achète et se vend, même la loyauté.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (3, zone_id, 'Tatooine', 'Désert impitoyable sous l''influence de Jabba le Hutt, Tatooine est le carrefour de la pègre galactique. L''Empire y maintient une présence symbolique à Mos Eisley, mais la véritable loi est celle des crédits et des blasters. C''est un refuge pour les contrebandiers, les chasseurs de primes et les agents rebelles en quête d''anonymat dans les sables mouvants de la Bordure.', 'planet'), - (3, zone_id, 'Nal Hutta', 'Le "Joyau Glorieux" est le cœur de l''empire criminel des Hutts. Planète marécageuse et polluée, elle est le siège du Conseil des Hutts qui tire les ficelles de l''Underworld galactique. L''Empire évite une confrontation directe, préférant des accords pragmatiques pour assurer la stabilité des routes commerciales de la Bordure.', 'planet'), - (3, zone_id, 'Kessel', 'Astéroïde minier infernal, Kessel est célèbre pour son épice et son "Raid de Kessel". L''Empire y exploite des prisonniers politiques et des esclaves dans des conditions inhumaines pour alimenter les marchés noirs et les besoins militaires. C''est un lieu de souffrance et de richesse rapide, protégé par des tempêtes ioniques permanentes.', 'planet'); - - -- ZONE : Confins Sauvages - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (3, reg_id, 'Confins Sauvages', 'Mondes isolés et mystérieux, souvent ignorés par les grandes puissances galactiques.', 'region', 2) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (3, zone_id, 'Bespin', 'Géante gazeuse abritant la Cité des Nuages, Bespin tente de maintenir une neutralité précaire grâce à son isolation. Ses mines de gaz Tibanna sont vitales pour l''armement, attirant l''attention de l''Empire et de l''Alliance. La cité flottante est un havre de luxe et de jeu, mais l''ombre du conflit galactique finit toujours par l''atteindre.', 'planet'), - (3, zone_id, 'Endor', 'Lune forestière reculée, Endor est le foyer des Ewoks et le site top secret de la construction de la seconde Étoile de la Mort. Ses forêts denses et sa position isolée en font le théâtre final d''une confrontation qui décidera du sort de la galaxie. C''est un monde d''une beauté sauvage cachant une arme d''une destruction inimaginable.', 'planet'), - (3, zone_id, 'Dagobah', 'Monde de marécages et de brumes, Dagobah est absent des cartes impériales. Imprégnée par la Force, la planète est le refuge secret du Maître Yoda. C''est un lieu de pure nature où le côté lumineux et le côté obscur se côtoient dans un équilibre primal, loin du vacarme de la guerre civile.', 'planet'); - - -- ========================================== - -- 4. LES SECRETS DE L'EMPEREUR - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (3, 'Les Secrets de l''Empereur', 'Zones interdites et mondes cachés abritant les projets les plus sombres de Palpatine.', 'region', 4) - RETURNING id INTO reg_id; - - -- ZONE : L''Espace Inconnu - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (3, reg_id, 'L''Espace Inconnu', 'Régions non cartographiées protégées par des anomalies spatiales, où l''Empire prépare son futur ou cache son passé.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (3, zone_id, 'Exegol', 'Monde de ténèbres éternelles et d''éclairs, Exegol est le bastion caché des Sith. Loin des regards de la galaxie, des cultistes et des ingénieurs y travaillent sur des technologies de clonage et des flottes de guerre secrètes pour assurer la pérennité de l''Ordre Sith. C''est un lieu où la mort n''est qu''un obstacle temporaire pour l''Empereur.', 'planet'), - (3, zone_id, 'Byss', 'Monde paradisiaque en apparence, Byss est en réalité une prison dorée imprégnée par le Côté Obscur. L''Empereur y a établi une retraite privée où il draine l''énergie vitale de la population pour prolonger sa propre existence. C''est un centre de recherches ésotériques et de sombres rituels, protégé par une sécurité impériale d''élite.', 'planet'), - (3, zone_id, 'Jakku', 'Désert de poussière sans intérêt apparent, Jakku cache une installation secrète de l''Observatoire de l''Empereur. Ce monde est destiné à devenir le point de rassemblement final pour le plan de contingence de Palpatine en cas de défaite, transformant ce désert en un gigantesque piège pour les flottes galactiques.', 'planet'); - -END $$; diff --git a/docker/supabase/volumes/db/init/06_atlas_new_republic.sql b/docker/supabase/volumes/db/init/06_atlas_new_republic.sql deleted file mode 100644 index 39c20f0..0000000 --- a/docker/supabase/volumes/db/init/06_atlas_new_republic.sql +++ /dev/null @@ -1,105 +0,0 @@ --- ================================================================================= --- SEED 05 : ATLAS GALACTIQUE - NOUVELLE RÉPUBLIQUE (REFONTE TOTALE) --- ================================================================================= - -DO $$ -DECLARE - reg_id INTEGER; - zone_id INTEGER; -BEGIN - -- ========================================== - -- 1. LE NOYAU RESTAURÉ (LA NOUVELLE DÉMOCRATIE) - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (4, 'Le Noyau Restauré', 'Le centre de la galaxie renaissante, où la Nouvelle République tente de rebâtir les fondations de la paix et de la justice.', 'region', 1) - RETURNING id INTO reg_id; - - -- ZONE : Sièges du Pouvoir - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (4, reg_id, 'Sièges du Pouvoir', 'Les centres politiques tournants de la Nouvelle République, symbolisant le retour de la démocratie.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (4, zone_id, 'Chandrila', 'Premier siège du Sénat de la Nouvelle République, Chandrila est le symbole de la victoire de la diplomatie sur la tyrannie. Sous ses paysages sereins et ses jardins suspendus, la planète vibre d''une activité politique intense. C''est ici que Mon Mothma et les leaders républicains ont posé les bases d''une nouvelle ère, privilégiant la démocratie décentralisée et la réduction des forces militaires.', 'planet'), - (4, zone_id, 'Hosnian Prime', 'Nouvelle capitale désignée de la République, Hosnian Prime est une métropole étincelante de verre et d''acier. Elle incarne l''ambition d''une galaxie unie et moderne, accueillant des délégués de milliers de mondes dans son immense rotonde sénatoriale. La sécurité y est assurée par une garde d''honneur républicaine, alors que la planète devient le cœur battant de la vie culturelle et politique galactique.', 'planet'), - (4, zone_id, 'Coruscant', 'Ancien centre impérial, Coruscant est en pleine reconstruction. Bien qu''elle ne soit plus la capitale officielle, la cité-monde reste un pôle financier et historique incontournable. Les stigmates de l''occupation impériale s''effacent lentement, remplacés par des projets de rénovation urbaine et le retour des libertés civiles. C''est un monde en transition, cherchant sa place dans une galaxie qui n''est plus centrée uniquement sur son dôme.', 'planet'); - - -- ZONE : Mondes Fondateurs Libérés - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (4, reg_id, 'Mondes Fondateurs Libérés', 'Anciens piliers de l''industrie impériale redevenus les moteurs économiques de la galaxie.', 'region', 2) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (4, zone_id, 'Kuat', 'Libérée de la poigne militaire de l''Empire, Kuat Drive Yards collabore désormais avec la Nouvelle République pour démanteler les restes de la marine impériale. Les chantiers produisent désormais des vaisseaux de transport et des croiseurs de défense, symbolisant la conversion de l''industrie de guerre vers une économie de paix. L''aristocratie de Kuat s''adapte avec prudence aux nouvelles régulations démocratiques.', 'planet'), - (4, zone_id, 'Corellia', 'Les chantiers navals corelliens ont retrouvé leur gloire marchande. La planète est redevenue le centre de l''innovation technologique pour les moteurs hyperspatiaux et les vaisseaux civils. L''esprit d''indépendance corellien, autrefois étouffé par l''Empire, fleurit à nouveau dans les spatioports et les cantinas, alors que la planète redevient la porte d''entrée principale vers les routes commerciales.', 'planet'); - - -- ========================================== - -- 2. LA BORDURE EN RECONSTRUCTION (L'ÂGE DE L'ESPOIR) - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (4, 'La Bordure en Reconstruction', 'Zones autrefois ravagées par la guerre civile, désormais engagées dans des programmes ambitieux de développement.', 'region', 2) - RETURNING id INTO reg_id; - - -- ZONE : Territoires Libérés - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (4, reg_id, 'Territoires Libérés', 'Mondes qui ont activement participé à la Rébellion et célèbrent aujourd''hui leur liberté retrouvée.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (4, zone_id, 'Naboo', 'Joyau culturel et bucolique, Naboo est l''un des piliers de la Nouvelle République en Bordure Médiane. La planète a pansé ses plaies et sert désormais de modèle pour l''intégration des arts et de la diplomatie dans la vie publique. Ses cités sont des havres de paix où les anciennes traditions royales coexistent avec une vision moderne de la coopération galactique.', 'planet'), - (4, zone_id, 'Lothal', 'Monde agraire qui fut le théâtre d''une résistance opiniâtre, Lothal est aujourd''hui en pleine renaissance industrielle. Ses plaines sont à nouveau verdoyantes, et la population célèbre les héros de sa libération. La Nouvelle République y a investi massivement pour en faire un centre de production alimentaire et technologique exemplaire pour les mondes de la bordure.', 'planet'), - (4, zone_id, 'Mon Cala', 'Bastion naval de la République, Mon Cala continue de fournir l''élite de la flotte de défense. Les Mon Calamaris ont ouvert leurs cités sous-marines au commerce galactique, tout en maintenant une vigilance accrue face aux derniers vestiges impériaux. La planète est un symbole de courage et de persévérance, dont les navires protègent désormais les nouvelles routes de la paix.', 'planet'); - - -- ZONE : Zones de Stabilité - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (4, reg_id, 'Zones de Stabilité', 'Secteurs sécurisés servant de points d''ancrage pour l''administration républicaine en expansion.', 'region', 2) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (4, zone_id, 'Onderon', 'Après des années de guerre civile et d''occupation, Onderon a retrouvé son unité sous une monarchie constitutionnelle alliée à la République. La cité d''Iziz est redevenue un pôle de stabilité, alors que les jungles environnantes sont lentement pacifiées. La planète sert de base de coordination pour les opérations de sécurité dans le secteur de l''Expansion.', 'planet'), - (4, zone_id, 'Thyferra', 'La production de Bacta est désormais supervisée par une commission républicaine pour garantir une distribution équitable. Les tensions entre les corporations locales se sont apaisées, laissant place à une prospérité partagée. Thyferra est devenue le centre médical de la galaxie, fournissant les ressources nécessaires pour soigner les millions de victimes de la guerre passée.', 'planet'); - - -- ========================================== - -- 3. LA BORDURE EXTÉRIEURE (LA NOUVELLE FRONTIÈRE) - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (4, 'La Bordure Extérieure', 'Régions sauvages où la Nouvelle République tente d''imposer l''ordre face aux seigneurs de guerre et aux cartels.', 'region', 3) - RETURNING id INTO reg_id; - - -- ZONE : Zones de Conflit des Vestiges - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (4, reg_id, 'Zones de Conflit des Vestiges', 'Territoires instables où les débris de l''Empire et les syndicats criminels luttent pour le contrôle.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (4, zone_id, 'Nevarro', 'Ancien repaire de chasseurs de primes, Nevarro est devenue une cité marchande florissante sous la gouvernance du Haut Magistrat Greef Karga. Malgré les tentatives des vestiges impériaux de reprendre le contrôle, la ville reste un bastion de liberté en Bordure Extérieure, symbole de la capacité des mondes de frontière à se réinventer loin de l''influence des grandes puissances.', 'planet'), - (4, zone_id, 'Jakku', 'Cimetière géant de vaisseaux impériaux et rebelles, Jakku est le domaine des ferrailleurs et des pillards d''épaves. La planète est un rappel constant de la violence de la guerre civile. Bien que désolée, ses débris cachent des technologies précieuses que la République tente de sécuriser avant qu''elles ne tombent entre de mauvaises mains.', 'planet'), - (4, zone_id, 'Tatooine', 'Toujours dominée par les cartels après la chute de Jabba, Tatooine reste un défi pour la Nouvelle République. Des marshalls isolés tentent d''y faire régner une justice précaire, alors que la planète redevient un carrefour pour les réfugiés et les opportunistes cherchant une nouvelle vie loin du Noyau.', 'planet'); - - -- ZONE : Mondes de Frontière - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (4, reg_id, 'Mondes de Frontière', 'Bastions de cultures fières et indépendantes cherchant leur voie dans la nouvelle galaxie.', 'region', 2) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (4, zone_id, 'Mandalore', 'En pleine reconstruction après des décennies de purge et d''occupation, Mandalore redevient le point de ralliement des clans dispersés. Les Mandaloriens travaillent à restaurer leur foyer ancestral et leur culture guerrière, tout en maintenant une neutralité vigilante vis-à-vis de la Nouvelle République. C''est un monde de résilience et de mystère.', 'planet'), - (4, zone_id, 'Eriadu', 'L''ancienne cité impériale tente de se transformer en centre industriel ouvert au commerce républicain. Bien que les traditions militaires y soient encore fortes, une nouvelle génération de leaders cherche à intégrer la planète dans l''économie galactique, espérant effacer son image de bastion de l''Ordre Nouveau.', 'planet'); - - -- ========================================== - -- 4. LES RÉGIONS DE L'OMBRE - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (4, 'Les Régions de l''Ombre', 'Zones reculées et mystérieuses où les secrets anciens et les menaces futures se cachent.', 'region', 4) - RETURNING id INTO reg_id; - - -- ZONE : Les Confins des Vestiges - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (4, reg_id, 'Les Confins des Vestiges', 'Mondes hantés par l''histoire des Jedi et les ombres résiduelles de l''Empire.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (4, zone_id, 'Ahch-To', 'Monde océanique oublié et refuge de Luke Skywalker, Ahch-To abrite les ruines du premier temple Jedi. La planète est un lieu de paix absolue et de connexion profonde avec la Force, protégé par son isolement total. Seuls quelques initiés connaissent son emplacement, en faisant un sanctuaire de sagesse ancienne dans une galaxie en mouvement.', 'planet'), - (4, zone_id, 'Exegol', 'Surveillé par des sondes républicaines, Exegol reste un monde de cauchemar. Les rumeurs de rituels Sith et de flottes cachées persistent, bien que la planète semble stérile et abandonnée. C''est un rappel sombre que le mal peut s''enraciner dans les ténèbres les plus profondes de l''Espace Inconnu, attendant son heure.', 'planet'), - (4, zone_id, 'Ajan Kloss', 'Monde forestier sauvage, Ajan Kloss sert de base d''entraînement secrète pour une nouvelle génération de voyageurs et de gardiens de la paix. Sous sa canopée dense, les idéaux de l''Alliance et les leçons des Jedi sont transmis, préparant la galaxie aux défis que le futur ne manquera pas de poser.', 'planet'); - -END $$; diff --git a/docker/supabase/volumes/db/init/07_fakes.sql b/docker/supabase/volumes/db/init/07_fakes.sql deleted file mode 100644 index 5a18d83..0000000 --- a/docker/supabase/volumes/db/init/07_fakes.sql +++ /dev/null @@ -1,88 +0,0 @@ --- ================================================================================= --- SEED 07 : UTILISATEURS ET PERSONNAGES FICTIFS (V3) --- ================================================================================= - --- 1. INSERTION DE GROUPES (FACTIONS PAR ÈRE UNIQUEMENT) -INSERT INTO public.groups (id, name, color, era, is_official) -VALUES --- Guerre des Clones (GDC) -('a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e21', 'République Galactique', '#3498db', 'GDC', true), -('a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e22', 'CSI', '#e67e22', 'GDC', true), -('a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e23', 'Ordre Jedi', '#2ecc71', 'GDC', true), -('a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e24', 'Cartel des Hutts', '#d35400', 'GDC', true), -('a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e25', 'Civils', '#7f8c8d', 'GDC', true), - --- Guerre Civile Galactique (GCG) -('a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e31', 'Alliance Rebelle', '#e74c3c', 'GCG', true), -('a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e32', 'Empire Galactique', '#95a5a6', 'GCG', true), -('a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e33', 'Inquisiteurs', '#c0392b', 'GCG', true), -('a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e34', 'Consortium de Zann', '#f1c40f', 'GCG', true), -('a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e35', 'Soleil Noir', '#8e44ad', 'GCG', true), - --- Nouvelle République (NR) -('a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e41', 'Nouvelle République', '#1abc9c', 'NR', true), -('a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e42', 'Premier Ordre', '#2c3e50', 'NR', true), -('a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e43', 'Ascendance Chiss', '#34495e', 'NR', true), -('a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e44', 'Syndicat Pyke', '#f39c12', 'NR', true), -('a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e45', 'Résistance', '#e67e22', 'NR', true); - --- 2. INSERTION D'UTILISATEURS FICTIFS (DANS AUTH.USERS) -INSERT INTO auth.users (id, email, raw_user_meta_data, created_at) -VALUES -('d1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e11', 'anakin@jedi.org', '{"username": "AnakinSky"}', NOW()), -('d1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e12', 'obiwan@jedi.org', '{"username": "BenKenobi"}', NOW()), -('d1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e13', 'ahsoka@jedi.org', '{"username": "Fulcrum"}', NOW()), -('d1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e14', 'rex@clone.army', '{"username": "CT-7567"}', NOW()), -('d1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e15', 'padme@senate.gov', '{"username": "Nabootiful"}', NOW()); - --- Update profiles created by trigger -UPDATE public.profiles SET role = 'moderator', last_seen = NOW() - INTERVAL '5 minutes' WHERE id = 'd1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e12'; -UPDATE public.profiles SET role = 'admin', last_seen = NOW() - INTERVAL '2 minutes' WHERE id = 'd1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e15'; -UPDATE public.profiles SET last_seen = NOW() - INTERVAL '10 minutes' WHERE id IN ('d1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e11', 'd1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e13', 'd1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e14'); - --- 3. INSERTION DE PERSONNAGES ET LIAISON AUX GROUPES -INSERT INTO public.characters (id, user_id, name, title, class, faction, main_group_id, era) -VALUES -('c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e11', 'd1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e11', 'Anakin Skywalker', 'Chevalier Jedi', 'Jedi', 'République Galactique', 'a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e23', 'GDC'), -('c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e12', 'd1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e12', 'Obi-Wan Kenobi', 'Maître Jedi', 'Jedi', 'République Galactique', 'a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e23', 'GDC'), -('c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e13', 'd1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e13', 'Ahsoka Tano', 'Padawan', 'Jedi', 'République Galactique', 'a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e23', 'GDC'), -('c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e14', 'd1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e14', 'Rex', 'Capitaine Clone', 'Soldat', 'Grande Armée de la République', 'a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e21', 'GDC'), -('c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e15', 'd1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e15', 'Padmé Amidala', 'Sénatrice', 'Politicien', 'République Galactique', 'a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e21', 'GDC'); - -UPDATE public.profiles SET active_character_id = 'c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e11' WHERE id = 'd1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e11'; -UPDATE public.profiles SET active_character_id = 'c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e12' WHERE id = 'd1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e12'; -UPDATE public.profiles SET active_character_id = 'c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e13' WHERE id = 'd1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e13'; -UPDATE public.profiles SET active_character_id = 'c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e14' WHERE id = 'd1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e14'; -UPDATE public.profiles SET active_character_id = 'c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e15' WHERE id = 'd1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e15'; - --- 4. MESSAGES FICTIFS -DO $$ -DECLARE - topic_id_1 INTEGER; - topic_id_2 INTEGER; - forum_annonces_id INTEGER; - forum_planet_id INTEGER; -BEGIN - -- Récupération dynamique des IDs - SELECT id INTO forum_annonces_id FROM public.forums WHERE name = 'Annonces' LIMIT 1; - -- On cherche un forum de type planète pour le second sujet - SELECT id INTO forum_planet_id FROM public.forums WHERE type = 'planet' LIMIT 1; - - IF forum_annonces_id IS NOT NULL THEN - INSERT INTO public.topics (forum_id, author_id, title) - VALUES (forum_annonces_id, 'd1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e15', 'Bienvenue sur SWOR v2 !') - RETURNING id INTO topic_id_1; - - INSERT INTO public.posts (topic_id, author_id, content) - VALUES (topic_id_1, 'd1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e15', 'C''est avec une grande joie que nous ouvrons les portes de cette nouvelle galaxie.'); - END IF; - - IF forum_planet_id IS NOT NULL THEN - INSERT INTO public.topics (forum_id, author_id, title) - VALUES (forum_planet_id, 'd1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e11', 'C''est quoi le plan pour la bordure ?') - RETURNING id INTO topic_id_2; - - INSERT INTO public.posts (topic_id, author_id, content) - VALUES (topic_id_2, 'd1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e11', 'On se fait harceler par les droïdes sur Saleucami, on a besoin de renforts.'); - END IF; -END $$; diff --git a/docker/supabase/volumes/db/init/08_ai_members.sql b/docker/supabase/volumes/db/init/08_ai_members.sql deleted file mode 100644 index 453ace7..0000000 --- a/docker/supabase/volumes/db/init/08_ai_members.sql +++ /dev/null @@ -1,51 +0,0 @@ --- ================================================================================= --- SEED 08 : MEMBRES IA ET PERSONNAGES --- ================================================================================= - --- 1. INSERTION DES UTILISATEURS (AUTH.USERS) -INSERT INTO auth.users (id, email, raw_user_meta_data, created_at) -VALUES -('e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e01', 'valkyrie@swor.ai', '{"username": "DarthValkyrie"}', NOW()), -('e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e02', 'starpilot@swor.ai', '{"username": "StarPilot88"}', NOW()), -('e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e03', 'amidala@swor.ai', '{"username": "SenatorAmidala"}', NOW()), -('e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e04', 'sithlord@swor.ai', '{"username": "SithLord99"}', NOW()), -('e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e05', 'rebelscum@swor.ai', '{"username": "RebelScum"}', NOW()), -('e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e06', 'commander@swor.ai', '{"username": "CloneCommander"}', NOW()); - --- Les profils sont créés automatiquement par le trigger handle_new_user() --- On met à jour les rôles si besoin -UPDATE public.profiles SET role = 'moderator' WHERE id = 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e01'; - --- 2. INSERTION DES PERSONNAGES -INSERT INTO public.characters (id, user_id, name, title, class, faction, main_group_id, era, species) -VALUES --- DarthValkyrie -('c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e01', 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e01', 'Lyra Vance', 'Chevalier Jedi', 'Jedi', 'Nouvelle République', 'a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e41', 'NR', 'Humain'), -('c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e02', 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e01', 'Vaxen Sol', 'Chasseur de Primes', 'Mercenaire', 'Indépendant', NULL, 'GCG', 'Zabrak'), - --- StarPilot88 -('c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e03', 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e02', 'Jaxen Rek', 'Contrebandier', 'Pilote', 'Indépendant', 'a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e34', 'GCG', 'Humain'), - --- SenatorAmidala -('c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e04', 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e03', 'Elara Tyree', 'Sénatrice', 'Politicien', 'Nouvelle République', 'a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e41', 'NR', 'Humain'), - --- SithLord99 -('c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e05', 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e04', 'Malakor', 'Acolyte Sith', 'Sith', 'Empire Galactique', 'a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e33', 'GCG', 'Sith pur-sang'), -('c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e06', 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e04', 'Capitaine Hax', 'Officier Impérial', 'Militaire', 'Empire Galactique', 'a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e32', 'GCG', 'Humain'), - --- RebelScum -('c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e07', 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e05', 'Garret Thorne', 'Éclaireur', 'Soldat', 'Alliance Rebelle', 'a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e31', 'GCG', 'Humain'), -('c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e08', 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e05', 'Sela Sun', 'Mécanicienne', 'Ingénieur', 'Alliance Rebelle', 'a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e31', 'GCG', 'Twi''lek'), - --- CloneCommander -('c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e09', 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e06', 'Blade', 'Commandant Clone', 'Soldat', 'République Galactique', 'a1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e21', 'GDC', 'Humain (Clone)'); - --- On assigne les personnages actifs -UPDATE public.profiles SET active_character_id = 'c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e01' WHERE id = 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e01'; -UPDATE public.profiles SET active_character_id = 'c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e03' WHERE id = 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e02'; -UPDATE public.profiles SET active_character_id = 'c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e04' WHERE id = 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e03'; -UPDATE public.profiles SET active_character_id = 'c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e05' WHERE id = 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e04'; -UPDATE public.profiles SET active_character_id = 'c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e07' WHERE id = 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e05'; -UPDATE public.profiles SET active_character_id = 'c1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e09' WHERE id = 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e06'; - - diff --git a/docs/LARAVEL.md b/docs/LARAVEL.md index 7cfa6c5..86cb74d 100644 --- a/docs/LARAVEL.md +++ b/docs/LARAVEL.md @@ -2,13 +2,13 @@ Backend Laravel dans **`api/`**. Le front joueur est dans **`front/`** (Next.js). -Voir [adr/0002-frontend-api-separes.md](adr/0002-frontend-api-separes.md) pour l’architecture cible. +Voir [adr/0002-frontend-api-separes.md](adr/0002-frontend-api-separes.md) pour l'architecture cible. ## Prérequis - PHP 8.2+ et [Composer](https://getcomposer.org/) - Node.js 20+ (voir `.nvmrc`) -- PostgreSQL accessible (via `docker:supabase:up` ou instance locale) +- Docker (pour PostgreSQL) ## Installation @@ -16,9 +16,9 @@ Voir [adr/0002-frontend-api-separes.md](adr/0002-frontend-api-separes.md) pour l npm run setup ``` -Installe les dépendances Composer (`api/`), npm (racine + workspaces) et copie les fichiers `.env` d’exemple. +Installe les dépendances Composer (`api/`), npm (racine + front) et copie les fichiers `.env` d'exemple. -Générer la clé d’application si besoin : +Générer la clé d'application si besoin : ```bash cd api && php artisan key:generate @@ -26,19 +26,16 @@ cd api && php artisan key:generate ## Base de données -Par défaut, `api/.env.example` pointe vers une base **`swor`** dédiée sur le Postgres Docker (port `54322`), **distincte** du schéma Supabase existant sur la base `postgres`. +Postgres tourne dans Docker (base **`swor`**, port `54322`) : ```bash -# Créer la base (via Docker Supabase) -docker compose -f docker/supabase/docker-compose.yml exec db psql -U postgres -c "CREATE DATABASE swor;" - -npm run docker:supabase:up +npm run docker:up cd api && php artisan migrate:fresh --seed ``` -## Lancer l’API +## Lancer l'API -Terminal unique (serveur PHP + queue + logs + Vite Inertia legacy) : +Terminal unique (serveur PHP + queue + logs) : ```bash npm run dev:api @@ -60,6 +57,23 @@ Endpoints : `http://localhost:8000/api/v1/...` - Variables `api/.env` : `FRONTEND_URL`, `SANCTUM_STATEFUL_DOMAINS`, `SESSION_DOMAIN` - Front : `NEXT_PUBLIC_API_URL=http://localhost:8000` dans `front/.env.local` +### API de jeu + +Le front consomme exclusivement l'API Laravel (`front/src/shared/utils/api.ts`) : + +| Domaine | Endpoints principaux | +|---------|----------------------| +| Forum | `GET /forum/categories`, `GET /forums`, `GET /forums/{id}`, `GET /topics/{id}`, `POST /forums/{id}/topics`, `POST /topics/{id}/posts`, `POST /topics/{id}/views` | +| Portail / stats | `GET /stats`, `GET /portal`, `GET /staff`, `GET /online-users` | +| Profils | `GET /profiles/{id}`, `GET /profiles/{id}/characters`, `GET /me`, `PATCH /me/profile`, `PUT /me/active-character`, `POST /me/heartbeat` | +| Personnages | `GET/POST/PATCH /characters…`, `/inventory`, `/ship`, `/economy` | +| Factions | `GET /groups`, `GET /groups/{id}` | +| Admin | `POST/PATCH/DELETE /forums…`, `POST /uploads` (gate `admin`) | + +Les compteurs de forums (`topics_count`, `posts_count`, `last_post_id`) sont +agrégés récursivement sur les ancêtres à chaque nouveau message +(`App\Services\ForumActivity`). + ## Lancer le front joueur Dans un second terminal : @@ -68,8 +82,6 @@ Dans un second terminal : npm run dev:front # front/ sur :3000 ``` -Le front consomme l’API Laravel (Sanctum) pour l’authentification (#32). Les autres domaines (forum, profil…) restent sur Supabase jusqu’aux issues suivantes. - ## Back-office Filament arrive en #39 sur `/admin` (même app Laravel dans `api/`). @@ -78,8 +90,8 @@ Filament arrive en #39 sur `/admin` (même app Laravel dans `api/`). ```bash cd api && ./vendor/bin/pint # Format PHP -cd api && php artisan test # PHPUnit / Pest -npm run lint # ESLint (front/) +cd api && php artisan test # PHPUnit +npm run lint # TypeScript (front/) ``` ## Structure @@ -87,26 +99,18 @@ npm run lint # ESLint (front/) ``` api/ ├── app/ -│ ├── Http/Controllers/Api/ +│ ├── Http/Controllers/Api/V1/ # Auth, Forum, Characters, Groups, Stats… │ ├── Models/ -│ └── Policies/ +│ └── Services/ ├── routes/ │ ├── api.php # JSON pour front/ -│ └── web.php # Filament, healthcheck +│ └── web.php # Redirection racine, vérification email ├── database/ -├── public/ +│ ├── migrations/ # Schéma canonique +│ └── seeders/ # Données de démo (catégories, atlas, forums HRP) └── composer.json front/ # Next.js — front joueur ``` -## Legacy (dans api/) - -- **`api/resources/js/`** — squelette Inertia (#30), provisoire ; retiré en #41 -- **`back/`** — back-office Next.js, remplacé par Filament (#39) - -```bash -npm run dev:back # back/ sur :3001 (legacy) -``` - Voir [WORKFLOW.md](WORKFLOW.md), [adr/0001-migration-laravel.md](adr/0001-migration-laravel.md) et [adr/0002-frontend-api-separes.md](adr/0002-frontend-api-separes.md). diff --git a/docs/data-model/README.md b/docs/data-model/README.md index 2e33ba8..fa380e8 100644 --- a/docs/data-model/README.md +++ b/docs/data-model/README.md @@ -2,8 +2,8 @@ Documentation métier du schéma Postgres. Complète le DDL SQL (source technique) par les règles, relations et choix de conception. -**Source canonique SQL :** `docker/supabase/volumes/db/init/01_core_schema.sql` -**Seeds de contenu :** `supabase/seeds/` et `docker/supabase/volumes/db/init/` +**Source canonique :** `api/database/migrations/` (migrations Laravel) +**Seeds de contenu :** `api/database/seeders/` ## Vue d'ensemble diff --git a/front/Dockerfile b/front/Dockerfile deleted file mode 100644 index a697c34..0000000 --- a/front/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM node:20-alpine - -WORKDIR /app - -COPY package*.json ./ -RUN npm install - -COPY . . - -EXPOSE 3000 - -CMD ["npm", "run", "dev"] - - diff --git a/front/Dockerfile.dev b/front/Dockerfile.dev deleted file mode 100644 index 430c8af..0000000 --- a/front/Dockerfile.dev +++ /dev/null @@ -1,12 +0,0 @@ -FROM node:20-alpine - -WORKDIR /app - -COPY package*.json ./ -RUN npm install - -COPY . . - -EXPOSE 3000 - -CMD ["npm", "run", "dev"] diff --git a/front/Dockerfile.prod b/front/Dockerfile.prod index 50ef395..39d930f 100644 --- a/front/Dockerfile.prod +++ b/front/Dockerfile.prod @@ -15,10 +15,8 @@ COPY front ./front WORKDIR /app/front -ARG NEXT_PUBLIC_SUPABASE_URL -ARG NEXT_PUBLIC_SUPABASE_ANON_KEY -ENV NEXT_PUBLIC_SUPABASE_URL=$NEXT_PUBLIC_SUPABASE_URL -ENV NEXT_PUBLIC_SUPABASE_ANON_KEY=$NEXT_PUBLIC_SUPABASE_ANON_KEY +ARG NEXT_PUBLIC_API_URL +ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL ENV NEXT_TELEMETRY_DISABLED=1 RUN npm run build diff --git a/front/env.local.example b/front/env.local.example index 01a87d3..600de8d 100644 --- a/front/env.local.example +++ b/front/env.local.example @@ -1,7 +1 @@ -# Configuration locale — front Next.js (voir docs/adr/0002-frontend-api-separes.md) NEXT_PUBLIC_API_URL=http://localhost:8000 - -# Legacy Supabase (autres pages non encore migrées) -NEXT_PUBLIC_SUPABASE_URL=http://localhost:54321 -NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InN3b3ItdjIiLCJyb2xlIjoiYW5vbiIsImlhdCI6MTYwMDAwMDAwMCwiZXhwIjoyMDAwMDAwMDAwfQ.JnVRDEmswItlC2o1FKLYYtg12VISdkh0-uLNfFBD3_c -SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InN3b3ItdjIiLCJyb2xlIjoic2VydmljZV9yb2xlIiwiaWF0IjoxNjAwMDAwMDAwLCJleHAiOjIwMDAwMDAwMDB9.fxcGWkk1UcFsQ_gYN0Slxk39U9EtgzGMIy1DQ1Lp0U0 diff --git a/front/metadata.json b/front/metadata.json deleted file mode 100644 index e110aa8..0000000 --- a/front/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Star Wars Roleplay Forum", - "description": "A visual prototype for a Star Wars roleplaying forum, showcasing its structure, factions, and key informational pages with a black and gold theme.", - "requestFramePermissions": [] -} \ No newline at end of file diff --git a/front/package.json b/front/package.json index 15398f8..c1b2abd 100644 --- a/front/package.json +++ b/front/package.json @@ -7,22 +7,13 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "tsc --noEmit", - "simulate": "tsx scripts/simulate-interactions.ts", - "simulate:watch": "tsx scripts/start-simulation.ts" + "lint": "tsc --noEmit" }, "dependencies": { - "@google/generative-ai": "^0.24.1", - "@supabase/ssr": "^0.8.0", - "@supabase/supabase-js": "^2.39.0", "@tailwindcss/postcss": "latest", - "axios": "^1.13.2", - "cheerio": "^1.1.2", "clsx": "latest", - "dotenv": "^17.2.3", "lucide-react": "latest", "next": "latest", - "openai": "^6.15.0", "react": "latest", "react-dom": "latest", "react-markdown": "^10.1.0", @@ -36,7 +27,6 @@ "@types/react-dom": "latest", "autoprefixer": "latest", "postcss": "latest", - "tsx": "^4.19.2", "typescript": "~5.8.2" } } diff --git a/front/scripts/clean-descriptions.ts b/front/scripts/clean-descriptions.ts deleted file mode 100644 index f8cb9c2..0000000 --- a/front/scripts/clean-descriptions.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { createClient } from '@supabase/supabase-js'; -import dotenv from 'dotenv'; -import { fileURLToPath } from 'url'; -import { dirname, resolve } from 'path'; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); -dotenv.config({ path: resolve(__dirname, '../.env.local') }); - -const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL; -const supabaseServiceKey = process.env.SUPABASE_SERVICE_ROLE_KEY; - -if (!supabaseUrl || !supabaseServiceKey) { - console.error('Erreur: NEXT_PUBLIC_SUPABASE_URL et SUPABASE_SERVICE_ROLE_KEY doivent être définis dans .env.local'); - process.exit(1); -} - -const supabase = createClient(supabaseUrl, supabaseServiceKey); - -async function cleanDescriptions() { - console.log('🧹 Nettoyage des descriptions (retrait des images Markdown)...'); - - const { data: forums, error } = await supabase - .from('forums') - .select('id, name, description') - .ilike('description', '%![%]%'); // Chercher les patterns d'images Markdown - - if (error) { - console.error('Erreur lors de la récupération:', error); - return; - } - - if (!forums || forums.length === 0) { - console.log('Aucune description à nettoyer.'); - return; - } - - console.log(`${forums.length} forums à nettoyer.`); - - for (const forum of forums) { - if (!forum.description) continue; - - // Supprimer le pattern ![Nom](URL) au début ou n'importe où - const cleanedDescription = forum.description.replace(/!\[.*?\]\(.*?\)\n*/g, '').trim(); - - if (cleanedDescription !== forum.description.trim()) { - console.log(`✅ Nettoyage pour ${forum.name}`); - const { error: updateError } = await supabase - .from('forums') - .update({ description: cleanedDescription }) - .eq('id', forum.id); - - if (updateError) console.error(`Erreur update ${forum.name}:`, updateError); - } - } - - console.log('✨ Nettoyage terminé !'); -} - -cleanDescriptions(); - - diff --git a/front/scripts/simulate-interactions.ts b/front/scripts/simulate-interactions.ts deleted file mode 100644 index cf47d24..0000000 --- a/front/scripts/simulate-interactions.ts +++ /dev/null @@ -1,393 +0,0 @@ -import { createClient } from '@supabase/supabase-js'; -import OpenAI from 'openai'; -import dotenv from 'dotenv'; -import { GoogleGenerativeAI } from '@google/generative-ai'; -import path from 'path'; -import { fileURLToPath } from 'url'; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); - -dotenv.config({ path: path.resolve(__dirname, '../.env.local') }); - -const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL; -const supabaseServiceKey = process.env.SUPABASE_SERVICE_ROLE_KEY; - -if (!supabaseUrl || !supabaseServiceKey) { - console.error('Missing Supabase environment variables'); - process.exit(1); -} - -const supabase = createClient(supabaseUrl, supabaseServiceKey, { - auth: { - persistSession: false, - autoRefreshToken: false, - detectSessionInUrl: false - } -}); - -// Initialisation de l'IA (priorité à OpenAI, sinon Gemini) -let aiProvider: 'openai' | 'gemini' | 'mock' = 'mock'; -let openai: OpenAI | null = null; -let gemini: any = null; - -if (process.env.OPENAI_API_KEY) { - openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY }); - aiProvider = 'openai'; -} else if (process.env.GEMINI_API_KEY) { - const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY); - gemini = genAI.getGenerativeModel({ model: 'gemini-pro' }); - aiProvider = 'gemini'; -} - -// Configuration des ères et catégories -const ERA_MAPPING: Record = { - 'CLONE_WARS': 'Old Republic', - 'GDC': 'Old Republic', - 'GCG': 'Galactic Empire', - 'NEW_REPUBLIC': 'New Republic', - 'NR': 'New Republic' -}; - -const HRP_CATEGORY_IDS = [1, 5]; // Holonews et Social - -const AI_MEMBERS_IDS = [ - 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e01', - 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e02', - 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e03', - 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e04', - 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e05', - 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e06' -]; - -// Types de forums autorisés pour le RP -const RP_FORUM_TYPES = ['region', 'sector', 'planet', 'location', 'forum']; - -const AI_MEMBER_PERSONALITIES: Record = { - 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e01': 'Tu es un vétéran du RP (depuis 2002). Ton style est littéraire, avec beaucoup de vocabulaire. Tu détestes le "SMS", les fautes et le manque de cohérence. Tu es souvent sur le forum Holonews pour critiquer ou valider les annonces du staff.', - 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e02': 'Tu es un joueur "action-first". Tu aimes les combats spatiaux et les duels. En HRP, tu es très sympa mais tu ne lis jamais les longs pavés. Tu réponds souvent par des phrases courtes et encourageantes.', - 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e03': 'Tu es une fan inconditionnelle de Padmé et de la politique galactique. Tu adores débattre des heures sur le lore et tu es très active dans le forum "Suggestions" pour proposer des idées de scénarios complexes.', - 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e04': 'Tu joues exclusivement des Sith ou des impériaux cruels. En HRP, tu es très respectueux mais un peu distant. Tu aimes corriger les autres sur les points de lore technique (modèles de vaisseaux, grades impériaux).', - 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e05': 'Tu es l\'âme du forum Social. Tu lances souvent des jeux débiles ou des sondages sur les films. En RP, tu joues des personnages marginaux (contrebandiers, ferrailleurs) avec beaucoup d\'humour.', - 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e06': 'Tu es un passionné de l\'ère Clone Wars. Tu connais tous les numéros de matricule des clones. Ton style est direct, efficace, et tu es très protecteur envers les nouveaux joueurs qui débarquent.' -}; - -async function generateContent(prompt: string, memberId: string, isHRP: boolean = false): Promise { - const personality = AI_MEMBER_PERSONALITIES[memberId] || ''; - const systemPrompt = isHRP - ? `Tu es un membre d'une communauté Star Wars en 2005. ${personality} Tu as un comportement très humain : tu n'utilises quasiment JAMAIS d'emojis, tu peux faire quelques fautes de frappe légères, et tu as un ton typique des anciens forums. Tu écris en français.` - : `Tu es un rôliste de Star Wars en 2005 (style Forumactif/phpBB). ${personality} Ton style est narratif et immersif. Tu ne mets JAMAIS d'emojis dans tes messages RP. Tu écris en français.`; - - if (aiProvider === 'openai' && openai) { - const response = await openai.chat.completions.create({ - model: 'gpt-4o-mini', - messages: [{ role: 'system', content: systemPrompt }, { role: 'user', content: prompt }], - }); - return response.choices[0].message.content || ''; - } else if (aiProvider === 'gemini' && gemini) { - const result = await gemini.generateContent(`${systemPrompt}\n\n${prompt}`); - const response = await result.response; - return response.text(); - } - return isHRP ? "Salut, content d'être là." : "Contenu simulé. [RP intensif]"; -} - -async function handleNewTopic(character: any, forum: any, isRP: boolean, memberId: string) { - // Récupérer les sujets existants pour éviter les doublons - const { data: existingTopics } = await supabase - .from('topics') - .select('title') - .eq('forum_id', forum.id) - .limit(10); - - const existingTitles = existingTopics?.map(t => t.title).join(', ') || 'aucun'; - - // Détection automatique du type de contenu basé sur le forum - let effectiveIsRP = isRP; - const forumNameLower = forum.name.toLowerCase(); - const isIntroForum = forumNameLower.includes('présentation'); - const isSuggestionForum = forumNameLower.includes('suggestion'); - const isNewsForum = forumNameLower.includes('annonce') || forumNameLower.includes('holonews'); - const isDiscussionForum = forumNameLower.includes('discussions') || forumNameLower.includes('social'); - - if (isIntroForum || isSuggestionForum || isNewsForum || isDiscussionForum) { - effectiveIsRP = false; - } - - let prompt = ''; - if (effectiveIsRP) { - prompt = `Tu es en train d'ouvrir un nouveau sujet de RP (Roleplay). - Lieu : ${forum.name} (${forum.description}). - Ère : ${character.era} (${ERA_MAPPING[character.era] || character.era}). - Personnage : ${character.name}, un ${character.species} ${character.class} de la faction ${character.faction}. - Sujets déjà présents ici : ${existingTitles}. - - CONSIGNES DE RÉCIT (STYLE 2005) : - 1. Ne copie pas les sujets existants. Trouve une raison unique pour laquelle ton personnage est ici. - 2. Décris l'arrivée de ton personnage, l'ambiance, les sons, les odeurs. Sois immersif. - 3. Ton message doit se terminer par une "ouverture" (ton perso attend quelqu'un, observe la foule, ou s'apprête à faire quelque chose). - 4. Pas d'emojis. Pas de gras/italique excessif. - 5. Titre : Doit être poétique ou intrigant (ex: "L'ombre des sables", "Un verre de trop à Mos Eisley"). - Format de réponse: "TITRE: [Le titre]\nCONTENU: [Le récit]"`; - } else { - let contextSpecific = ''; - if (isIntroForum) contextSpecific = "C'est ta présentation. Parle de comment tu as découvert le forum, ton passif de rôliste, et ton amour pour Star Wars. Ne parle pas de ton perso en tant que tel, mais de toi le joueur."; - else if (isSuggestionForum) contextSpecific = "Propose une idée concrète (nouveau système de combat, ajout d'une planète, changement de design). Sois passionné mais constructif."; - else if (isDiscussionForum) contextSpecific = "Lance un débat sur un point précis : ton perso préféré dans la prélogie, ton avis sur le dernier jeu sorti, ou une question sur le lore."; - else contextSpecific = "Discute de l'actualité du forum ou de Star Wars en général."; - - prompt = `Tu ouvres un nouveau sujet HRP (Hors-RP). - Forum : ${forum.name} (${forum.description}). - Sujets déjà présents : ${existingTitles}. - - CONTEXTE : ${contextSpecific} - - CONSIGNES D'UTILISATEUR (STYLE 2005) : - 1. Titre accrocheur, typique d'un forum (ex: "[News] Votre avis ?", "Hello la compagnie !", "Idée pour le système de dés"). - 2. Comporte-toi comme un membre qui veut lancer une vraie discussion. - 3. Utilise un ton de "pote de forum". Pas de politesse d'IA. - 4. Un seul emoji maximum :) - Format de réponse: "TITRE: [Le titre]\nCONTENU: [Le message]"`; - } - - console.log(`Génération du contenu (${effectiveIsRP ? 'RP' : 'HRP'} nouveau sujet sur ${forum.name})...`); - const rawContent = await generateContent(prompt, memberId, !effectiveIsRP); - const title = rawContent.match(/TITRE: (.*)/)?.[1] || `Sujet de ${character.name}`; - const content = rawContent.split('CONTENU:')[1]?.trim() || rawContent; - - const { data: topic, error: topicError } = await supabase - .from('topics') - .insert({ - forum_id: forum.id, - author_id: memberId, - character_id: effectiveIsRP ? character.id : null, - title: title - }) - .select() - .single(); - - if (topicError) throw topicError; - - await supabase.from('posts').insert({ - topic_id: topic.id, - author_id: memberId, - character_id: effectiveIsRP ? character.id : null, - content: content - }); - - console.log(`Succès: Nouveau sujet "${title}" créé sur ${forum.name}`); -} - -async function simulateOne() { - try { - // 1. Choisir un membre AI aléatoire avec des poids d'activité - const memberWeights: Record = { - 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e01': 1, - 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e02': 2, // Plus actif - 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e03': 1, - 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e04': 0.5, // Moins actif - 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e05': 1.5, - 'e1e57c6a-6f1e-4b9e-9e1e-1e1e1e1e1e06': 1 - }; - - const weightedMembers = AI_MEMBERS_IDS.flatMap(id => Array(Math.ceil((memberWeights[id] || 1) * 2)).fill(id)); - const memberId = weightedMembers[Math.floor(Math.random() * weightedMembers.length)]; - - const { data: characters, error: charError } = await supabase - .from('characters') - .select('*') - .eq('user_id', memberId); - - if (charError) throw charError; - if (!characters || characters.length === 0) return; - - const character = characters[Math.floor(Math.random() * characters.length)]; - - // 2. Décider RP vs HRP (70% RP, 30% HRP) - const isRP = Math.random() < 0.7; - - // 3. Décider de l'action : 15% nouveau sujet, 75% réponse, 10% chat - const actionRand = Math.random(); - const actionType = actionRand < 0.15 ? 'NEW_TOPIC' : actionRand < 0.90 ? 'REPLY' : 'CHAT'; - - if (actionType === 'CHAT') { - const prompt = `Poste un message très court dans la chatbox (HRP). - Utilisateur : ${character.name}. - - CONTEXTE (STYLE 2005) : - - Tu viens de te connecter ou tu traînes sur le forum. - - Tu peux saluer tout le monde, demander si quelqu'un veut RP, commenter une news Star Wars récente, ou juste faire une remarque de "pote". - - Exemples : "Yop tout le monde !", "Quelqu'un pour un RP sur Coruscant ?", "Vous avez vu le trailer de la saison 3 ?", "Je go manger, à toute". - - CONSIGNES : - 1. TRÈS COURT (une phrase max). - 2. Pas de majuscules excessives, pas d'emojis complexes. - 3. Ton de chat : rapide, spontané. - Génère uniquement le message.`; - - console.log(`Génération d'un message de chat pour ${character.name}...`); - const text = await generateContent(prompt, memberId, true); - - await supabase.from('chat_messages').insert({ - user_id: memberId, - character_id: character.id, - text: text - }); - console.log(`Chat posté: "${text.substring(0, 50)}..."`); - return; - } - - if (actionType === 'NEW_TOPIC') { - let forum; - if (isRP) { - const targetEra = ERA_MAPPING[character.era] || character.era; - const { data: forums } = await supabase - .from('forums') - .select('id, name, description, forum_categories!inner(era)') - .eq('forum_categories.era', targetEra) - .in('type', RP_FORUM_TYPES) - .limit(20); - forum = forums?.[Math.floor(Math.random() * (forums?.length || 0))]; - } else { - const { data: forums } = await supabase - .from('forums') - .select('id, name, description') - .in('category_id', HRP_CATEGORY_IDS) - .limit(10); - forum = forums?.[Math.floor(Math.random() * (forums?.length || 0))]; - } - - if (forum) await handleNewTopic(character, forum, isRP, memberId); - - } else { - let query = supabase.from('topics').select('id, title, forum_id, forums!inner(category_id, forum_categories!inner(id, era))'); - if (isRP) { - const targetEra = ERA_MAPPING[character.era] || character.era; - query = query.eq('forums.forum_categories.era', targetEra); - } else { - query = query.in('forums.forum_categories.id', HRP_CATEGORY_IDS); - } - - const { data: topics } = await query.order('updated_at', { ascending: false }).limit(20); - - if (!topics || topics.length === 0) { - console.log(`Aucun sujet trouvé pour répondre (${isRP ? 'RP' : 'HRP'}). Repli sur la création...`); - let forum; - if (isRP) { - const targetEra = ERA_MAPPING[character.era] || character.era; - const { data: forums, error: fallbackError } = await supabase - .from('forums') - .select('id, name, description, forum_categories!inner(era)') - .eq('forum_categories.era', targetEra) - .limit(50); - - if (fallbackError) console.error('Erreur fallback RP:', fallbackError); - if (forums && forums.length > 0) { - forum = forums[Math.floor(Math.random() * forums.length)]; - } else { - console.log(`Aucun forum trouvé pour l'ère ${targetEra}`); - } - } else { - const { data: forums, error: fallbackError } = await supabase - .from('forums') - .select('id, name, description') - .in('category_id', HRP_CATEGORY_IDS) - .limit(10); - - if (fallbackError) console.error('Erreur fallback HRP:', fallbackError); - if (forums && forums.length > 0) { - forum = forums[Math.floor(Math.random() * forums.length)]; - } - } - if (forum) { - await handleNewTopic(character, forum, isRP, memberId); - } else { - console.log('Échec du repli : aucun forum approprié trouvé.'); - } - return; - } - - const topic = topics[Math.floor(Math.random() * topics.length)]; - console.log(`Réponse pour ${character.name} (${isRP ? 'RP' : 'HRP'}) sur le sujet "${topic.title}"`); - - const { data: lastPosts } = await supabase - .from('posts') - .select('content, author_id, characters(name)') - .eq('topic_id', topic.id) - .order('created_at', { ascending: false }) - .limit(10); - - // Vérifier si le dernier message est déjà de ce membre - if (lastPosts && lastPosts.length > 0 && lastPosts[0].author_id === memberId) { - console.log(`Le membre ${memberId} a déjà posté le dernier message dans "${topic.title}". Passage.`); - return; - } - - const context = (lastPosts || []).slice().reverse().map(p => `${(p as any).characters?.name || 'Inconnu'}: ${p.content}`).join('\n\n') || ''; - - const prompt = isRP - ? `Tu réponds à un sujet de RP (Roleplay) en cours. - Sujet : ${topic.title} - Ton Personnage : ${character.name} (${character.species}, ${character.class}, ${character.faction}). - - DERNIERS MESSAGES (Lis attentivement pour réagir) : - ${context} - - CONSIGNES DE RÉPONSE (STYLE 2005) : - 1. Ta réponse DOIT être la suite directe de la situation. Si quelqu'un a parlé à ton personnage, réponds-lui. - 2. Mentionne le nom des autres personnages présents si ton personnage interagit avec eux. - 3. Décris tes actions physiques, tes dialogues et tes pensées. - 4. Garde la cohérence : ne te téléporte pas, ne fais pas de "Powerplay" (agir à la place des autres). - 5. Pas d'emojis. Pas de "hors-sujet". - Génère uniquement le contenu du message de réponse.` - : `Tu réponds à une discussion HRP (Hors-RP). - Sujet : ${topic.title} - Ton pseudonyme : (celui lié à ta personnalité). - - HISTORIQUE DE LA DISCUSSION : - ${context} - - CONSIGNES D'UTILISATEUR (STYLE 2005) : - 1. Rebondis sur ce qui a été dit. Si quelqu'un a posé une question, essaie d'y répondre ou donne ton avis. - 2. Utilise un ton de forum : "Je suis d'accord avec [Nom du perso]", "Perso je pense que...", "Mdr non c'est pas ça". - 3. Ne sois pas une IA : sois passionné, parfois un peu têtu, ou très enthousiaste. - 4. Un seul emoji :) ou ;) maximum. - Génère uniquement le contenu du message.`; - - console.log(`Génération d'une réponse pour le sujet "${topic.title}"...`); - const content = await generateContent(prompt, memberId, !isRP); - const { error: postError } = await supabase.from('posts').insert({ - topic_id: topic.id, - author_id: memberId, - character_id: isRP ? character.id : null, - content: content - }); - - if (postError) throw postError; - console.log(`Succès: Réponse postée dans "${topic.title}"`); - } - } catch (err) { - console.error('Erreur lors de la simulation:', err); - } -} - -async function simulate() { - console.log('--- Démarrage de la simulation d\'interaction AI ---'); - const args = process.argv.slice(2); - let count = 1; - if (args.includes('--count')) { - const idx = args.indexOf('--count'); - count = parseInt(args[idx + 1]) || 1; - } else if (args.includes('--all-members')) { - count = AI_MEMBERS_IDS.length; - } - - console.log(`Exécution de ${count} interaction(s)...`); - for (let i = 0; i < count; i++) { - console.log(`\n--- Interaction ${i + 1}/${count} ---`); - await simulateOne(); - } - console.log('\n--- Simulation terminée avec succès ---'); -} - -simulate().catch(console.error); diff --git a/front/scripts/start-simulation.ts b/front/scripts/start-simulation.ts deleted file mode 100644 index 02f261b..0000000 --- a/front/scripts/start-simulation.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { exec } from 'child_process'; -import { promisify } from 'util'; - -const execAsync = promisify(exec); - -const MIN_INTERVAL = 5 * 60 * 1000; // 5 minutes -const MAX_INTERVAL = 30 * 60 * 1000; // 30 minutes - -async function runSimulation() { - const args = process.argv.slice(2); - const countFlag = args.includes('--count') ? `--count ${args[args.indexOf('--count') + 1]}` : ''; - const allFlag = args.includes('--all-members') ? '--all-members' : ''; - - console.log(`[${new Date().toISOString()}] Lancement d'une interaction...`); - try { - const { stdout, stderr } = await execAsync(`npm run simulate -- ${countFlag} ${allFlag}`); - if (stdout) console.log(stdout); - if (stderr) console.error(stderr); - } catch (error) { - console.error('Erreur lors de la simulation:', error); - } - - // Planifier la prochaine exécution - const nextInterval = Math.floor(Math.random() * (MAX_INTERVAL - MIN_INTERVAL + 1)) + MIN_INTERVAL; - console.log(`Prochaine interaction dans ${Math.round(nextInterval / 60000)} minutes.`); - setTimeout(runSimulation, nextInterval); -} - -console.log('--- Démon de simulation RP Star Wars démarré ---'); -runSimulation(); - diff --git a/front/scripts/update-planet-images.ts b/front/scripts/update-planet-images.ts deleted file mode 100644 index f4a4097..0000000 --- a/front/scripts/update-planet-images.ts +++ /dev/null @@ -1,260 +0,0 @@ -import { createClient } from '@supabase/supabase-js'; -import OpenAI from 'openai'; -import axios from 'axios'; -import * as cheerio from 'cheerio'; -import dotenv from 'dotenv'; -import { fileURLToPath } from 'url'; -import { dirname, resolve } from 'path'; - -// Configuration de dotenv pour charger .env.local -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); -dotenv.config({ path: resolve(__dirname, '../.env.local') }); - -const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL; -const supabaseServiceKey = process.env.SUPABASE_SERVICE_ROLE_KEY; -const openaiApiKey = process.env.OPENAI_API_KEY; - -if (!supabaseUrl || !supabaseServiceKey || !openaiApiKey) { - console.error('Erreur: NEXT_PUBLIC_SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY et OPENAI_API_KEY doivent être définis dans .env.local'); - process.exit(1); -} - -const supabase = createClient(supabaseUrl, supabaseServiceKey); -const openai = new OpenAI({ - apiKey: openaiApiKey, -}); - -/** - * Nettoie le nom de la planète pour la recherche Wookieepedia - */ -function cleanPlanetName(name: string): string { - return name - .split(' - ')[0] // Enlever les sous-lieux comme "Coruscant - Palais Impérial" - .split(' (')[0] // Enlever les précisions comme "Alderaan (Cimetière)" - .trim() - .replace(/ /g, '_'); // Remplacer les espaces par des underscores pour l'URL -} - -/** - * Utilise l'IA pour choisir les meilleures images parmi une liste extraite - */ -async function getBestImagesWithAI(planetName: string, candidates: any[]) { - if (candidates.length === 0) return { icon: null, header: null }; - - const prompt = ` - Je travaille sur un forum Roleplay Star Wars. Pour la planète "${planetName}", je dois choisir deux images parfaites parmi cette liste issue de différentes sources (Wookieepedia Canon, Legends et Holonet). - - CANDIDATS : - ${JSON.stringify(candidates.slice(0, 40))} - - MISSION : - 1. "icon" : Trouve l'image qui montre le GLOBE COMPLET de la planète (sa forme ronde) seule dans l'espace. C'est l'image d'identité. On veut voir la planète en entier, pas juste une partie de sa surface depuis l'orbite. - 2. "header" : Trouve l'image la plus "CONCEPT ART" ou "ARTWORK" possible. - - On veut un paysage immersif, une vue de cité, ou un panorama magnifique qui symbolise ce monde. - - IMPORTANT : Évite les photos de figurines, les captures d'écran de jeux vidéo de basse qualité, ou les simples schémas techniques. - - On veut quelque chose de large, artistique et cinématographique. - - Si l'image semble être une peinture numérique ou un matte painting officiel de Lucasfilm/Disney, privilégie-la. - - Réponds UNIQUEMENT en JSON : {"icon": "url", "header": "url"} - `; - - try { - const response = await openai.chat.completions.create({ - model: "gpt-4o-mini", - messages: [ - { role: "system", content: "Tu es un expert en art Star Wars. Tu analyses les contextes et URLs pour trouver les meilleures illustrations JdR." }, - { role: "user", content: prompt } - ], - response_format: { type: "json_object" } - }); - - const responseText = response.choices[0].message.content?.trim() || "{}"; - return JSON.parse(responseText); - } catch (e) { - return { icon: candidates[0]?.url, header: candidates[1]?.url }; - } -} - -/** - * Télécharge une image et l'upload sur Supabase Storage - */ -async function uploadToSupabase(imageUrl: string, prefix: string, fileName: string): Promise { - try { - // Gérer les URLs relatives au protocole (//static.wikia...) - let fullUrl = imageUrl.trim(); - if (fullUrl.startsWith('//')) { - fullUrl = `https:${fullUrl}`; - } - - // Vérifier si c'est une URL valide - if (!fullUrl.startsWith('http')) { - console.error(`❌ URL ignorée car invalide pour ${fileName} (${prefix}): "${fullUrl}"`); - return null; - } - - console.log(`📥 Téléchargement (${prefix}) : ${fullUrl}`); - const response = await axios.get(fullUrl, { - responseType: 'arraybuffer', - headers: { 'User-Agent': 'Mozilla/5.0' } - }); - const buffer = Buffer.from(response.data, 'binary'); - const extension = imageUrl.split('.').pop()?.split('/')[0] || 'jpg'; - const storagePath = `planets/${prefix}_${fileName}.${extension}`; - - const { error } = await supabase.storage - .from('forum') - .upload(storagePath, buffer, { - contentType: `image/${extension === 'png' ? 'png' : 'jpeg'}`, - upsert: true - }); - - if (error) throw error; - - const { data: { publicUrl } } = supabase.storage - .from('forum') - .getPublicUrl(storagePath); - - return publicUrl; - } catch (error: any) { - console.error(`Erreur lors de l'upload de ${fileName} (${prefix}):`, error.message); - return null; - } -} - -/** - * Récupère le HTML d'une page - */ -async function getPageHtml(url: string): Promise { - try { - const userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'; - const response = await axios.get(url, { headers: { 'User-Agent': userAgent }, timeout: 10000 }); - return response.data; - } catch (e) { - return ""; - } -} - -/** - * Scrape les images d'un HTML - */ -function scrapeImagesFromHtml(html: string, sourceName: string): any[] { - const $ = cheerio.load(html); - const found: any[] = []; - - $('img').each((i, el) => { - const src = $(el).attr('data-src') || $(el).attr('src') || $(el).attr('data-original'); - if (!src || src.startsWith('data:')) return; - - const cleanUrl = src.split('/revision/')[0].split('?')[0]; - if (cleanUrl.includes('static.wikia') || cleanUrl.includes('fandom.com') || cleanUrl.includes('holonet') || cleanUrl.includes('nocookie')) { - const parent = $(el).closest('figure, .thumb, .pi-image, .image, td, div'); - const context = parent.text().trim().substring(0, 300) || $(el).attr('alt') || "Image de " + sourceName; - - if (!found.find(img => img.url === cleanUrl)) { - found.push({ url: cleanUrl, context, source: sourceName }); - } - } - }); - return found; -} - -async function updatePlanetImages() { - console.log('🚀 Début de la recherche GALACTIQUE (Wookieepedia + Holonet)...'); - - // Récupérer dynamiquement toutes les catégories qui ont une ère définie - const { data: categories } = await supabase - .from('forum_categories') - .select('id, name, era') - .not('era', 'is', null); - - const validCategoryIds = categories?.map(c => c.id) || []; - - if (validCategoryIds.length === 0) { - console.log('⚠️ Aucune catégorie avec une ère trouvée.'); - return; - } - - console.log(`📁 Catégories détectées : ${categories?.map(c => `${c.name} (${c.id})`).join(', ')}`); - - const { data: planets, error } = await supabase - .from('forums') - .select('*') - .eq('type', 'planet') - .in('category_id', validCategoryIds) - .order('category_id', { ascending: true }); - - if (error || !planets) { - console.error('❌ Erreur lors de la récupération des planètes:', error); - return; - } - - console.log(`🪐 ${planets.length} planètes trouvées au total.`); - categories?.forEach(cat => { - const count = planets.filter(p => p.category_id === cat.id).length; - console.log(` - ${cat.name} : ${count} planètes`); - }); - - const cache = new Map(); - - for (const planet of planets) { - const cleanedName = cleanPlanetName(planet.name); - const cacheKey = cleanedName.toLowerCase(); - - if (cache.has(cacheKey)) { - const urls = cache.get(cacheKey)!; - await supabase.from('forums').update({ - image_url: urls.icon, - header_image_url: urls.header - }).eq('id', planet.id); - continue; - } - - console.log(`\n🌌 Exploration pour : ${planet.name}...`); - - // 1. Collecter les sources - const sources = [ - { name: "Wookiee Canon", url: `https://starwars.fandom.com/wiki/${cleanedName}` }, - { name: "Wookiee Legends", url: `https://starwars.fandom.com/wiki/${cleanedName}/Legends` }, - { name: "Holonet", url: `https://www.starwars-holonet.com/encyclopedie/planete-${cleanedName.toLowerCase()}.html` }, - { name: "Wookiee Gallery", url: `https://starwars.fandom.com/wiki/${cleanedName}/Gallery` } - ]; - - let allCandidates: any[] = []; - for (const source of sources) { - const html = await getPageHtml(source.url); - if (html) { - const imgs = scrapeImagesFromHtml(html, source.name); - console.log(` - ${source.name} : ${imgs.length} images trouvées`); - allCandidates = [...allCandidates, ...imgs]; - } - } - - if (allCandidates.length > 0) { - // 2. L'IA choisit parmi TOUTES les sources - const best = await getBestImagesWithAI(planet.name, allCandidates); - - let publicUrls = { icon: null as string | null, header: null as string | null }; - - if (best.icon) { - publicUrls.icon = await uploadToSupabase(best.icon, 'icon', cacheKey); - } - if (best.header) { - publicUrls.header = await uploadToSupabase(best.header, 'header', cacheKey); - } - - cache.set(cacheKey, publicUrls); - - await supabase.from('forums').update({ - image_url: publicUrls.icon || planet.image_url, - header_image_url: publicUrls.header || planet.header_image_url - }).eq('id', planet.id); - - console.log(` ✅ Terminé pour ${planet.name}`); - } - - await new Promise(r => setTimeout(r, 1000)); - } -} - -updatePlanetImages(); diff --git a/front/src/app/auth/callback/route.ts b/front/src/app/auth/callback/route.ts deleted file mode 100644 index ea6bee7..0000000 --- a/front/src/app/auth/callback/route.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { createServerSupabaseClient } from '@/shared/utils/supabase-server' -import { NextResponse } from 'next/server' - -export async function GET(request: Request) { - const requestUrl = new URL(request.url) - const code = requestUrl.searchParams.get('code') - - if (code) { - const supabase = await createServerSupabaseClient() - await supabase.auth.exchangeCodeForSession(code) - } - - // URL to redirect to after sign in process completes - return NextResponse.redirect(requestUrl.origin) -} diff --git a/front/src/app/forum/admin/page.tsx b/front/src/app/forum/admin/page.tsx index 2c82e0e..69d60b9 100644 --- a/front/src/app/forum/admin/page.tsx +++ b/front/src/app/forum/admin/page.tsx @@ -15,7 +15,7 @@ import { Badge } from '@/shared/components/ui/Badge'; import { SectionHeader } from '@/shared/components/ui/SectionHeader'; import { CategoryHeader } from '@/shared/components/forum/CategoryHeader'; import { Modal } from '@/shared/components/ui/Modal'; -import { supabase } from '@/shared/utils/supabase'; +import { apiFetch, apiMutate, uploadFile } from '@/shared/utils/api'; import { useActiveCharacter } from '@/shared/contexts/CharacterContext'; import { useRouter } from 'next/navigation'; import { cn } from '@/shared/utils/cn'; @@ -174,20 +174,8 @@ export default function ForumAdminPage() { setIsUploading(true); try { - const fileExt = file.name.split('.').pop(); - const fileName = `${Math.random().toString(36).substring(2)}.${fileExt}`; const folder = field === 'image_url' ? 'forum-icons' : 'forum-headers'; - const filePath = `${folder}/${fileName}`; - - const { error: uploadError, data } = await supabase.storage - .from('forum') - .upload(filePath, file); - - if (uploadError) throw uploadError; - - const { data: { publicUrl } } = supabase.storage - .from('forum') - .getPublicUrl(filePath); + const { url: publicUrl } = await uploadFile(file, folder); if (isEdit) { setEditingForum({ ...editingForum, [field]: publicUrl }); @@ -205,8 +193,10 @@ export default function ForumAdminPage() { async function fetchData() { setLoading(true); try { - const { data: catData } = await supabase.from('forum_categories').select('*').order('display_order', { ascending: true }); - const { data: forumData } = await supabase.from('forums').select('*').order('display_order', { ascending: true }); + const [catData, forumData] = await Promise.all([ + apiFetch('/forum/categories'), + apiFetch('/forums'), + ]); setCategories(catData || []); setForums(forumData || []); } catch (err) { @@ -231,16 +221,11 @@ export default function ForumAdminPage() { setIsSaving(true); try { // Si targetId est null, on déplace à la racine de la catégorie - const { error } = await supabase - .from('forums') - .update({ - parent_id: targetId, - category_id: catId, - display_order: 0 // On le met en haut par défaut lors d'un drop - }) - .eq('id', sourceId); - - if (error) throw error; + await apiMutate(`/forums/${sourceId}`, 'PATCH', { + parent_id: targetId, + category_id: catId, + display_order: 0, // On le met en haut par défaut lors d'un drop + }); fetchData(); } catch (err) { console.error(err); @@ -254,13 +239,12 @@ export default function ForumAdminPage() { if (!newForum.name || !newForum.category_id) return; setIsSaving(true); try { - const { error } = await supabase.from('forums').insert([{ + await apiMutate('/forums', 'POST', { ...newForum, category_id: parseInt(newForum.category_id), parent_id: newForum.parent_id ? parseInt(newForum.parent_id) : null, display_order: parseInt(newForum.display_order.toString()) - }]); - if (error) throw error; + }); setNewForum({ name: '', description: '', category_id: '', parent_id: '', type: 'location', display_order: 10, image_url: '', header_image_url: '' }); fetchData(); } catch (err) { @@ -274,21 +258,16 @@ export default function ForumAdminPage() { if (!editingForum) return; setIsSaving(true); try { - const { error } = await supabase - .from('forums') - .update({ - name: editingForum.name, - description: editingForum.description, - category_id: editingForum.category_id, - parent_id: editingForum.parent_id || null, - display_order: parseInt(editingForum.display_order), - type: editingForum.type, - image_url: editingForum.image_url, - header_image_url: editingForum.header_image_url - }) - .eq('id', editingForum.id); - - if (error) throw error; + await apiMutate(`/forums/${editingForum.id}`, 'PATCH', { + name: editingForum.name, + description: editingForum.description, + category_id: editingForum.category_id, + parent_id: editingForum.parent_id || null, + display_order: parseInt(editingForum.display_order), + type: editingForum.type, + image_url: editingForum.image_url, + header_image_url: editingForum.header_image_url + }); setIsModalOpen(false); fetchData(); } catch (err) { @@ -331,8 +310,7 @@ export default function ForumAdminPage() { setIsSaving(true); try { - await supabase.from('topics').update({ forum_id: targetForumId }).in('forum_id', allForumsToAvoid); - await supabase.from('forums').delete().eq('id', id); + await apiMutate(`/forums/${id}`, 'DELETE', { move_topics_to: targetForumId }); fetchData(); } catch (err) { console.error(err); diff --git a/front/src/app/forum/era/[eraId]/page.tsx b/front/src/app/forum/era/[eraId]/page.tsx index a7a6f2b..1bab67c 100644 --- a/front/src/app/forum/era/[eraId]/page.tsx +++ b/front/src/app/forum/era/[eraId]/page.tsx @@ -1,92 +1,64 @@ import { notFound } from 'next/navigation'; -import { createServerSupabaseClient } from '@/shared/utils/supabase-server'; import EraDetail from '@/features/forum/components/EraDetail'; +const API_URL = process.env.NEXT_PUBLIC_API_URL ?? 'http://localhost:8000'; + +async function apiGet(path: string): Promise { + const response = await fetch(`${API_URL}/api/v1${path}`, { + headers: { Accept: 'application/json' }, + cache: 'no-store', + }); + + if (!response.ok) return null; + return response.json() as Promise; +} + +function formatLastPost(lp: any) { + if (!lp) return null; + + return { + id: lp.id, + topicId: lp.topic?.id, + title: lp.topic?.title, + authorName: lp.character?.name || lp.author?.username || 'Anonyme', + authorColor: lp.character?.main_group?.color, + date: new Date(lp.created_at).toLocaleDateString('fr-FR', { + day: '2-digit', + month: 'short', + year: 'numeric', + hour: '2-digit', + minute: '2-digit', + }), + }; +} + export default async function EraViewPage({ params }: { params: Promise<{ eraId: string }> }) { const { eraId: eraIdStr } = await params; const eraId = parseInt(eraIdStr); - const supabase = await createServerSupabaseClient(); - // 1. Récupérer la catégorie - const { data: era, error: eraError } = await supabase - .from('forum_categories') - .select('*') - .eq('id', eraId) - .single(); + const [era, forums] = await Promise.all([ + apiGet(`/forum/categories/${eraId}`), + apiGet(`/forums?category_id=${eraId}`), + ]); - if (eraError || !era) { - console.error(`[EraViewPage] Erreur ou catégorie non trouvée pour ID ${eraId}:`, JSON.stringify(eraError, null, 2)); + if (!era) { notFound(); } - // 2. Récupérer les forums (régions) - const { data: regions, error: regionsError } = await supabase - .from('forums') - .select('*') - .eq('category_id', eraId) - .is('parent_id', null) - .order('display_order', { ascending: true }); - - if (regionsError) { - console.error('Erreur fetch regions:', regionsError); - return
Erreur lors du chargement de l'ère.
; - } - - // 3. Récupérer les sous-forums (secteurs/planètes) pour chaque région avec les infos du dernier message agrégé - const regionsWithSubs = await Promise.all((regions || []).map(async (region) => { - const { data: subs, error: subsError } = await supabase - .from('forums') - .select(` - *, - last_post:last_post_id ( - id, - created_at, - topic:topics (id, title), - author:profiles (username), - character:characters ( - name, - main_group:groups (color) - ) - ) - `) - .eq('parent_id', region.id) - .order('display_order', { ascending: true }); - - if (subsError) console.error('Erreur fetch subs détaillée:', JSON.stringify(subsError, null, 2)); - - // Formatter les sous-forums - const formattedSubs = (subs || []).map(sub => { - const lp = sub.last_post; - let lastPost = null; - - if (lp) { - lastPost = { - id: lp.id, - topicId: lp.topic?.id, - title: lp.topic?.title, - authorName: lp.character?.name || lp.author?.username || 'Anonyme', - authorColor: lp.character?.main_group?.color, - date: new Date(lp.created_at).toLocaleDateString('fr-FR', { - day: '2-digit', - month: 'short', - year: 'numeric', - hour: '2-digit', - minute: '2-digit' - }) - }; - } - return { ...sub, lastPost }; - }); + // Reconstruire la hiérarchie : régions (racines) puis leurs sous-forums + const allForums = forums || []; + const regions = allForums.filter(f => !f.parent_id); - return { - ...region, - sub_forums: formattedSubs - }; + const regionsWithSubs = regions.map(region => ({ + ...region, + sub_forums: allForums + .filter(f => f.parent_id === region.id) + .map(sub => ({ ...sub, lastPost: formatLastPost(sub.last_post) })), })); const eraWithForums = { ...era, - forums: regionsWithSubs + forums: regionsWithSubs, }; return ; diff --git a/front/src/app/profile/character/[characterId]/economy/page.tsx b/front/src/app/profile/character/[characterId]/economy/page.tsx index 1b86d07..6f53e54 100644 --- a/front/src/app/profile/character/[characterId]/economy/page.tsx +++ b/front/src/app/profile/character/[characterId]/economy/page.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'; import { useParams } from 'next/navigation'; -import { supabase } from '@/shared/utils/supabase'; +import { apiFetch, apiMutate } from '@/shared/utils/api'; import { Card, CardTitle, CardDescription, CardContent } from '@/shared/components/ui/Card'; import { Badge } from '@/shared/components/ui/Badge'; import { Wallet, TrendingUp, TrendingDown, Clock, ArrowUpRight, ArrowDownLeft, Loader2, ShieldCheck, Save, Edit2 } from 'lucide-react'; @@ -32,32 +32,21 @@ export default function EconomyPage() { async function fetchData() { try { // 1. Get User Role - const { data: { user } } = await supabase.auth.getUser(); - if (user) { - const { data: profile } = await supabase.from('profiles').select('role').eq('id', user.id).single(); - setUserRole(profile?.role || 'user'); - } + const me = await apiFetch<{ role?: string }>('/me').catch(() => null); + setUserRole(me?.role || 'user'); - // 2. Fetch current credits & monthly flows - const { data: charData } = await supabase - .from('characters') - .select('credits, monthly_income, monthly_expenses') - .eq('id', characterId) - .single(); - - setCharacter(charData); - setEditIncome(charData?.monthly_income || 0); - setEditExpenses(charData?.monthly_expenses || 0); - - // 3. Fetch history - const { data, error } = await supabase - .from('economy_history') - .select('*') - .eq('character_id', characterId) - .order('date', { ascending: false }); + // 2. Fetch credits, monthly flows & history + const economy = await apiFetch(`/characters/${characterId}/economy`); - if (error) throw error; - setHistory(data || []); + const charData = { + credits: economy.credits, + monthly_income: economy.monthly_income, + monthly_expenses: economy.monthly_expenses, + }; + setCharacter(charData); + setEditIncome(charData.monthly_income || 0); + setEditExpenses(charData.monthly_expenses || 0); + setHistory(economy.history || []); } catch (err) { console.error('Erreur économie:', err); } finally { @@ -68,15 +57,10 @@ export default function EconomyPage() { async function handleMJUpdate() { setUpdating(true); try { - const { error } = await supabase - .from('characters') - .update({ - monthly_income: editIncome, - monthly_expenses: editExpenses - }) - .eq('id', characterId); - - if (error) throw error; + await apiMutate(`/characters/${characterId}`, 'PATCH', { + monthly_income: editIncome, + monthly_expenses: editExpenses + }); setCharacter({ ...character, monthly_income: editIncome, monthly_expenses: editExpenses }); setIsEditing(false); } catch (err) { diff --git a/front/src/app/profile/character/[characterId]/inventory/page.tsx b/front/src/app/profile/character/[characterId]/inventory/page.tsx index 5cfeeb0..94fc06d 100644 --- a/front/src/app/profile/character/[characterId]/inventory/page.tsx +++ b/front/src/app/profile/character/[characterId]/inventory/page.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'; import { useParams } from 'next/navigation'; -import { supabase } from '@/shared/utils/supabase'; +import { apiFetch } from '@/shared/utils/api'; import { Card, CardTitle, CardDescription } from '@/shared/components/ui/Card'; import { Badge } from '@/shared/components/ui/Badge'; import { Briefcase, Shield, Zap, Search, Filter, Loader2, Award } from 'lucide-react'; @@ -23,26 +23,12 @@ export default function InventoryPage() { async function fetchInventory() { try { - // 1. Fetch character starting item - const { data: charData } = await supabase - .from('characters') - .select('starting_item') - .eq('id', characterId) - .single(); - - setStartingItem(charData?.starting_item); + const data = await apiFetch<{ starting_item: string | null; items: any[] }>( + `/characters/${characterId}/inventory` + ); - // 2. Fetch inventory items - const { data, error } = await supabase - .from('character_inventory') - .select(` - *, - item:items_catalog(*) - `) - .eq('character_id', characterId); - - if (error) throw error; - setInventory(data || []); + setStartingItem(data.starting_item); + setInventory(data.items || []); } catch (err) { console.error('Erreur inventaire:', err); } finally { diff --git a/front/src/app/profile/character/[characterId]/page.tsx b/front/src/app/profile/character/[characterId]/page.tsx index f2df911..01785fe 100644 --- a/front/src/app/profile/character/[characterId]/page.tsx +++ b/front/src/app/profile/character/[characterId]/page.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'; import { useParams, useRouter } from 'next/navigation'; -import { supabase } from '@/shared/utils/supabase'; +import { apiFetch, fetchCurrentUser } from '@/shared/utils/api'; import { Card, CardTitle, CardDescription, CardContent } from '@/shared/components/ui/Card'; import { Badge } from '@/shared/components/ui/Badge'; import { Button } from '@/shared/components/ui/Button'; @@ -28,22 +28,12 @@ export default function CharacterSummaryPage() { }, [characterId]); async function fetchUser() { - const { data: { user } } = await supabase.auth.getUser(); - setCurrentUser(user); + setCurrentUser(await fetchCurrentUser()); } async function fetchCharacter() { try { - const { data, error } = await supabase - .from('characters') - .select(` - *, - main_group:groups(*) - `) - .eq('id', characterId) - .single(); - - if (error) throw error; + const data = await apiFetch(`/characters/${characterId}`); setCharacter(data); } catch (err: any) { console.error('Erreur lors du chargement du personnage:', err); diff --git a/front/src/app/profile/character/[characterId]/ship/page.tsx b/front/src/app/profile/character/[characterId]/ship/page.tsx index 3f3bb32..04c4dd4 100644 --- a/front/src/app/profile/character/[characterId]/ship/page.tsx +++ b/front/src/app/profile/character/[characterId]/ship/page.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'; import { useParams } from 'next/navigation'; -import { supabase } from '@/shared/utils/supabase'; +import { apiFetch } from '@/shared/utils/api'; import { Card, CardTitle } from '@/shared/components/ui/Card'; import { Badge } from '@/shared/components/ui/Badge'; import { Rocket, Zap, Shield, Target, Cpu, AlertTriangle, CheckCircle2, Loader2 } from 'lucide-react'; @@ -22,26 +22,12 @@ export default function ShipPage() { async function fetchShip() { try { - // 1. Fetch ship - const { data: shipData, error: shipError } = await supabase - .from('ships') - .select('*') - .eq('character_id', characterId) - .single(); - - if (shipError && shipError.code !== 'PGRST116') throw shipError; // PGRST116 means no row found - setShip(shipData); - - // 2. Fetch modules if ship exists - if (shipData) { - const { data: moduleData, error: moduleError } = await supabase - .from('ship_modules') - .select('*') - .eq('ship_id', shipData.id); + const { ship: shipData } = await apiFetch<{ ship: any | null }>( + `/characters/${characterId}/ship` + ); - if (moduleError) throw moduleError; - setModules(moduleData || []); - } + setShip(shipData); + setModules(shipData?.modules || []); } catch (err) { console.error('Erreur vaisseau:', err); } finally { diff --git a/front/src/app/profile/character/new/page.tsx b/front/src/app/profile/character/new/page.tsx index d175ac5..4c4c004 100644 --- a/front/src/app/profile/character/new/page.tsx +++ b/front/src/app/profile/character/new/page.tsx @@ -3,7 +3,7 @@ import React, { useState, useEffect } from 'react'; import { useRouter } from 'next/navigation'; import { User, Shield, Award, ArrowLeft, Save, Loader2, AlertCircle, Users, BookOpen, Heart, Zap, Crosshair, Sparkles, Ghost, Briefcase, ChevronRight, ChevronLeft } from 'lucide-react'; -import { supabase } from '@/shared/utils/supabase'; +import { apiFetch, apiMutate, fetchCurrentUser } from '@/shared/utils/api'; import { useActiveCharacter } from '@/shared/contexts/CharacterContext'; import { Button } from '@/shared/components/ui/Button'; import { Input } from '@/shared/components/ui/Input'; @@ -111,17 +111,21 @@ export default function NewCharacterPage() { async function checkCharacterLimitAndFetchGroups() { try { - const { data: { user } } = await supabase.auth.getUser(); + const user = await fetchCurrentUser(); if (!user) { router.push('/auth/login'); return; } - const { count: charCount } = await supabase.from('characters').select('*', { count: 'exact', head: true }).eq('user_id', user.id); - if (charCount !== null && charCount >= 6) { router.push('/profile'); return; } - setCount(charCount || 0); + const [characters, groups] = await Promise.all([ + apiFetch(`/profiles/${user.id}/characters`), + apiFetch(`/groups?era=${encodeURIComponent(formData.era)}`), + ]); + + const charCount = characters.length; + if (charCount >= 6) { router.push('/profile'); return; } + setCount(charCount); - const { data: groups } = await supabase.from('groups').select('*').eq('era', formData.era).order('name'); setAvailableGroups(groups || []); } catch (err) { console.error(err); } finally { setLoading(false); } } @@ -142,16 +146,13 @@ export default function NewCharacterPage() { setError(null); try { - const { data: { user } } = await supabase.auth.getUser(); - - const { data: character, error: charError } = await supabase.from('characters').insert({ - user_id: user?.id, + // L'API crée le personnage, l'adhésion à la faction et l'active sur le profil + await apiMutate('/characters', 'POST', { name: formData.name, species: formData.species, class: formData.job, occupation_category: formData.category, era: formData.era, - faction: availableGroups.find(g => g.id === formData.selectedGroupId)?.name || 'Indépendant', main_group_id: formData.selectedGroupId || null, physical_description: formData.physical_description, personality: formData.personality, @@ -160,37 +161,10 @@ export default function NewCharacterPage() { dislikes: formData.dislikes, skills: formData.selectedSkills, starting_item: currentJob?.item, - credits: 2000, - }).select().single(); - - if (charError) throw charError; - - // 1. Définir le personnage comme actif pour le profil - if (character && user) { - const { error: updateError } = await supabase - .from('profiles') - .update({ active_character_id: character.id }) - .eq('id', user.id); - - if (updateError) { - console.error("Erreur lors de l'activation du personnage:", updateError); - } - - // Petit délai pour laisser la DB respirer (surtout en local) - await new Promise(resolve => setTimeout(resolve, 500)); - - // Forcer le rafraîchissement du contexte global - await refreshActiveCharacter(); - } + }); - // 2. Gérer l'adhésion à la faction - if (formData.selectedGroupId && character) { - await supabase.from('group_members').insert({ - group_id: formData.selectedGroupId, - character_id: character.id, - role: 'member' - }); - } + // Rafraîchir le contexte global (personnage actif) + await refreshActiveCharacter(); // Rediriger vers le forum plutôt que le profil pour une immersion immédiate router.push('/forum'); diff --git a/front/src/app/settings/page.tsx b/front/src/app/settings/page.tsx index e56f058..d116d34 100644 --- a/front/src/app/settings/page.tsx +++ b/front/src/app/settings/page.tsx @@ -3,7 +3,7 @@ import React, { useState, useEffect } from 'react'; import { useRouter } from 'next/navigation'; import { User, Mail, Save, Loader2, AlertCircle, CheckCircle2, Camera, ArrowLeft, Trash2 } from 'lucide-react'; -import { supabase } from '@/shared/utils/supabase'; +import { apiFetch, apiMutate, fetchCurrentUser } from '@/shared/utils/api'; import { Button } from '@/shared/components/ui/Button'; import { Input } from '@/shared/components/ui/Input'; import { Card, CardHeader, CardTitle, CardDescription, CardContent } from '@/shared/components/ui/Card'; @@ -25,20 +25,14 @@ export default function SettingsPage() { async function fetchProfile() { try { - const { data: { user } } = await supabase.auth.getUser(); + const user = await fetchCurrentUser(); if (!user) { router.push('/auth/login'); return; } setUser(user); - const { data: profile, error: profileError } = await supabase - .from('profiles') - .select('*') - .eq('id', user.id) - .single(); - - if (profileError) throw profileError; + const profile = await apiFetch('/me'); setUsername(profile.username || ''); setAvatarUrl(profile.avatar_url || ''); setBioHrp(profile.bio_hrp || ''); @@ -56,17 +50,11 @@ export default function SettingsPage() { setSuccess(false); try { - const { error } = await supabase - .from('profiles') - .update({ - username, - avatar_url: avatarUrl, - bio_hrp: bioHrp, - updated_at: new Date().toISOString(), - }) - .eq('id', user?.id); - - if (error) throw error; + await apiMutate('/me/profile', 'PATCH', { + username, + avatar_url: avatarUrl, + bio_hrp: bioHrp, + }); setSuccess(true); } catch (err: any) { setError(err.message); diff --git a/front/src/features/factions/components/FactionDetail.tsx b/front/src/features/factions/components/FactionDetail.tsx index 20166e8..7ae990c 100644 --- a/front/src/features/factions/components/FactionDetail.tsx +++ b/front/src/features/factions/components/FactionDetail.tsx @@ -3,7 +3,7 @@ import React, { useEffect, useState } from 'react'; import Link from 'next/link'; import { ChevronLeft, Users, Calendar, MessageSquare, Shield, ArrowUpDown } from 'lucide-react'; -import { supabase } from '@/shared/utils/supabase'; +import { apiFetch } from '@/shared/utils/api'; import { CategoryHeader } from '@/shared/components/forum/CategoryHeader'; import { Avatar } from '@/shared/components/ui/Avatar'; import { Badge } from '@/shared/components/ui/Badge'; @@ -28,33 +28,12 @@ export default function FactionDetail({ id }: FactionDetailProps) { async function fetchFactionData() { try { - // Fetch faction info - const { data: group, error: groupError } = await supabase - .from('groups') - .select('*') - .eq('id', id) - .single(); - - if (groupError) throw groupError; + const group = await apiFetch(`/groups/${id}`); setFaction(group); - // Fetch members with post count - // Note: We'll do a join to get post counts if possible, - // otherwise we fetch and count in JS for now if the DB query is complex. - // Better: Use a join or subquery. - const { data: chars, error: charsError } = await supabase - .from('characters') - .select(` - *, - posts:posts(count) - `) - .eq('main_group_id', id); - - if (charsError) throw charsError; - - const membersWithStats = (chars || []).map((char: any) => ({ + const membersWithStats = (group.characters || []).map((char: any) => ({ ...char, - posts_count: char.posts?.[0]?.count || 0 + posts_count: char.posts_count || 0 })); // Sorting diff --git a/front/src/features/factions/components/FactionsIndex.tsx b/front/src/features/factions/components/FactionsIndex.tsx index 467caba..67dd3ad 100644 --- a/front/src/features/factions/components/FactionsIndex.tsx +++ b/front/src/features/factions/components/FactionsIndex.tsx @@ -3,7 +3,7 @@ import React, { useEffect, useState } from 'react'; import Link from 'next/link'; import { Shield, Users, ArrowRight } from 'lucide-react'; -import { supabase } from '@/shared/utils/supabase'; +import { apiFetch } from '@/shared/utils/api'; import { CategoryHeader } from '@/shared/components/forum/CategoryHeader'; import { Card } from '@/shared/components/ui/Card'; import { Group } from '@/features/profile/types'; @@ -27,22 +27,14 @@ export default function FactionsIndex() { async function fetchFactions() { try { - const { data: groups, error } = await supabase - .from('groups') - .select(` - *, - characters:characters(count) - `) - .order('name'); - - if (error) throw error; + const groups = await apiFetch('/groups'); const grouped = (groups || []).reduce((acc: any, group: any) => { const era = group.era || 'Général'; if (!acc[era]) acc[era] = []; acc[era].push({ ...group, - member_count: group.characters?.[0]?.count || 0 + member_count: group.characters_count || 0 }); return acc; }, {}); diff --git a/front/src/features/forum/components/ForumDetail.tsx b/front/src/features/forum/components/ForumDetail.tsx index 7cd2139..919ba32 100644 --- a/front/src/features/forum/components/ForumDetail.tsx +++ b/front/src/features/forum/components/ForumDetail.tsx @@ -9,7 +9,7 @@ import { Card, CardTitle, CardDescription } from '@/shared/components/ui/Card'; import { CategoryHeader } from '@/shared/components/forum/CategoryHeader'; import { TopicRow } from '@/shared/components/forum/TopicRow'; import { ForumRow } from '@/shared/components/forum/ForumRow'; -import { supabase } from '@/shared/utils/supabase'; +import { apiFetch, ApiError } from '@/shared/utils/api'; import { useActiveCharacter } from '@/shared/contexts/CharacterContext'; import { cn } from '@/shared/utils/cn'; import TopicForm from './TopicForm'; @@ -37,63 +37,31 @@ export default function ForumDetail({ forumId }: ForumDetailProps) { async function fetchForumData() { setLoading(true); try { - const { data: forumData, error: forumError } = await supabase - .from('forums') - .select(` - *, - category:forum_categories(id, name, era) - `) - .eq('id', forumId) - .single(); + const { forum: forumData, ancestors, topics: topicsData } = await apiFetch<{ + forum: any; + ancestors: { id: number; name: string }[]; + topics: any[]; + }>(`/forums/${forumId}`); - if (forumError) throw forumError; setForum(forumData); setIsRP(!!forumData.category?.era); const path: BreadcrumbSegment[] = []; if (forumData.category) { - path.push({ + path.push({ name: forumData.category.name, - href: forumData.category.era ? `/forum/era/${forumData.category.id}` : undefined + href: forumData.category.era ? `/forum/era/${forumData.category.id}` : undefined }); } - let currentParentId = forumData.parent_id; - const parents = []; - while (currentParentId) { - const { data: parent } = await supabase.from('forums').select('id, name, parent_id').eq('id', currentParentId).single(); - if (parent) { - parents.unshift({ name: parent.name, href: `/forum/${parent.id}` }); - currentParentId = parent.parent_id; - } else break; - } + // Les ancêtres arrivent du plus proche à la racine : on remet la racine en premier. + const parents = [...(ancestors || [])] + .reverse() + .map(parent => ({ name: parent.name, href: `/forum/${parent.id}` })); setBreadcrumbs([...path, ...parents, { name: forumData.name }]); - // 2. Récupérer les sous-forums avec les infos du dernier message agrégé - const { data: subForums, error: subsError } = await supabase - .from('forums') - .select(` - *, - last_post:last_post_id ( - id, - created_at, - topic:topics (id, title), - author:profiles (username), - character:characters ( - name, - main_group:groups (color) - ) - ) - `) - .eq('parent_id', forumId) - .order('display_order', { ascending: true }); - - if (subsError) console.error('Erreur subForums détaillée:', JSON.stringify(subsError, null, 2)); - - if (subsError) console.error('Erreur subForums:', subsError); - // Transformer les sous-forums pour inclure lastPost - const formattedSubForums = (subForums || []).map(sub => { + const formattedSubForums = (forumData.children || []).map((sub: any) => { const lp = sub.last_post; let lastPost = null; @@ -122,49 +90,26 @@ export default function ForumDetail({ forumId }: ForumDetailProps) { }; }); - setForum((prev: any) => ({ ...prev, sub_forums: formattedSubForums })); - - const { data: topicsData, error: topicsError } = await supabase - .from('topics') - .select(` - *, - author:profiles(username, avatar_url), - character:characters(name, avatar, main_group:groups(name, color)), - posts ( - id, - created_at, - author:profiles(username), - character:characters(name, main_group:groups(color)) - ) - `) - .eq('forum_id', forumId) - .order('is_pinned', { ascending: false }) - .order('updated_at', { ascending: false }); - - if (topicsError) throw topicsError; + setForum({ ...forumData, sub_forums: formattedSubForums }); // Formatter les sujets pour inclure les infos du dernier message réel - const formattedTopics = (topicsData || []).map(topic => { - // Trier les messages par date de création décroissante et prendre le premier - const sortedPosts = [...(topic.posts || [])].sort((a, b) => - new Date(b.created_at).getTime() - new Date(a.created_at).getTime() - ); - const lastPostData = sortedPosts.length > 0 ? sortedPosts[0] : null; - + const formattedTopics = (topicsData || []).map((topic: any) => { + const lastPostData = topic.last_post || null; + const lastPost = { id: lastPostData?.id, - authorName: lastPostData + authorName: lastPostData ? (lastPostData.character?.name || lastPostData.author?.username || 'Anonyme') : (topic.character?.name || topic.author?.username || 'Anonyme'), authorColor: lastPostData ? lastPostData.character?.main_group?.color : topic.character?.main_group?.color, - date: new Date(topic.updated_at).toLocaleDateString('fr-FR', { - day: '2-digit', - month: 'short', - year: 'numeric', - hour: '2-digit', - minute: '2-digit' + date: new Date(topic.updated_at).toLocaleDateString('fr-FR', { + day: '2-digit', + month: 'short', + year: 'numeric', + hour: '2-digit', + minute: '2-digit' }) }; @@ -174,9 +119,8 @@ export default function ForumDetail({ forumId }: ForumDetailProps) { setTopics(formattedTopics); } catch (err: any) { - const errorMsg = `ERREUR_FORUM -> MSG: ${err.message || 'n/a'} | CODE: ${err.code || 'n/a'} | DET: ${err.details || 'n/a'}`; - console.error(errorMsg); - if (err.code === 'PGRST116') router.push('/forum'); + console.error('Erreur chargement forum:', err); + if (err instanceof ApiError) router.push('/forum'); } finally { setLoading(false); } diff --git a/front/src/features/forum/components/ForumIndex.tsx b/front/src/features/forum/components/ForumIndex.tsx index ecc7680..4cc8eb3 100644 --- a/front/src/features/forum/components/ForumIndex.tsx +++ b/front/src/features/forum/components/ForumIndex.tsx @@ -10,7 +10,7 @@ import { Badge } from '@/shared/components/ui/Badge'; import { CategoryHeader } from '@/shared/components/forum/CategoryHeader'; import { ForumRow } from '@/shared/components/forum/ForumRow'; import { useActiveCharacter } from '@/shared/contexts/CharacterContext'; -import { supabase } from '@/shared/utils/supabase'; +import { apiFetch } from '@/shared/utils/api'; export default function ForumIndex() { const { activeCharacter, userRole, loading: loadingChar } = useActiveCharacter(); @@ -37,31 +37,10 @@ export default function ForumIndex() { async function fetchForumData() { setLoading(true); try { - const { data: categoriesData } = await supabase.from('forum_categories').select('*').order('display_order', { ascending: true }); - - // On récupère les forums avec les infos agrégées récursivement - const { data: forumsData, error: forumsError } = await supabase - .from('forums') - .select(` - *, - last_post:last_post_id ( - id, - created_at, - topic:topics (id, title), - author:profiles (username), - character:characters ( - name, - main_group:groups (color) - ) - ) - `) - .order('display_order', { ascending: true }); - - if (forumsError) { - console.error('Erreur forumsData détaillée:', JSON.stringify(forumsError, null, 2)); - } - - console.log('Nombre de forums récupérés:', forumsData?.length); + const [categoriesData, forumsData] = await Promise.all([ + apiFetch('/forum/categories'), + apiFetch('/forums'), + ]); const filteredCats = (categoriesData || []).filter(cat => { if (!hasAccess(cat.required_role, userRole)) return false; diff --git a/front/src/features/forum/components/ReplyForm.tsx b/front/src/features/forum/components/ReplyForm.tsx index 8ee0788..e5243b8 100644 --- a/front/src/features/forum/components/ReplyForm.tsx +++ b/front/src/features/forum/components/ReplyForm.tsx @@ -1,7 +1,7 @@ 'use client'; import React, { useState } from 'react'; -import { supabase } from '@/shared/utils/supabase'; +import { apiMutate } from '@/shared/utils/api'; import { Button } from '@/shared/components/ui/Button'; import { Card } from '@/shared/components/ui/Card'; import { Textarea } from '@/shared/components/ui/Textarea'; @@ -26,25 +26,10 @@ export default function ReplyForm({ topicId, isRP, onSuccess, onCancel }: ReplyF setLoading(true); try { - const { data: { user } } = await supabase.auth.getUser(); - if (!user) throw new Error('Non connecté'); - - const { error } = await supabase - .from('posts') - .insert({ - topic_id: topicId, - author_id: user.id, - character_id: isRP ? activeCharacter?.id : null, - content: content.trim() - }); - - if (error) throw error; - - // Mettre à jour la date de mise à jour du sujet - await supabase - .from('topics') - .update({ updated_at: new Date().toISOString() }) - .eq('id', topicId); + await apiMutate(`/topics/${topicId}/posts`, 'POST', { + content: content.trim(), + character_id: isRP ? activeCharacter?.id : null, + }); setContent(''); onSuccess(); diff --git a/front/src/features/forum/components/TopicDetail.tsx b/front/src/features/forum/components/TopicDetail.tsx index 89efe25..b57d694 100644 --- a/front/src/features/forum/components/TopicDetail.tsx +++ b/front/src/features/forum/components/TopicDetail.tsx @@ -7,7 +7,7 @@ import { Button } from '@/shared/components/ui/Button'; import { Card, CardTitle } from '@/shared/components/ui/Card'; import { Badge } from '@/shared/components/ui/Badge'; import { PostView } from '@/shared/components/forum/PostView'; -import { supabase } from '@/shared/utils/supabase'; +import { apiFetch, apiMutate } from '@/shared/utils/api'; import { cn } from '@/shared/utils/cn'; import ReplyForm from './ReplyForm'; import Breadcrumbs, { BreadcrumbSegment } from './Breadcrumbs'; @@ -30,85 +30,40 @@ export default function TopicDetail({ topicId }: TopicDetailProps) { async function fetchTopicData() { setLoading(true); try { - // 1. Fetch topic info with forum and category - const { data: topicData, error: topicError } = await supabase - .from('topics') - .select(` - *, - forum:forums(id, name, parent_id, category:forum_categories(id, name, era)) - `) - .eq('id', topicId) - .single(); - - if (topicError) throw topicError; + const { topic: topicData, ancestors } = await apiFetch<{ + topic: any; + ancestors: { id: number; name: string }[]; + }>(`/topics/${topicId}`); + setTopic(topicData); + setPosts(topicData.posts || []); - // 2. Build Breadcrumbs + // Breadcrumbs : catégorie, puis ancêtres (racine en premier), puis forum et sujet const path: BreadcrumbSegment[] = []; const forumData = topicData.forum; if (forumData) { - // Add category if (forumData.category) { path.push({ name: forumData.category.name }); } - // Fetch parents recursively - let currentParentId = forumData.parent_id; - const parents = []; - - while (currentParentId) { - const { data: parent } = await supabase - .from('forums') - .select('id, name, parent_id') - .eq('id', currentParentId) - .single(); - - if (parent) { - parents.unshift({ - name: parent.name, - href: `/forum/${parent.id}` - }); - currentParentId = parent.parent_id; - } else { - currentParentId = null; - } - } - + const parents = [...(ancestors || [])] + .reverse() + .map(parent => ({ name: parent.name, href: `/forum/${parent.id}` })); + setBreadcrumbs([ - ...path, - ...parents, + ...path, + ...parents, { name: forumData.name, href: `/forum/${forumData.id}` }, { name: topicData.title } ]); } - // 3. Fetch posts - const { data: postsData, error: postsError } = await supabase - .from('posts') - .select(` - *, - author:profiles(username, avatar_url, role, title_hrp), - character:characters( - name, - avatar, - class, - main_group:groups(name, color) - ) - `) - .eq('topic_id', topicId) - .order('created_at', { ascending: true }); - - if (postsError) throw postsError; - setPosts(postsData || []); - - // 4. Increment views - await supabase.rpc('increment_topic_views', { topic_id: topicId }); + // Incrémenter le compteur de vues (sans bloquer l'affichage) + apiMutate(`/topics/${topicId}/views`, 'POST').catch(() => {}); } catch (err: any) { - console.error('--- ERREUR FETCH TOPIC ---'); - console.error('MESSAGE: ' + (err.message || 'n/a')); - console.error('CODE: ' + (err.code || 'n/a')); + console.error('Erreur chargement sujet:', err); } finally { setLoading(false); } diff --git a/front/src/features/forum/components/TopicForm.tsx b/front/src/features/forum/components/TopicForm.tsx index 9f40368..1d6af05 100644 --- a/front/src/features/forum/components/TopicForm.tsx +++ b/front/src/features/forum/components/TopicForm.tsx @@ -1,7 +1,7 @@ 'use client'; import React, { useState } from 'react'; -import { supabase } from '@/shared/utils/supabase'; +import { apiMutate } from '@/shared/utils/api'; import { Button } from '@/shared/components/ui/Button'; import { Input } from '@/shared/components/ui/Input'; import { Card } from '@/shared/components/ui/Card'; @@ -28,34 +28,11 @@ export default function TopicForm({ forumId, isRP, onSuccess, onCancel }: TopicF setLoading(true); try { - const { data: { user } } = await supabase.auth.getUser(); - if (!user) throw new Error('Non connecté'); - - // 1. Créer le sujet - const { data: topic, error: topicError } = await supabase - .from('topics') - .insert({ - forum_id: forumId, - author_id: user.id, - character_id: isRP ? activeCharacter?.id : null, - title: title.trim() - }) - .select() - .single(); - - if (topicError) throw topicError; - - // 2. Créer le premier message (post) - const { error: postError } = await supabase - .from('posts') - .insert({ - topic_id: topic.id, - author_id: user.id, - character_id: isRP ? activeCharacter?.id : null, - content: content.trim() - }); - - if (postError) throw postError; + await apiMutate(`/forums/${forumId}/topics`, 'POST', { + title: title.trim(), + content: content.trim(), + character_id: isRP ? activeCharacter?.id : null, + }); onSuccess(); } catch (err: any) { diff --git a/front/src/features/portal/components/PortalContent.tsx b/front/src/features/portal/components/PortalContent.tsx index 215e887..7118c01 100644 --- a/front/src/features/portal/components/PortalContent.tsx +++ b/front/src/features/portal/components/PortalContent.tsx @@ -12,7 +12,7 @@ import { TrendingUp, Gamepad2 } from 'lucide-react'; -import { supabase } from '@/shared/utils/supabase'; +import { apiFetch } from '@/shared/utils/api'; import { Button } from '@/shared/components/ui/Button'; import { Card, CardHeader, CardTitle, CardContent } from '@/shared/components/ui/Card'; import { Badge } from '@/shared/components/ui/Badge'; @@ -359,86 +359,32 @@ export default function PortalContent() { async function fetchPortalData() { try { - // 1. Fetch Stats - const { data: globalStats } = await supabase.rpc('get_global_stats'); - const { count: onlineCount } = await supabase - .from('profiles') - .select('*', { count: 'exact', head: true }) - .gt('last_seen', new Date(Date.now() - 15 * 60000).toISOString()); + const [globalStats, portal, staffMembers] = await Promise.all([ + apiFetch('/stats'), + apiFetch('/portal'), + apiFetch('/staff'), + ]); - setStats({ - ...globalStats, - online_count: onlineCount || 0 - }); + setStats(globalStats); - // 2. Fetch Latest Topics - const { data: topics } = await supabase - .from('topics') - .select(` - id, - title, - created_at, - author:profiles(username), - forum:forums(category:forum_categories(era)) - `) - .order('created_at', { ascending: false }) - .limit(5); + setLatestTopics((portal.latest_topics || []).map((t: any) => ({ + id: t.id, + title: t.title, + author_name: t.author?.username || 'Inconnu', + era: t.forum?.category?.era || '', + created_at: t.created_at + }))); - if (topics) { - setLatestTopics(topics.map((t: any) => ({ - id: t.id, - title: t.title, - author_name: t.author?.username || 'Inconnu', - era: t.forum?.category?.era || '', - created_at: t.created_at - }))); - } + setNews((portal.news || []).map((n: any) => ({ + id: n.id, + title: n.title, + content: n.posts?.[0]?.content || '', + created_at: n.created_at, + author_name: n.author?.username || 'Inconnu' + }))); + setNewsForumId(portal.news_forum_id || null); - // 3. Fetch News (Topics from 'Annonces' forum) - const { data: newsItems } = await supabase - .from('topics') - .select(` - id, - title, - created_at, - author:profiles(username), - first_post:posts(content), - forum:forums!inner(id, name) - `) - .eq('forum.name', 'Annonces') - .order('created_at', { ascending: false }) - .limit(3); - - if (newsItems && newsItems.length > 0) { - setNews(newsItems.map((n: any) => ({ - id: n.id, - title: n.title, - content: n.first_post?.[0]?.content || '', - created_at: n.created_at, - author_name: n.author?.username || 'Inconnu' - }))); - const forum = newsItems[0].forum as { id: number } | { id: number }[] | null; - setNewsForumId((Array.isArray(forum) ? forum[0]?.id : forum?.id) || 1); - } else { - // Fallback: essayer de trouver le forum 'Annonces' même s'il est vide - const { data: forumData } = await supabase - .from('forums') - .select('id') - .eq('name', 'Annonces') - .single(); - if (forumData) setNewsForumId(forumData.id); - } - - // 4. Fetch Staff - const { data: staffMembers } = await supabase - .from('profiles') - .select('username, role, avatar_url') - .in('role', ['admin', 'moderator', 'game_master']) - .order('role'); - - if (staffMembers) { - setStaff(staffMembers); - } + setStaff(staffMembers || []); } catch (err) { console.error('Error fetching portal data:', err); diff --git a/front/src/features/profile/components/ProfileContent.tsx b/front/src/features/profile/components/ProfileContent.tsx index 3567347..719574a 100644 --- a/front/src/features/profile/components/ProfileContent.tsx +++ b/front/src/features/profile/components/ProfileContent.tsx @@ -10,7 +10,7 @@ import { Badge } from '@/shared/components/ui/Badge'; import { Avatar } from '@/shared/components/ui/Avatar'; import { CategoryHeader } from '@/shared/components/forum/CategoryHeader'; import { cn } from '@/shared/utils/cn'; -import { supabase } from '@/shared/utils/supabase'; +import { apiFetch, fetchCurrentUser, logoutUser } from '@/shared/utils/api'; import { useActiveCharacter } from '@/shared/contexts/CharacterContext'; // Système de grades forum (HRP) @@ -43,11 +43,10 @@ export default function ProfileContent({ userId }: ProfileContentProps) { async function init() { setLoading(true); try { - const { data: authData } = await supabase.auth.getUser(); - const authUser = authData?.user; - + const authUser = await fetchCurrentUser(); + if (isMounted) setCurrentUser(authUser || null); - + const targetId = userId || authUser?.id; if (!targetId) { if (isMounted) setLoading(false); @@ -55,17 +54,15 @@ export default function ProfileContent({ userId }: ProfileContentProps) { } const [profileRes, charsRes] = await Promise.all([ - supabase.from('profiles').select('*').eq('id', targetId).maybeSingle(), - supabase.from('characters').select('*, main_group:groups(*)').eq('user_id', targetId) + apiFetch(`/profiles/${targetId}`).catch(() => null), + apiFetch(`/profiles/${targetId}/characters`).catch(() => []), ]); if (isMounted) { - if (profileRes.data) { - setProfileData(profileRes.data); - } - if (charsRes.data) { - setCharacters(charsRes.data); + if (profileRes) { + setProfileData(profileRes); } + setCharacters(charsRes || []); } } catch (err) { console.error("Error in ProfileContent:", err); @@ -83,7 +80,7 @@ export default function ProfileContent({ userId }: ProfileContentProps) { const isOwnProfile = !userId || userId === currentUser?.id; const handleLogout = async () => { - await supabase.auth.signOut(); + await logoutUser(); router.push('/'); router.refresh(); }; diff --git a/front/src/shared/components/Footer.tsx b/front/src/shared/components/Footer.tsx index 1f5120d..ba095c9 100644 --- a/front/src/shared/components/Footer.tsx +++ b/front/src/shared/components/Footer.tsx @@ -7,7 +7,7 @@ import { Activity, Info, Gift, BarChart3, Clock, Signal, UserPlus } from 'lucide-react'; -import { supabase } from '@/shared/utils/supabase'; +import { apiFetch, apiMutate } from '@/shared/utils/api'; import { cn } from '@/shared/utils/cn'; import { Avatar } from '@/shared/components/ui/Avatar'; import { Tooltip } from '@/shared/components/ui/Tooltip'; @@ -36,25 +36,15 @@ export default function Footer() { }, []); async function updateLastSeen() { - const { data: { user } } = await supabase.auth.getUser(); - if (user) { - await supabase - .from('profiles') - .update({ last_seen: new Date().toISOString() }) - .eq('id', user.id); - } + // Silencieux si l'utilisateur n'est pas connecté (401) + await apiMutate('/me/heartbeat', 'POST').catch(() => {}); } async function fetchStats() { try { - const { data, error } = await supabase.rpc('get_global_stats'); - if (error) throw error; - setStats(data); + setStats(await apiFetch('/stats')); } catch (err: unknown) { - const e = err as { message?: string; code?: string; details?: string }; - console.error('Error fetching stats:', e.message || err); - if (e.code) console.error('CODE:', e.code); - if (e.details) console.error('DETAILS:', e.details); + console.error('Error fetching stats:', err); } finally { setLoading(false); } @@ -62,42 +52,17 @@ export default function Footer() { async function fetchOnlineUsers() { try { - const { data, error } = await supabase - .from('profiles') - .select(` - id, - username, - role, - active_character:characters!profiles_active_character_id_fkey ( - main_group:groups ( - color - ) - ) - `) - .gt('last_seen', new Date(Date.now() - 15 * 60000).toISOString()) - .limit(50); - - if (error) throw error; - setOnlineUsers(data || []); + setOnlineUsers(await apiFetch('/online-users')); } catch (err: unknown) { - const e = err as { message?: string; code?: string }; - console.error('Error fetching online users:', e.message || err); - if (e.code) console.error('CODE:', e.code); + console.error('Error fetching online users:', err); } } async function fetchGroups() { try { - const { data, error } = await supabase - .from('groups') - .select('*') - .order('name'); - if (error) throw error; - setGroups(data || []); + setGroups(await apiFetch('/groups')); } catch (err: unknown) { - const e = err as { message?: string; code?: string }; - console.error('Error fetching groups:', e.message || err); - if (e.code) console.error('CODE:', e.code); + console.error('Error fetching groups:', err); } } diff --git a/front/src/shared/contexts/CharacterContext.tsx b/front/src/shared/contexts/CharacterContext.tsx index 241185e..002bece 100644 --- a/front/src/shared/contexts/CharacterContext.tsx +++ b/front/src/shared/contexts/CharacterContext.tsx @@ -1,7 +1,7 @@ 'use client'; import React, { createContext, useContext, useState, useEffect } from 'react'; -import { supabase } from '@/shared/utils/supabase'; +import { apiFetch, apiMutate } from '@/shared/utils/api'; interface Character { id: string; @@ -14,6 +14,12 @@ interface Character { type UserRole = 'user' | 'moderator' | 'admin' | 'game_master'; +interface MeResponse { + id: string; + role: UserRole; + active_character: Character | null; +} + interface CharacterContextType { activeCharacter: Character | null; userRole: UserRole | null; @@ -31,84 +37,30 @@ export function CharacterProvider({ children }: { children: React.ReactNode }) { useEffect(() => { refreshActiveCharacter(); - - // Écouter les changements d'authentification pour rafraîchir le perso - const { data: { subscription } } = supabase.auth.onAuthStateChange((event) => { - if (event === 'SIGNED_IN' || event === 'USER_UPDATED') { - refreshActiveCharacter(); - } else if (event === 'SIGNED_OUT') { - setActiveCharacterState(null); - setUserRole(null); - } - }); - - return () => subscription.unsubscribe(); }, []); async function refreshActiveCharacter() { try { - const { data: { user } } = await supabase.auth.getUser(); - - if (!user) { - setActiveCharacterState(null); - setUserRole(null); - setLoading(false); - return; - } - - const { data: profile } = await supabase - .from('profiles') - .select('active_character_id, role') - .eq('id', user.id) - .maybeSingle(); - - if (profile?.role) { - setUserRole(profile.role); - } - - if (profile?.active_character_id) { - const { data: character } = await supabase - .from('characters') - .select('id, name, avatar, era, faction, credits') - .eq('id', profile.active_character_id) - .maybeSingle(); - - setActiveCharacterState(character || null); - } else { - setActiveCharacterState(null); - } - } catch (err) { - console.error('[CharacterContext] Erreur:', err); + const me = await apiFetch('/me'); + setUserRole(me.role ?? null); + setActiveCharacterState(me.active_character ?? null); + } catch { + // Non connecté (401) : pas de personnage actif. + setActiveCharacterState(null); + setUserRole(null); } finally { setLoading(false); } } async function setActiveCharacter(characterId: string | null) { + setLoading(true); try { - console.log("Tentative de changement de personnage vers:", characterId); - setLoading(true); - const { data: { user } } = await supabase.auth.getUser(); - if (!user) throw new Error('Utilisateur non identifié'); - - const { data, error } = await supabase - .from('profiles') - .update({ active_character_id: characterId }) - .eq('id', user.id) - .select(); - - if (error) { - console.error("Erreur lors de l'update du profil:", error); - throw error; - } - - console.log("Profil mis à jour avec succès:", data); - - // On force le rafraîchissement immédiat - await refreshActiveCharacter(); - } catch (err) { - console.error('Erreur fatale setActiveCharacter:', err); - throw err; + const me = await apiMutate('/me/active-character', 'PUT', { + character_id: characterId, + }); + setUserRole(me.role ?? null); + setActiveCharacterState(me.active_character ?? null); } finally { setLoading(false); } @@ -128,4 +80,3 @@ export function useActiveCharacter() { } return context; } - diff --git a/front/src/shared/utils/api.ts b/front/src/shared/utils/api.ts index 54b039e..a693cb6 100644 --- a/front/src/shared/utils/api.ts +++ b/front/src/shared/utils/api.ts @@ -37,7 +37,7 @@ export async function apiFetch( headers.set('Accept', 'application/json'); } - if (options.body && !headers.has('Content-Type')) { + if (typeof options.body === 'string' && !headers.has('Content-Type')) { headers.set('Content-Type', 'application/json'); } @@ -71,6 +71,33 @@ export async function apiFetch( return data as T; } +/** + * Requête mutante (POST/PATCH/PUT/DELETE) : garantit le cookie CSRF Sanctum. + */ +export async function apiMutate( + path: string, + method: 'POST' | 'PATCH' | 'PUT' | 'DELETE', + payload?: unknown, +): Promise { + await ensureCsrfCookie(); + return apiFetch(path, { + method, + body: payload !== undefined ? JSON.stringify(payload) : undefined, + }); +} + +/** + * Upload d'un fichier image (multipart) vers l'API. Réservé aux admins. + */ +export async function uploadFile(file: File, folder: string): Promise<{ url: string }> { + await ensureCsrfCookie(); + const body = new FormData(); + body.append('file', file); + body.append('folder', folder); + + return apiFetch<{ url: string }>('/uploads', { method: 'POST', body }); +} + export async function registerUser(payload: { name: string; username: string; diff --git a/front/src/shared/utils/supabase-server.ts b/front/src/shared/utils/supabase-server.ts deleted file mode 100644 index 9cb657c..0000000 --- a/front/src/shared/utils/supabase-server.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { createServerClient, type CookieOptions } from '@supabase/ssr' -import { cookies } from 'next/headers' - -export async function createServerSupabaseClient() { - const cookieStore = await cookies() - - const supabaseUrl = process.env.SUPABASE_INTERNAL_URL || process.env.NEXT_PUBLIC_SUPABASE_URL; - - return createServerClient( - supabaseUrl || '', - process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY || '', - { - cookies: { - get(name: string) { - return cookieStore.get(name)?.value - }, - set(name: string, value: string, options: CookieOptions) { - try { - cookieStore.set({ name, value, ...options }) - } catch (error) { - // The `set` method was called from a Server Component. - // This can be ignored if you have middleware refreshing - // user sessions. - } - }, - remove(name: string, options: CookieOptions) { - try { - cookieStore.set({ name, value: '', ...options }) - } catch (error) { - // The `remove` method was called from a Server Component. - // This can be ignored if you have middleware refreshing - // user sessions. - } - }, - }, - } - ) -} - -// Version Admin pour la suppression de compte (nécessite SERVICE_ROLE_KEY) -export async function createAdminClient() { - return createServerClient( - process.env.NEXT_PUBLIC_SUPABASE_URL!, - process.env.SUPABASE_SERVICE_ROLE_KEY!, - { - cookies: { - get(name: string) { return undefined }, - set(name: string, value: string, options: CookieOptions) {}, - remove(name: string, options: CookieOptions) {}, - }, - } - ) -} diff --git a/front/src/shared/utils/supabase.ts b/front/src/shared/utils/supabase.ts deleted file mode 100644 index a4cbb3b..0000000 --- a/front/src/shared/utils/supabase.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { createBrowserClient } from '@supabase/ssr' - -let supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL; -if (supabaseUrl && supabaseUrl.includes('localhost')) { - supabaseUrl = supabaseUrl.replace('localhost', '127.0.0.1'); -} - -export const supabase = createBrowserClient( - supabaseUrl || '', - process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY || '' -) diff --git a/package-lock.json b/package-lock.json index 5e66766..9942e23 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,17 +37,10 @@ "name": "star-wars-roleplay-forum", "version": "0.0.0", "dependencies": { - "@google/generative-ai": "^0.24.1", - "@supabase/ssr": "^0.8.0", - "@supabase/supabase-js": "^2.39.0", "@tailwindcss/postcss": "latest", - "axios": "^1.13.2", - "cheerio": "^1.1.2", "clsx": "latest", - "dotenv": "^17.2.3", "lucide-react": "latest", "next": "latest", - "openai": "^6.15.0", "react": "latest", "react-dom": "latest", "react-markdown": "^10.1.0", @@ -61,467 +54,9 @@ "@types/react-dom": "latest", "autoprefixer": "latest", "postcss": "latest", - "tsx": "^4.19.2", "typescript": "~5.8.2" } }, - "front/node_modules/@esbuild/aix-ppc64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.2.tgz", - "integrity": "sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/android-arm": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.2.tgz", - "integrity": "sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/android-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.2.tgz", - "integrity": "sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/android-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.2.tgz", - "integrity": "sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/darwin-arm64": { - "version": "0.27.2", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/darwin-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.2.tgz", - "integrity": "sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/freebsd-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.2.tgz", - "integrity": "sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/freebsd-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.2.tgz", - "integrity": "sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/linux-arm": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.2.tgz", - "integrity": "sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/linux-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.2.tgz", - "integrity": "sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/linux-ia32": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.2.tgz", - "integrity": "sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/linux-loong64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.2.tgz", - "integrity": "sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/linux-mips64el": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.2.tgz", - "integrity": "sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/linux-ppc64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.2.tgz", - "integrity": "sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/linux-riscv64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.2.tgz", - "integrity": "sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/linux-s390x": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.2.tgz", - "integrity": "sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/linux-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.2.tgz", - "integrity": "sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/netbsd-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.2.tgz", - "integrity": "sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/netbsd-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.2.tgz", - "integrity": "sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/openbsd-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.2.tgz", - "integrity": "sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/openbsd-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.2.tgz", - "integrity": "sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/openharmony-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.2.tgz", - "integrity": "sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/sunos-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.2.tgz", - "integrity": "sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/win32-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.2.tgz", - "integrity": "sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/win32-ia32": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.2.tgz", - "integrity": "sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@esbuild/win32-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.2.tgz", - "integrity": "sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "front/node_modules/@google/generative-ai": { - "version": "0.24.1", - "license": "Apache-2.0", - "engines": { - "node": ">=18.0.0" - } - }, - "front/node_modules/@supabase/ssr": { - "version": "0.8.0", - "license": "MIT", - "dependencies": { - "cookie": "^1.0.2" - }, - "peerDependencies": { - "@supabase/supabase-js": "^2.76.1" - } - }, "front/node_modules/@types/debug": { "version": "4.1.12", "license": "MIT", @@ -578,10 +113,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "front/node_modules/boolbase": { - "version": "1.0.0", - "license": "ISC" - }, "front/node_modules/ccount": { "version": "2.0.1", "license": "MIT", @@ -622,44 +153,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "front/node_modules/cheerio": { - "version": "1.1.2", - "license": "MIT", - "dependencies": { - "cheerio-select": "^2.1.0", - "dom-serializer": "^2.0.0", - "domhandler": "^5.0.3", - "domutils": "^3.2.2", - "encoding-sniffer": "^0.2.1", - "htmlparser2": "^10.0.0", - "parse5": "^7.3.0", - "parse5-htmlparser2-tree-adapter": "^7.1.0", - "parse5-parser-stream": "^7.1.2", - "undici": "^7.12.0", - "whatwg-mimetype": "^4.0.0" - }, - "engines": { - "node": ">=20.18.1" - }, - "funding": { - "url": "https://github.com/cheeriojs/cheerio?sponsor=1" - } - }, - "front/node_modules/cheerio-select": { - "version": "2.1.0", - "license": "BSD-2-Clause", - "dependencies": { - "boolbase": "^1.0.0", - "css-select": "^5.1.0", - "css-what": "^6.1.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, "front/node_modules/comma-separated-tokens": { "version": "2.0.3", "license": "MIT", @@ -668,41 +161,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "front/node_modules/cookie": { - "version": "1.1.1", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "front/node_modules/css-select": { - "version": "5.2.2", - "license": "BSD-2-Clause", - "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^6.1.0", - "domhandler": "^5.0.2", - "domutils": "^3.0.1", - "nth-check": "^2.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "front/node_modules/css-what": { - "version": "6.2.2", - "license": "BSD-2-Clause", - "engines": { - "node": ">= 6" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, "front/node_modules/decode-named-character-reference": { "version": "1.2.0", "license": "MIT", @@ -732,124 +190,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "front/node_modules/dom-serializer": { - "version": "2.0.0", - "license": "MIT", - "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "entities": "^4.2.0" - }, - "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" - } - }, - "front/node_modules/domelementtype": { - "version": "2.3.0", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ], - "license": "BSD-2-Clause" - }, - "front/node_modules/domhandler": { - "version": "5.0.3", - "license": "BSD-2-Clause", - "dependencies": { - "domelementtype": "^2.3.0" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" - } - }, - "front/node_modules/domutils": { - "version": "3.2.2", - "license": "BSD-2-Clause", - "dependencies": { - "dom-serializer": "^2.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3" - }, - "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" - } - }, - "front/node_modules/dotenv": { - "version": "17.2.3", - "license": "BSD-2-Clause", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://dotenvx.com" - } - }, - "front/node_modules/encoding-sniffer": { - "version": "0.2.1", - "license": "MIT", - "dependencies": { - "iconv-lite": "^0.6.3", - "whatwg-encoding": "^3.1.1" - }, - "funding": { - "url": "https://github.com/fb55/encoding-sniffer?sponsor=1" - } - }, - "front/node_modules/entities": { - "version": "4.5.0", - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, - "front/node_modules/esbuild": { - "version": "0.27.2", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.27.2", - "@esbuild/android-arm": "0.27.2", - "@esbuild/android-arm64": "0.27.2", - "@esbuild/android-x64": "0.27.2", - "@esbuild/darwin-arm64": "0.27.2", - "@esbuild/darwin-x64": "0.27.2", - "@esbuild/freebsd-arm64": "0.27.2", - "@esbuild/freebsd-x64": "0.27.2", - "@esbuild/linux-arm": "0.27.2", - "@esbuild/linux-arm64": "0.27.2", - "@esbuild/linux-ia32": "0.27.2", - "@esbuild/linux-loong64": "0.27.2", - "@esbuild/linux-mips64el": "0.27.2", - "@esbuild/linux-ppc64": "0.27.2", - "@esbuild/linux-riscv64": "0.27.2", - "@esbuild/linux-s390x": "0.27.2", - "@esbuild/linux-x64": "0.27.2", - "@esbuild/netbsd-arm64": "0.27.2", - "@esbuild/netbsd-x64": "0.27.2", - "@esbuild/openbsd-arm64": "0.27.2", - "@esbuild/openbsd-x64": "0.27.2", - "@esbuild/openharmony-arm64": "0.27.2", - "@esbuild/sunos-x64": "0.27.2", - "@esbuild/win32-arm64": "0.27.2", - "@esbuild/win32-ia32": "0.27.2", - "@esbuild/win32-x64": "0.27.2" - } - }, "front/node_modules/escape-string-regexp": { "version": "5.0.0", "license": "MIT", @@ -872,17 +212,6 @@ "version": "3.0.2", "license": "MIT" }, - "front/node_modules/get-tsconfig": { - "version": "4.13.0", - "dev": true, - "license": "MIT", - "dependencies": { - "resolve-pkg-maps": "^1.0.0" - }, - "funding": { - "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" - } - }, "front/node_modules/hast-util-to-jsx-runtime": { "version": "2.3.6", "license": "MIT", @@ -911,57 +240,20 @@ "front/node_modules/hast-util-whitespace": { "version": "3.0.0", "license": "MIT", - "dependencies": { - "@types/hast": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "front/node_modules/html-url-attributes": { - "version": "3.0.1", - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "front/node_modules/htmlparser2": { - "version": "10.0.0", - "funding": [ - "https://github.com/fb55/htmlparser2?sponsor=1", - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ], - "license": "MIT", - "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.2.1", - "entities": "^6.0.0" - } - }, - "front/node_modules/htmlparser2/node_modules/entities": { - "version": "6.0.1", - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.12" + "dependencies": { + "@types/hast": "^3.0.0" }, "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "front/node_modules/iconv-lite": { - "version": "0.6.3", + "front/node_modules/html-url-attributes": { + "version": "3.0.1", "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, "front/node_modules/inline-style-parser": { @@ -1777,35 +1069,6 @@ ], "license": "MIT" }, - "front/node_modules/nth-check": { - "version": "2.1.1", - "license": "BSD-2-Clause", - "dependencies": { - "boolbase": "^1.0.0" - }, - "funding": { - "url": "https://github.com/fb55/nth-check?sponsor=1" - } - }, - "front/node_modules/openai": { - "version": "6.15.0", - "license": "Apache-2.0", - "bin": { - "openai": "bin/cli" - }, - "peerDependencies": { - "ws": "^8.18.0", - "zod": "^3.25 || ^4.0" - }, - "peerDependenciesMeta": { - "ws": { - "optional": true - }, - "zod": { - "optional": true - } - } - }, "front/node_modules/parse-entities": { "version": "4.0.2", "license": "MIT", @@ -1827,47 +1090,6 @@ "version": "2.0.11", "license": "MIT" }, - "front/node_modules/parse5": { - "version": "7.3.0", - "license": "MIT", - "dependencies": { - "entities": "^6.0.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, - "front/node_modules/parse5-htmlparser2-tree-adapter": { - "version": "7.1.0", - "license": "MIT", - "dependencies": { - "domhandler": "^5.0.3", - "parse5": "^7.0.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, - "front/node_modules/parse5-parser-stream": { - "version": "7.1.2", - "license": "MIT", - "dependencies": { - "parse5": "^7.0.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, - "front/node_modules/parse5/node_modules/entities": { - "version": "6.0.1", - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "front/node_modules/property-information": { "version": "7.1.0", "license": "MIT", @@ -1959,18 +1181,6 @@ "url": "https://opencollective.com/unified" } }, - "front/node_modules/resolve-pkg-maps": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" - } - }, - "front/node_modules/safer-buffer": { - "version": "2.1.2", - "license": "MIT" - }, "front/node_modules/space-separated-tokens": { "version": "2.0.2", "license": "MIT", @@ -2021,24 +1231,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "front/node_modules/tsx": { - "version": "4.21.0", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild": "~0.27.0", - "get-tsconfig": "^4.7.5" - }, - "bin": { - "tsx": "dist/cli.mjs" - }, - "engines": { - "node": ">=18.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - } - }, "front/node_modules/typescript": { "version": "5.8.3", "dev": true, @@ -2051,13 +1243,6 @@ "node": ">=14.17" } }, - "front/node_modules/undici": { - "version": "7.16.0", - "license": "MIT", - "engines": { - "node": ">=20.18.1" - } - }, "front/node_modules/undici-types": { "version": "6.21.0", "dev": true, @@ -2162,23 +1347,6 @@ "url": "https://opencollective.com/unified" } }, - "front/node_modules/whatwg-encoding": { - "version": "3.1.1", - "license": "MIT", - "dependencies": { - "iconv-lite": "0.6.3" - }, - "engines": { - "node": ">=18" - } - }, - "front/node_modules/whatwg-mimetype": { - "version": "4.0.0", - "license": "MIT", - "engines": { - "node": ">=18" - } - }, "front/node_modules/zwitch": { "version": "2.0.4", "license": "MIT", @@ -3240,24 +2408,6 @@ "@types/react": "^19.2.0" } }, - "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "license": "MIT", - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "license": "MIT" - }, "node_modules/autoprefixer": { "version": "10.5.2", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.5.2.tgz", @@ -3295,18 +2445,6 @@ "postcss": "^8.1.0" } }, - "node_modules/axios": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.18.1.tgz", - "integrity": "sha512-3nTvFlvpn9Zu/RkHUqtc7/+al4UpRW5az71ap5zccp6e8RAYEzhMTecX8Dz1wWDYrPpUoB1HAQEGEAEvUr7S9g==", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.16.0", - "form-data": "^4.0.5", - "https-proxy-agent": "^5.0.1", - "proxy-from-env": "^2.1.0" - } - }, "node_modules/baseline-browser-mapping": { "version": "2.10.40", "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.40.tgz", @@ -3354,19 +2492,6 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/caniuse-lite": { "version": "1.0.30001800", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001800.tgz", @@ -3402,18 +2527,6 @@ "node": ">=6" } }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "license": "MIT", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/csstype": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", @@ -3437,15 +2550,6 @@ } } }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/detect-libc": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", @@ -3455,20 +2559,6 @@ "node": ">=8" } }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/electron-to-chromium": { "version": "1.5.382", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.382.tgz", @@ -3489,51 +2579,6 @@ "node": ">=10.13.0" } }, - "node_modules/es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-object-atoms": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", - "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-set-tostringtag": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", - "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -3544,42 +2589,6 @@ "node": ">=6" } }, - "node_modules/follow-redirects": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz", - "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "license": "MIT", - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/form-data": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", - "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.4", - "mime-types": "^2.1.35" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/fraction.js": { "version": "5.3.4", "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-5.3.4.tgz", @@ -3594,137 +2603,12 @@ "url": "https://github.com/sponsors/rawify" } }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-intrinsic": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "function-bind": "^1.1.2", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "license": "MIT", - "dependencies": { - "dunder-proto": "^1.0.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "license": "ISC" }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "license": "MIT", - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", - "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "license": "MIT", - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/iceberg-js": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/iceberg-js/-/iceberg-js-0.8.1.tgz", @@ -4010,36 +2894,6 @@ "@jridgewell/sourcemap-codec": "^1.5.5" } }, - "node_modules/math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -4197,15 +3051,6 @@ "dev": true, "license": "MIT" }, - "node_modules/proxy-from-env": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz", - "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==", - "license": "MIT", - "engines": { - "node": ">=10" - } - }, "node_modules/react": { "version": "19.2.7", "resolved": "https://registry.npmjs.org/react/-/react-19.2.7.tgz", @@ -4347,8 +3192,7 @@ "version": "4.3.2", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.2.tgz", "integrity": "sha512-WtctNNSH8A9jlMIqxzuYumOHU5uGZyRv0Q5svQl+oEPy5w84YpBxdb7MdqyiSPQge5jTJ6zFQLq0PFygdccSBA==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/tapable": { "version": "2.3.3", @@ -4375,7 +3219,6 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/package.json b/package.json index 38f2a3e..a9ebbe9 100644 --- a/package.json +++ b/package.json @@ -6,22 +6,18 @@ "node": ">=20" }, "workspaces": [ - "front", - "back" + "front" ], "scripts": { "dev:api": "composer dev -d api", "dev:front": "npm run dev -w front", - "dev:back": "npm run dev -w back", "lint": "npm run lint -w front", - "lint:front": "npm run lint -w front", + "test:api": "cd api && php artisan test", "setup": "composer install -d api && npm install && npm run setup:env", - "setup:env": "test -f .env || cp .env.example .env; test -f api/.env || cp api/.env.example api/.env; test -f docker/supabase/.env || cp docker/supabase/env.example docker/supabase/.env; test -f front/.env.local || cp front/env.local.example front/.env.local; test -f back/.env.local || cp back/env.local.example back/.env.local", + "setup:env": "test -f .env || cp .env.example .env; test -f api/.env || cp api/.env.example api/.env; test -f front/.env.local || cp front/env.local.example front/.env.local", "docker:up": "docker compose up -d", "docker:down": "docker compose down", "docker:logs": "docker compose logs -f", - "docker:supabase:up": "docker compose -f docker/supabase/docker-compose.yml --env-file docker/supabase/.env up -d", - "docker:supabase:down": "docker compose -f docker/supabase/docker-compose.yml --env-file docker/supabase/.env down", "docker:prod:up": "docker compose -f docker-compose.prod.yml --env-file .env.production up -d --build", "docker:prod:down": "docker compose -f docker-compose.prod.yml --env-file .env.production down", "docker:prod:logs": "docker compose -f docker-compose.prod.yml --env-file .env.production logs -f" diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 5f0c873..2164a1c 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -12,8 +12,8 @@ rsync -avz --delete \ --exclude .git \ --exclude '*.local' \ --exclude .env \ - --exclude docker/supabase/volumes/db/data \ - --exclude docker/supabase/volumes/storage \ + --exclude api/vendor \ + --exclude api/storage/logs \ "$ROOT/" "$REMOTE:$DEST/" echo "→ Build et redémarrage Docker (production)" diff --git a/supabase/.gitignore b/supabase/.gitignore deleted file mode 100644 index ad9264f..0000000 --- a/supabase/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Supabase -.branches -.temp - -# dotenvx -.env.keys -.env.local -.env.*.local diff --git a/supabase/config.toml b/supabase/config.toml deleted file mode 100644 index b21a062..0000000 --- a/supabase/config.toml +++ /dev/null @@ -1,382 +0,0 @@ -# For detailed configuration reference documentation, visit: -# https://supabase.com/docs/guides/local-development/cli/config -# A string used to distinguish different Supabase projects on the same host. Defaults to the -# working directory name when running `supabase init`. -project_id = "swor-v2" - -[api] -enabled = true -# Port to use for the API URL. -port = 54321 -# Schemas to expose in your API. Tables, views and stored procedures in this schema will get API -# endpoints. `public` and `graphql_public` schemas are included by default. -schemas = ["public", "graphql_public"] -# Extra schemas to add to the search_path of every request. -extra_search_path = ["public", "extensions"] -# The maximum number of rows returns from a view, table, or stored procedure. Limits payload size -# for accidental or malicious requests. -max_rows = 1000 - -[api.tls] -# Enable HTTPS endpoints locally using a self-signed certificate. -enabled = false -# Paths to self-signed certificate pair. -# cert_path = "../certs/my-cert.pem" -# key_path = "../certs/my-key.pem" - -[db] -# Port to use for the local database URL. -port = 54322 -# Port used by db diff command to initialize the shadow database. -shadow_port = 54320 -# The database major version to use. This has to be the same as your remote database's. Run `SHOW -# server_version;` on the remote database to check. -major_version = 17 - -[db.pooler] -enabled = false -# Port to use for the local connection pooler. -port = 54329 -# Specifies when a server connection can be reused by other clients. -# Configure one of the supported pooler modes: `transaction`, `session`. -pool_mode = "transaction" -# How many server connections to allow per user/database pair. -default_pool_size = 20 -# Maximum number of client connections allowed. -max_client_conn = 100 - -# [db.vault] -# secret_key = "env(SECRET_VALUE)" - -[db.migrations] -# If disabled, migrations will be skipped during a db push or reset. -enabled = true -# Specifies an ordered list of schema files that describe your database. -# Supports glob patterns relative to supabase directory: "./schemas/*.sql" -schema_paths = [] - -[db.seed] -# If enabled, seeds the database after migrations during a db reset. -enabled = true -# Specifies an ordered list of seed files to load during db reset. -# Supports glob patterns relative to supabase directory: "./seeds/*.sql" -sql_paths = ["./seeds/*.sql"] - -[db.network_restrictions] -# Enable management of network restrictions. -enabled = false -# List of IPv4 CIDR blocks allowed to connect to the database. -# Defaults to allow all IPv4 connections. Set empty array to block all IPs. -allowed_cidrs = ["0.0.0.0/0"] -# List of IPv6 CIDR blocks allowed to connect to the database. -# Defaults to allow all IPv6 connections. Set empty array to block all IPs. -allowed_cidrs_v6 = ["::/0"] - -[realtime] -enabled = true -# Bind realtime via either IPv4 or IPv6. (default: IPv4) -# ip_version = "IPv6" -# The maximum length in bytes of HTTP request headers. (default: 4096) -# max_header_length = 4096 - -[studio] -enabled = true -# Port to use for Supabase Studio. -port = 54323 -# External URL of the API server that frontend connects to. -api_url = "http://127.0.0.1" -# OpenAI API Key to use for Supabase AI in the Supabase Studio. -openai_api_key = "env(OPENAI_API_KEY)" - -# Email testing server. Emails sent with the local dev setup are not actually sent - rather, they -# are monitored, and you can view the emails that would have been sent from the web interface. -[inbucket] -enabled = true -# Port to use for the email testing server web interface. -port = 54324 -# Uncomment to expose additional ports for testing user applications that send emails. -# smtp_port = 54325 -# pop3_port = 54326 -# admin_email = "admin@email.com" -# sender_name = "Admin" - -[storage] -enabled = true -# The maximum file size allowed (e.g. "5MB", "500KB"). -file_size_limit = "50MiB" - -# Uncomment to configure local storage buckets -# [storage.buckets.images] -# public = false -# file_size_limit = "50MiB" -# allowed_mime_types = ["image/png", "image/jpeg"] -# objects_path = "./images" - -# Allow connections via S3 compatible clients -[storage.s3_protocol] -enabled = true - -# Image transformation API is available to Supabase Pro plan. -# [storage.image_transformation] -# enabled = true - -# Store analytical data in S3 for running ETL jobs over Iceberg Catalog -# This feature is only available on the hosted platform. -[storage.analytics] -enabled = false -max_namespaces = 5 -max_tables = 10 -max_catalogs = 2 - -# Analytics Buckets is available to Supabase Pro plan. -# [storage.analytics.buckets.my-warehouse] - -# Store vector embeddings in S3 for large and durable datasets -# This feature is only available on the hosted platform. -[storage.vector] -enabled = false -max_buckets = 10 -max_indexes = 5 - -# Vector Buckets is available to Supabase Pro plan. -# [storage.vector.buckets.documents-openai] - -[auth] -enabled = true -# The base URL of your website. Used as an allow-list for redirects and for constructing URLs used -# in emails. -site_url = "http://127.0.0.1:3000" -# A list of *exact* URLs that auth providers are permitted to redirect to post authentication. -additional_redirect_urls = ["https://127.0.0.1:3000"] -# How long tokens are valid for, in seconds. Defaults to 3600 (1 hour), maximum 604,800 (1 week). -jwt_expiry = 3600 -# JWT issuer URL. If not set, defaults to the local API URL (http://127.0.0.1:/auth/v1). -# jwt_issuer = "" -# Path to JWT signing key. DO NOT commit your signing keys file to git. -# signing_keys_path = "./signing_keys.json" -# If disabled, the refresh token will never expire. -enable_refresh_token_rotation = true -# Allows refresh tokens to be reused after expiry, up to the specified interval in seconds. -# Requires enable_refresh_token_rotation = true. -refresh_token_reuse_interval = 10 -# Allow/disallow new user signups to your project. -enable_signup = true -# Allow/disallow anonymous sign-ins to your project. -enable_anonymous_sign_ins = false -# Allow/disallow testing manual linking of accounts -enable_manual_linking = false -# Passwords shorter than this value will be rejected as weak. Minimum 6, recommended 8 or more. -minimum_password_length = 6 -# Passwords that do not meet the following requirements will be rejected as weak. Supported values -# are: `letters_digits`, `lower_upper_letters_digits`, `lower_upper_letters_digits_symbols` -password_requirements = "" - -[auth.rate_limit] -# Number of emails that can be sent per hour. Requires auth.email.smtp to be enabled. -email_sent = 2 -# Number of SMS messages that can be sent per hour. Requires auth.sms to be enabled. -sms_sent = 30 -# Number of anonymous sign-ins that can be made per hour per IP address. Requires enable_anonymous_sign_ins = true. -anonymous_users = 30 -# Number of sessions that can be refreshed in a 5 minute interval per IP address. -token_refresh = 150 -# Number of sign up and sign-in requests that can be made in a 5 minute interval per IP address (excludes anonymous users). -sign_in_sign_ups = 30 -# Number of OTP / Magic link verifications that can be made in a 5 minute interval per IP address. -token_verifications = 30 -# Number of Web3 logins that can be made in a 5 minute interval per IP address. -web3 = 30 - -# Configure one of the supported captcha providers: `hcaptcha`, `turnstile`. -# [auth.captcha] -# enabled = true -# provider = "hcaptcha" -# secret = "" - -[auth.email] -# Allow/disallow new user signups via email to your project. -enable_signup = true -# If enabled, a user will be required to confirm any email change on both the old, and new email -# addresses. If disabled, only the new email is required to confirm. -double_confirm_changes = true -# If enabled, users need to confirm their email address before signing in. -enable_confirmations = false -# If enabled, users will need to reauthenticate or have logged in recently to change their password. -secure_password_change = false -# Controls the minimum amount of time that must pass before sending another signup confirmation or password reset email. -max_frequency = "1s" -# Number of characters used in the email OTP. -otp_length = 6 -# Number of seconds before the email OTP expires (defaults to 1 hour). -otp_expiry = 3600 - -# Use a production-ready SMTP server -# [auth.email.smtp] -# enabled = true -# host = "smtp.sendgrid.net" -# port = 587 -# user = "apikey" -# pass = "env(SENDGRID_API_KEY)" -# admin_email = "admin@email.com" -# sender_name = "Admin" - -# Uncomment to customize email template -# [auth.email.template.invite] -# subject = "You have been invited" -# content_path = "./supabase/templates/invite.html" - -# Uncomment to customize notification email template -# [auth.email.notification.password_changed] -# enabled = true -# subject = "Your password has been changed" -# content_path = "./templates/password_changed_notification.html" - -[auth.sms] -# Allow/disallow new user signups via SMS to your project. -enable_signup = false -# If enabled, users need to confirm their phone number before signing in. -enable_confirmations = false -# Template for sending OTP to users -template = "Your code is {{ .Code }}" -# Controls the minimum amount of time that must pass before sending another sms otp. -max_frequency = "5s" - -# Use pre-defined map of phone number to OTP for testing. -# [auth.sms.test_otp] -# 4152127777 = "123456" - -# Configure logged in session timeouts. -# [auth.sessions] -# Force log out after the specified duration. -# timebox = "24h" -# Force log out if the user has been inactive longer than the specified duration. -# inactivity_timeout = "8h" - -# This hook runs before a new user is created and allows developers to reject the request based on the incoming user object. -# [auth.hook.before_user_created] -# enabled = true -# uri = "pg-functions://postgres/auth/before-user-created-hook" - -# This hook runs before a token is issued and allows you to add additional claims based on the authentication method used. -# [auth.hook.custom_access_token] -# enabled = true -# uri = "pg-functions:////" - -# Configure one of the supported SMS providers: `twilio`, `twilio_verify`, `messagebird`, `textlocal`, `vonage`. -[auth.sms.twilio] -enabled = false -account_sid = "" -message_service_sid = "" -# DO NOT commit your Twilio auth token to git. Use environment variable substitution instead: -auth_token = "env(SUPABASE_AUTH_SMS_TWILIO_AUTH_TOKEN)" - -# Multi-factor-authentication is available to Supabase Pro plan. -[auth.mfa] -# Control how many MFA factors can be enrolled at once per user. -max_enrolled_factors = 10 - -# Control MFA via App Authenticator (TOTP) -[auth.mfa.totp] -enroll_enabled = false -verify_enabled = false - -# Configure MFA via Phone Messaging -[auth.mfa.phone] -enroll_enabled = false -verify_enabled = false -otp_length = 6 -template = "Your code is {{ .Code }}" -max_frequency = "5s" - -# Configure MFA via WebAuthn -# [auth.mfa.web_authn] -# enroll_enabled = true -# verify_enabled = true - -# Use an external OAuth provider. The full list of providers are: `apple`, `azure`, `bitbucket`, -# `discord`, `facebook`, `github`, `gitlab`, `google`, `keycloak`, `linkedin_oidc`, `notion`, `twitch`, -# `twitter`, `x`, `slack`, `spotify`, `workos`, `zoom`. -[auth.external.apple] -enabled = false -client_id = "" -# DO NOT commit your OAuth provider secret to git. Use environment variable substitution instead: -secret = "env(SUPABASE_AUTH_EXTERNAL_APPLE_SECRET)" -# Overrides the default auth redirectUrl. -redirect_uri = "" -# Overrides the default auth provider URL. Used to support self-hosted gitlab, single-tenant Azure, -# or any other third-party OIDC providers. -url = "" -# If enabled, the nonce check will be skipped. Required for local sign in with Google auth. -skip_nonce_check = false -# If enabled, it will allow the user to successfully authenticate when the provider does not return an email address. -email_optional = false - -# Allow Solana wallet holders to sign in to your project via the Sign in with Solana (SIWS, EIP-4361) standard. -# You can configure "web3" rate limit in the [auth.rate_limit] section and set up [auth.captcha] if self-hosting. -[auth.web3.solana] -enabled = false - -# Use Firebase Auth as a third-party provider alongside Supabase Auth. -[auth.third_party.firebase] -enabled = false -# project_id = "my-firebase-project" - -# Use Auth0 as a third-party provider alongside Supabase Auth. -[auth.third_party.auth0] -enabled = false -# tenant = "my-auth0-tenant" -# tenant_region = "us" - -# Use AWS Cognito (Amplify) as a third-party provider alongside Supabase Auth. -[auth.third_party.aws_cognito] -enabled = false -# user_pool_id = "my-user-pool-id" -# user_pool_region = "us-east-1" - -# Use Clerk as a third-party provider alongside Supabase Auth. -[auth.third_party.clerk] -enabled = false -# Obtain from https://clerk.com/setup/supabase -# domain = "example.clerk.accounts.dev" - -# OAuth server configuration -[auth.oauth_server] -# Enable OAuth server functionality -enabled = false -# Path for OAuth consent flow UI -authorization_url_path = "/oauth/consent" -# Allow dynamic client registration -allow_dynamic_registration = false - -[edge_runtime] -enabled = true -# Supported request policies: `oneshot`, `per_worker`. -# `per_worker` (default) — enables hot reload during local development. -# `oneshot` — fallback mode if hot reload causes issues (e.g. in large repos or with symlinks). -policy = "per_worker" -# Port to attach the Chrome inspector for debugging edge functions. -inspector_port = 8083 -# The Deno major version to use. -deno_version = 2 - -# [edge_runtime.secrets] -# secret_key = "env(SECRET_VALUE)" - -[analytics] -enabled = true -port = 54327 -# Configure one of the supported backends: `postgres`, `bigquery`. -backend = "postgres" - -# Experimental features may be deprecated any time -[experimental] -# Configures Postgres storage engine to use OrioleDB (S3) -orioledb_version = "" -# Configures S3 bucket URL, eg. .s3-.amazonaws.com -s3_host = "env(S3_HOST)" -# Configures S3 bucket region, eg. us-east-1 -s3_region = "env(S3_REGION)" -# Configures AWS_ACCESS_KEY_ID for S3 bucket -s3_access_key = "env(S3_ACCESS_KEY)" -# Configures AWS_SECRET_ACCESS_KEY for S3 bucket -s3_secret_key = "env(S3_SECRET_KEY)" diff --git a/supabase/migrations/20240101000000_core_schema.sql b/supabase/migrations/20240101000000_core_schema.sql deleted file mode 100644 index da62893..0000000 --- a/supabase/migrations/20240101000000_core_schema.sql +++ /dev/null @@ -1,348 +0,0 @@ --- ============================================ --- EXTENSIONS --- ============================================ -CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; - --- ============================================ --- ENUMS --- ============================================ -DO $$ BEGIN - CREATE TYPE public.item_type AS ENUM ('weapon', 'armor', 'consumable', 'tool', 'misc'); -EXCEPTION WHEN duplicate_object THEN null; END $$; - -DO $$ BEGIN - CREATE TYPE public.item_rarity AS ENUM ('common', 'uncommon', 'rare', 'epic', 'legendary'); -EXCEPTION WHEN duplicate_object THEN null; END $$; - -DO $$ BEGIN - CREATE TYPE public.economy_type AS ENUM ('income', 'expense'); -EXCEPTION WHEN duplicate_object THEN null; END $$; - -DO $$ BEGIN - CREATE TYPE public.ship_module_type AS ENUM ('engine', 'shield', 'weapon', 'utility'); -EXCEPTION WHEN duplicate_object THEN null; END $$; - -DO $$ BEGIN - CREATE TYPE public.ship_module_status AS ENUM ('active', 'damaged', 'offline'); -EXCEPTION WHEN duplicate_object THEN null; END $$; - -DO $$ BEGIN - CREATE TYPE public.forum_type AS ENUM ('category', 'region', 'sector', 'planet', 'location', 'forum'); -EXCEPTION WHEN duplicate_object THEN null; END $$; - -DO $$ BEGIN - CREATE TYPE public.user_role AS ENUM ('user', 'moderator', 'admin', 'game_master'); -EXCEPTION WHEN duplicate_object THEN null; END $$; - --- ============================================ --- TABLES --- ============================================ - --- PROFILES -CREATE TABLE IF NOT EXISTS public.profiles ( - id UUID PRIMARY KEY REFERENCES auth.users(id) ON DELETE CASCADE, - username TEXT UNIQUE, - avatar_url TEXT, - role public.user_role DEFAULT 'user', - active_character_id UUID, -- Ajouté plus tard dans les migrations - created_at TIMESTAMPTZ DEFAULT NOW(), - updated_at TIMESTAMPTZ DEFAULT NOW() -); - --- FORUM CATEGORIES -CREATE TABLE IF NOT EXISTS public.forum_categories ( - id SERIAL PRIMARY KEY, - name TEXT NOT NULL, - description TEXT, - era TEXT, - required_role public.user_role, - display_order INTEGER DEFAULT 0, - image_url TEXT, - created_at TIMESTAMPTZ DEFAULT NOW() -); - --- FORUMS -CREATE TABLE IF NOT EXISTS public.forums ( - id SERIAL PRIMARY KEY, - category_id INTEGER REFERENCES public.forum_categories(id) ON DELETE SET NULL, - parent_id INTEGER REFERENCES public.forums(id) ON DELETE CASCADE, - name TEXT NOT NULL, - description TEXT, - type public.forum_type NOT NULL, - coordinates JSONB, - image_url TEXT, - header_image_url TEXT, - required_role public.user_role, - display_order INTEGER DEFAULT 0, - topics_count INTEGER DEFAULT 0, - posts_count INTEGER DEFAULT 0, - created_at TIMESTAMPTZ DEFAULT NOW(), - updated_at TIMESTAMPTZ DEFAULT NOW() -); - --- GROUPS (Système de factions) -CREATE TABLE IF NOT EXISTS public.groups ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - name TEXT NOT NULL, - description TEXT, - color TEXT, - is_official BOOLEAN DEFAULT FALSE, - created_at TIMESTAMPTZ DEFAULT NOW() -); - --- CHARACTERS -CREATE TABLE IF NOT EXISTS public.characters ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - user_id UUID NOT NULL REFERENCES public.profiles(id) ON DELETE CASCADE, - name TEXT NOT NULL, - title TEXT, - class TEXT NOT NULL, - faction TEXT NOT NULL, - species TEXT DEFAULT 'Humain', - era TEXT NOT NULL DEFAULT 'Guerre Civile', - occupation_category TEXT DEFAULT 'Civil', - avatar TEXT, - credits INTEGER DEFAULT 2000, - main_group_id UUID REFERENCES public.groups(id) ON DELETE SET NULL, - current_location_id INTEGER REFERENCES public.forums(id), - is_traveling BOOLEAN DEFAULT FALSE, - travel_start_time TIMESTAMPTZ, - travel_end_time TIMESTAMPTZ, - travel_origin_id INTEGER REFERENCES public.forums(id), - travel_destination_id INTEGER REFERENCES public.forums(id), - hrp_notes TEXT, - is_active BOOLEAN DEFAULT TRUE, - created_at TIMESTAMPTZ DEFAULT NOW(), - updated_at TIMESTAMPTZ DEFAULT NOW() -); - --- TOPICS -CREATE TABLE IF NOT EXISTS public.topics ( - id SERIAL PRIMARY KEY, - forum_id INTEGER NOT NULL REFERENCES public.forums(id) ON DELETE CASCADE, - author_id UUID NOT NULL REFERENCES public.profiles(id) ON DELETE CASCADE, - character_id UUID REFERENCES public.characters(id) ON DELETE SET NULL, - title TEXT NOT NULL, - replies_count INTEGER DEFAULT 0, - views_count INTEGER DEFAULT 0, - is_pinned BOOLEAN DEFAULT FALSE, - is_locked BOOLEAN DEFAULT FALSE, - last_post_id INTEGER, - created_at TIMESTAMPTZ DEFAULT NOW(), - updated_at TIMESTAMPTZ DEFAULT NOW() -); - --- POSTS -CREATE TABLE IF NOT EXISTS public.posts ( - id SERIAL PRIMARY KEY, - topic_id INTEGER NOT NULL REFERENCES public.topics(id) ON DELETE CASCADE, - author_id UUID NOT NULL REFERENCES public.profiles(id) ON DELETE CASCADE, - character_id UUID REFERENCES public.characters(id) ON DELETE SET NULL, - content TEXT NOT NULL, - created_at TIMESTAMPTZ DEFAULT NOW(), - updated_at TIMESTAMPTZ DEFAULT NOW() -); - --- CHAT -CREATE TABLE IF NOT EXISTS public.chat_messages ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - user_id UUID NOT NULL REFERENCES public.profiles(id) ON DELETE CASCADE, - character_id UUID REFERENCES public.characters(id) ON DELETE SET NULL, - text TEXT NOT NULL, - created_at TIMESTAMPTZ DEFAULT NOW() -); - --- ECONOMY -CREATE TABLE IF NOT EXISTS public.items_catalog ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - name TEXT NOT NULL, - description TEXT, - weight DECIMAL(10, 2) NOT NULL, - type public.item_type NOT NULL, - rarity public.item_rarity NOT NULL, - base_price INTEGER, - created_at TIMESTAMPTZ DEFAULT NOW() -); - -CREATE TABLE IF NOT EXISTS public.character_inventory ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - character_id UUID NOT NULL REFERENCES public.characters(id) ON DELETE CASCADE, - item_id UUID NOT NULL REFERENCES public.items_catalog(id) ON DELETE CASCADE, - quantity INTEGER DEFAULT 1, - acquired_at TIMESTAMPTZ DEFAULT NOW(), - UNIQUE(character_id, item_id) -); - -CREATE TABLE IF NOT EXISTS public.economy_history ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - character_id UUID NOT NULL REFERENCES public.characters(id) ON DELETE CASCADE, - date DATE NOT NULL DEFAULT CURRENT_DATE, - description TEXT NOT NULL, - amount INTEGER NOT NULL, - type public.economy_type NOT NULL, - created_at TIMESTAMPTZ DEFAULT NOW() -); - --- SHIPS -CREATE TABLE IF NOT EXISTS public.ships ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - character_id UUID UNIQUE REFERENCES public.characters(id) ON DELETE CASCADE, - name TEXT NOT NULL, - model TEXT NOT NULL, - cargo_capacity INTEGER NOT NULL, - current_cargo_weight INTEGER DEFAULT 0, - created_at TIMESTAMPTZ DEFAULT NOW(), - updated_at TIMESTAMPTZ DEFAULT NOW() -); - -CREATE TABLE IF NOT EXISTS public.ship_modules ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - ship_id UUID NOT NULL REFERENCES public.ships(id) ON DELETE CASCADE, - name TEXT NOT NULL, - type public.ship_module_type NOT NULL, - status public.ship_module_status DEFAULT 'active', - stats JSONB DEFAULT '{}', - created_at TIMESTAMPTZ DEFAULT NOW() -); - --- WIKI -CREATE TABLE IF NOT EXISTS public.wiki_categories ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - title TEXT NOT NULL, - icon TEXT, - display_order INTEGER DEFAULT 0, - created_at TIMESTAMPTZ DEFAULT NOW() -); - -CREATE TABLE IF NOT EXISTS public.wiki_sub_categories ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - category_id UUID NOT NULL REFERENCES public.wiki_categories(id) ON DELETE CASCADE, - title TEXT NOT NULL, - display_order INTEGER DEFAULT 0, - created_at TIMESTAMPTZ DEFAULT NOW() -); - -CREATE TABLE IF NOT EXISTS public.wiki_articles ( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - sub_category_id UUID REFERENCES public.wiki_sub_categories(id) ON DELETE SET NULL, - title TEXT NOT NULL, - excerpt TEXT, - content TEXT NOT NULL, - metadata JSONB DEFAULT '{}', - category TEXT, - image TEXT, - related_articles UUID[] DEFAULT ARRAY[]::UUID[], - created_at TIMESTAMPTZ DEFAULT NOW(), - updated_at TIMESTAMPTZ DEFAULT NOW() -); - --- ============================================ --- SECURITY (RLS) --- ============================================ -ALTER TABLE public.profiles ENABLE ROW LEVEL SECURITY; -ALTER TABLE public.characters ENABLE ROW LEVEL SECURITY; -ALTER TABLE public.chat_messages ENABLE ROW LEVEL SECURITY; -ALTER TABLE public.forum_categories ENABLE ROW LEVEL SECURITY; -ALTER TABLE public.forums ENABLE ROW LEVEL SECURITY; -ALTER TABLE public.topics ENABLE ROW LEVEL SECURITY; -ALTER TABLE public.posts ENABLE ROW LEVEL SECURITY; -ALTER TABLE public.groups ENABLE ROW LEVEL SECURITY; - --- Profiles -CREATE POLICY "Public profiles are viewable by everyone" ON public.profiles FOR SELECT USING (true); -CREATE POLICY "Users can update own profile" ON public.profiles FOR UPDATE USING (auth.uid() = id) WITH CHECK (auth.uid() = id); - --- Characters -CREATE POLICY "Characters are viewable by everyone" ON public.characters FOR SELECT USING (true); -CREATE POLICY "Users can insert own characters" ON public.characters FOR INSERT WITH CHECK (auth.uid() = user_id); -CREATE POLICY "Users can update own characters" ON public.characters FOR UPDATE USING (auth.uid() = user_id); - --- Forums -CREATE POLICY "Categories are viewable by everyone" ON public.forum_categories FOR SELECT USING (true); -CREATE POLICY "Forums are viewable by everyone" ON public.forums FOR SELECT USING (true); - --- Topics & Posts -CREATE POLICY "Topics are viewable by everyone" ON public.topics FOR SELECT USING (true); -CREATE POLICY "Users can insert topics" ON public.topics FOR INSERT WITH CHECK (auth.uid() IS NOT NULL); -CREATE POLICY "Users can update own topics" ON public.topics FOR UPDATE USING (auth.uid() = author_id); - -CREATE POLICY "Posts are viewable by everyone" ON public.posts FOR SELECT USING (true); -CREATE POLICY "Users can insert posts" ON public.posts FOR INSERT WITH CHECK (auth.uid() IS NOT NULL); -CREATE POLICY "Users can update own posts" ON public.posts FOR UPDATE USING (auth.uid() = author_id); - --- Chat -CREATE POLICY "Chat messages are viewable by everyone" ON public.chat_messages FOR SELECT USING (true); -CREATE POLICY "Users can insert own messages" ON public.chat_messages FOR INSERT WITH CHECK (auth.uid() = user_id); - --- Groups -CREATE POLICY "Groups are viewable by everyone" ON public.groups FOR SELECT USING (true); - --- ============================================ --- FUNCTIONS & TRIGGERS --- ============================================ - --- Automatique Profile Creation -CREATE OR REPLACE FUNCTION public.handle_new_user() -RETURNS trigger AS $$ -BEGIN - INSERT INTO public.profiles (id, username, avatar_url) - VALUES (new.id, new.raw_user_meta_data->>'username', new.raw_user_meta_data->>'avatar_url'); - RETURN new; -END; -$$ LANGUAGE plpgsql SECURITY DEFINER; - -CREATE TRIGGER on_auth_user_created - AFTER INSERT ON auth.users - FOR EACH ROW EXECUTE PROCEDURE public.handle_new_user(); - --- Updated At Update -CREATE OR REPLACE FUNCTION public.update_updated_at_column() -RETURNS TRIGGER AS $$ -BEGIN - NEW.updated_at = NOW(); - RETURN NEW; -END; -$$ LANGUAGE plpgsql; - -CREATE TRIGGER update_profiles_updated_at BEFORE UPDATE ON public.profiles FOR EACH ROW EXECUTE FUNCTION public.update_updated_at_column(); -CREATE TRIGGER update_characters_updated_at BEFORE UPDATE ON public.characters FOR EACH ROW EXECUTE FUNCTION public.update_updated_at_column(); -CREATE TRIGGER update_forums_updated_at BEFORE UPDATE ON public.forums FOR EACH ROW EXECUTE FUNCTION public.update_updated_at_column(); -CREATE TRIGGER update_topics_updated_at BEFORE UPDATE ON public.topics FOR EACH ROW EXECUTE FUNCTION public.update_updated_at_column(); -CREATE TRIGGER update_posts_updated_at BEFORE UPDATE ON public.posts FOR EACH ROW EXECUTE FUNCTION public.update_updated_at_column(); - --- Topic Counts Triggers -CREATE OR REPLACE FUNCTION public.update_forum_counts() -RETURNS TRIGGER AS $$ -BEGIN - IF (TG_OP = 'INSERT') THEN - UPDATE public.forums SET topics_count = topics_count + 1 WHERE id = NEW.forum_id; - ELSIF (TG_OP = 'DELETE') THEN - UPDATE public.forums SET topics_count = topics_count - 1 WHERE id = OLD.forum_id; - END IF; - RETURN NULL; -END; -$$ LANGUAGE plpgsql; - -CREATE TRIGGER on_topic_created_deleted - AFTER INSERT OR DELETE ON public.topics - FOR EACH ROW EXECUTE FUNCTION public.update_forum_counts(); - -CREATE OR REPLACE FUNCTION public.update_post_counts() -RETURNS TRIGGER AS $$ -BEGIN - IF (TG_OP = 'INSERT') THEN - UPDATE public.topics SET replies_count = replies_count + 1, updated_at = NOW() WHERE id = NEW.topic_id; - UPDATE public.forums SET posts_count = posts_count + 1 WHERE id = (SELECT forum_id FROM public.topics WHERE id = NEW.topic_id); - ELSIF (TG_OP = 'DELETE') THEN - UPDATE public.topics SET replies_count = replies_count - 1 WHERE id = OLD.topic_id; - UPDATE public.forums SET posts_count = posts_count - 1 WHERE id = (SELECT forum_id FROM public.topics WHERE id = OLD.topic_id); - END IF; - RETURN NULL; -END; -$$ LANGUAGE plpgsql; - -CREATE TRIGGER on_post_created_deleted - AFTER INSERT OR DELETE ON public.posts - FOR EACH ROW EXECUTE FUNCTION public.update_post_counts(); - - diff --git a/supabase/seeds/00_cleanup_atlas.sql b/supabase/seeds/00_cleanup_atlas.sql deleted file mode 100644 index 3c9aa18..0000000 --- a/supabase/seeds/00_cleanup_atlas.sql +++ /dev/null @@ -1,36 +0,0 @@ --- ================================================================================= --- SCRIPT D'ARCHIVAGE ET NETTOYAGE DES ANCIENS FORUMS GALACTIQUES --- ================================================================================= - -DO $$ -DECLARE - archive_forum_id INTEGER; -BEGIN - -- 1. S'assurer que la catégorie Archives existe (au cas où 01 n'a pas encore tourné) - INSERT INTO public.forum_categories (id, name, description, era, required_role, display_order) - VALUES (7, 'Archives', 'Anciens messages et archives de la galaxie.', NULL, NULL, 150) - ON CONFLICT (id) DO NOTHING; - - -- 2. Trouver l'ID du forum Archives Galactiques - SELECT id INTO archive_forum_id FROM public.forums WHERE name = 'Archives Galactiques' LIMIT 1; - - -- Si le forum n'existe pas, on le crée dans la catégorie 7 - IF archive_forum_id IS NULL THEN - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (7, 'Archives Galactiques', 'Le passé de la galaxie, préservé pour l''éternité.', 'forum', 1) - RETURNING id INTO archive_forum_id; - END IF; - - -- 3. Déplacer tous les sujets des forums appartenant aux ères (catégories 2, 3, 4) vers les archives - UPDATE public.topics - SET forum_id = archive_forum_id - WHERE forum_id IN ( - SELECT id FROM public.forums WHERE category_id IN (2, 3, 4) - ); - - -- 4. Supprimer tous les forums des ères pour repartir de zéro - -- On ne supprime que ceux des catégories 2, 3, 4 - DELETE FROM public.forums WHERE category_id IN (2, 3, 4); - - RAISE NOTICE 'Archivage terminé et anciens forums supprimés.'; -END $$; diff --git a/supabase/seeds/01_categories.sql b/supabase/seeds/01_categories.sql deleted file mode 100644 index 73d3746..0000000 --- a/supabase/seeds/01_categories.sql +++ /dev/null @@ -1,19 +0,0 @@ --- ================================================================================= --- SEED 01 : CATÉGORIES DE BASE --- ================================================================================= - -INSERT INTO public.forum_categories (id, name, description, era, required_role, display_order) -VALUES -(1, 'Holonews', 'Communications officielles et informations vitales.', NULL, NULL, 1), -(2, 'Guerre des Clones', 'Un conflit galactique total opposant la République Galactique à la Confédération des Systèmes Indépendants (CSI).', 'Old Republic', NULL, 10), -(3, 'Guerre Civile Galactique', 'L''ombre de l''Empire Galactique s''étend sur la galaxie, étouffant toute velléité de liberté sous une poigne de fer.', 'Galactic Empire', NULL, 20), -(4, 'Nouvelle République', 'La galaxie respire à nouveau, mais son souffle est encore court. Sur les ruines de l''Empire Galactique, la Nouvelle République tente de tisser une toile d''espoir et de justice.', 'New Republic', NULL, 30), -(5, 'Social', 'Echanges entre joueurs et support.', NULL, NULL, 40), -(6, 'Administratif', 'Espaces réservés à l''équipe du forum.', NULL, 'moderator', 100), -(7, 'Archives', 'Anciens messages et archives de la galaxie.', NULL, NULL, 150) -ON CONFLICT (id) DO UPDATE SET - name = EXCLUDED.name, - description = EXCLUDED.description, - era = EXCLUDED.era, - required_role = EXCLUDED.required_role, - display_order = EXCLUDED.display_order; diff --git a/supabase/seeds/02_forums_hrp.sql b/supabase/seeds/02_forums_hrp.sql deleted file mode 100644 index 7ce8364..0000000 --- a/supabase/seeds/02_forums_hrp.sql +++ /dev/null @@ -1,60 +0,0 @@ --- ================================================================================= --- SEED 02 : FORUMS HORS-RP --- ================================================================================= - -DO $$ -BEGIN - -- Annonces - IF NOT EXISTS (SELECT 1 FROM public.forums WHERE name = 'Annonces' AND category_id = 1) THEN - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (1, 'Annonces', 'Les dernières nouvelles du front et du projet.', 'forum', 1); - END IF; - - -- Présentations - IF NOT EXISTS (SELECT 1 FROM public.forums WHERE name = 'Présentations' AND category_id = 1) THEN - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (1, 'Présentations', 'Faites-vous connaître de la galaxie.', 'forum', 2); - END IF; - - -- Création de personnage - IF NOT EXISTS (SELECT 1 FROM public.forums WHERE name = 'Création de personnage' AND category_id = 1) THEN - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (1, 'Création de personnage', 'Lieu de naissance des futures légendes.', 'forum', 3); - END IF; - - -- Discussions - IF NOT EXISTS (SELECT 1 FROM public.forums WHERE name = 'Discussions' AND category_id = 5) THEN - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (5, 'Discussions', 'Parler de tout et de rien (HRP).', 'forum', 1); - END IF; - - -- Suggestions - IF NOT EXISTS (SELECT 1 FROM public.forums WHERE name = 'Suggestions' AND category_id = 5) THEN - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (5, 'Suggestions', 'Aidez-nous à améliorer votre expérience.', 'forum', 2); - END IF; - - -- Signaler un bug - IF NOT EXISTS (SELECT 1 FROM public.forums WHERE name = 'Signaler un bug' AND category_id = 5) THEN - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (5, 'Signaler un bug', 'Rapportez les anomalies techniques ici.', 'forum', 3); - END IF; - - -- Modérateurs - IF NOT EXISTS (SELECT 1 FROM public.forums WHERE name = 'Modérateurs' AND category_id = 6) THEN - INSERT INTO public.forums (category_id, name, description, type, required_role, display_order) - VALUES (6, 'Modérateurs', 'Coordination de la modération et des Smodos.', 'forum', 'moderator', 1); - END IF; - - -- Administrateurs - IF NOT EXISTS (SELECT 1 FROM public.forums WHERE name = 'Administrateurs' AND category_id = 6) THEN - INSERT INTO public.forums (category_id, name, description, type, required_role, display_order) - VALUES (6, 'Administrateurs', 'Décisions de haut niveau et gestion technique.', 'forum', 'admin', 2); - END IF; - - -- Archives Galactiques - IF NOT EXISTS (SELECT 1 FROM public.forums WHERE name = 'Archives Galactiques' AND category_id = 7) THEN - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (7, 'Archives Galactiques', 'Le passé de la galaxie, préservé pour l''éternité.', 'forum', 1); - END IF; -END $$; diff --git a/supabase/seeds/03_atlas_clone_wars.sql b/supabase/seeds/03_atlas_clone_wars.sql deleted file mode 100644 index 8a4b7e7..0000000 --- a/supabase/seeds/03_atlas_clone_wars.sql +++ /dev/null @@ -1,111 +0,0 @@ --- ================================================================================= --- SEED 03 : ATLAS GALACTIQUE - GUERRE DES CLONES (REFONTE TOTALE) --- ================================================================================= - -DO $$ -DECLARE - reg_id INTEGER; - zone_id INTEGER; -BEGIN - -- ========================================== - -- 1. NOYAU GALACTIQUE (BASTION DE LA RÉPUBLIQUE) - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (2, 'Noyau Galactique', 'Le centre de gravité de la civilisation, siège du pouvoir galactique et bastion inexpugnable de la République.', 'region', 1) - RETURNING id INTO reg_id; - - -- ZONE : Le Centre Politique - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (2, reg_id, 'Le Centre Politique', 'Le cœur battant de la démocratie galactique, où les décisions qui forgent l''histoire sont prises sous le dôme du Sénat.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (2, zone_id, 'Coruscant', 'Cité-monde étincelante et capitale de la République, Coruscant est le centre névralgique de l''effort de guerre. Tandis que le Sénat Galactique résonne des débats passionnés sur la militarisation, le Temple Jedi surplombe la ville, servant de quartier général aux généraux Jedi qui coordonnent les armées de clones à travers la galaxie. Les niveaux supérieurs respirent l''opulence, mais l''ombre du conflit s''étend jusque dans les bas-fonds, où les espions séparatistes et les trafiquants profitent du chaos politique.', 'planet'), - (2, zone_id, 'Alderaan', 'Perle de beauté et de culture, Alderaan demeure l''un des plus fermes soutiens diplomatiques de la République. Sous l''égide de la Maison Organa, la planète prône la paix et la résolution pacifique des conflits, bien que sa position stratégique dans le Noyau en fasse une cible de choix pour les intrigues politiques séparatistes. Ses paysages de montagnes enneigées et de plaines verdoyantes offrent un contraste frappant avec la violence qui ravage le reste de la galaxie.', 'planet'); - - -- ZONE : Les Mondes Fondateurs - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (2, reg_id, 'Les Mondes Fondateurs', 'Bastions industriels et historiques produisant la puissance navale nécessaire à la défense du Noyau.', 'region', 2) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (2, zone_id, 'Corellia', 'Réputée pour ses chantiers navals orbitaux et ses pilotes intrépides, Corellia est la forge des vaisseaux de ligne de la République. La planète est un tourbillon d''activité industrielle où les ingénieurs travaillent sans relâche pour produire les croiseurs qui affronteront les flottes de la CSI. Bien que loyale, Corellia conserve un esprit d''indépendance farouche, et ses spatioports sont des nids de rumeurs et de contrebande.', 'planet'), - (2, zone_id, 'Kuat', 'Dominée par les immenses anneaux de construction des Kuat Drive Yards, cette planète est le joyau industriel de la République. C''est ici que naissent les redoutables destroyers stellaires de classe Venator. La sécurité y est absolue, car la perte de Kuat signifierait la fin de la suprématie navale républicaine. L''aristocratie locale, immensément riche, tire les ficelles de l''économie de guerre avec une efficacité glaciale.', 'planet'); - - -- ========================================== - -- 2. BORDURES INTÉRIEURE & MÉDIANE (CHAMPS DE BATAILLE) - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (2, 'Bordures Intérieure & Médiane', 'Zones de transition vitales, parsemées de mondes stratégiques servant de boucliers au Noyau.', 'region', 2) - RETURNING id INTO reg_id; - - -- ZONE : Secteur de l''Expansion - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (2, reg_id, 'Secteur de l''Expansion', 'Région riche en ressources, disputée avec acharnement entre les deux factions.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (2, zone_id, 'Naboo', 'D''une beauté bucolique, Naboo est un symbole de résistance contre l''avidité des corporations. Bien que la planète ait été le théâtre de l''invasion par la Fédération du Commerce, elle reste un allié précieux de la République. Ses plaines et ses cités sous-marines sont protégées par les forces de sécurité royales et les Gungans, toujours prêts à repousser toute nouvelle incursion séparatiste.', 'planet'), - (2, zone_id, 'Devaron', 'Monde de montagnes escarpées et de jungles denses, Devaron est une plaque tournante stratégique sur la route commerciale du Noyau. La planète est le siège d''une lutte politique intense entre les partisans de la neutralité et ceux qui souhaitent rejoindre la République, tandis que les forêts environnantes cachent souvent des avant-postes secrets et des camps d''entraînement pour les forces spéciales.', 'planet'); - - -- ZONE : Théâtres de Siège - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (2, reg_id, 'Théâtres de Siège', 'Mondes devenus des symboles de la guerre d''usure où clones et droïdes s''affrontent sans fin.', 'region', 2) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (2, zone_id, 'Kashyyyk', 'Le monde forestier des Wookiees est un champ de bataille vertical. Les séparatistes convoitent les ressources et la position stratégique de la planète, menant des assauts massifs contre les cités dans les arbres. Les Wookiees, alliés naturels de la République, combattent avec une bravoure légendaire aux côtés des clones, transformant chaque niveau de la canopée en un piège mortel pour les droïdes de combat.', 'planet'), - (2, zone_id, 'Christophsis', 'Cité de cristal étincelante, Christophsis est devenue le théâtre d''un siège mémorable. Ses ressources minérales et sa position sur les routes de la Bordure en font une cible prioritaire pour la CSI. Les combats de rue y sont acharnés, chaque bloc d''habitation cristallin pouvant devenir une forteresse. La population civile, prise entre deux feux, tente de survivre dans les ruines de ce qui fut autrefois l''une des plus belles villes de la galaxie.', 'planet'); - - -- ========================================== - -- 3. BORDURE EXTÉRIEURE (L''ENFER DE LA GUERRE) - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (2, 'Bordure Extérieure', 'Vaste étendue sauvage où la loi de la République s''efface devant la puissance des séparatistes et des cartels.', 'region', 3) - RETURNING id INTO reg_id; - - -- ZONE : Les Bastions de la CSI - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (2, reg_id, 'Les Bastions de la CSI', 'Le cœur industriel et militaire de la Confédération des Systèmes Indépendants.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (2, zone_id, 'Geonosis', 'Planète de poussière et de roche, Geonosis est le berceau de la CSI. Ses usines souterraines massives produisent les légions de droïdes qui s''abattent sur la galaxie. C''est ici que la première bataille de la guerre a éclaté, et la planète reste un bastion lourdement défendu, hanté par le bourdonnement des Geonosiens et la chaleur des fonderies.', 'planet'), - (2, zone_id, 'Mustafar', 'Enfer volcanique et monde minier, Mustafar abrite des installations secrètes de haute importance pour le Conseil Séparatiste. Les rivières de lave et les infrastructures flottantes créent un environnement hostile où seuls les plus désespérés ou les plus loyaux osent s''aventurer. C''est un lieu de retraite pour les leaders de la CSI, loin du regard de la République.', 'planet'), - (2, zone_id, 'Utapau', 'Monde de gouffres et de cités troglodytes, Utapau tente de maintenir une neutralité fragile dans un conflit qui la dépasse. Cependant, ses vastes grottes offrent des cachettes idéales pour les flottes séparatistes en attente. La population locale, pacifique mais fière, observe avec inquiétude l''ombre des destroyers qui plane au-dessus de leurs puits vertigineux.', 'planet'); - - -- ZONE : Mondes de Frontière - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (2, reg_id, 'Mondes de Frontière', 'Frontières sauvages où le destin de la galaxie se joue dans des batailles isolées.', 'region', 2) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (2, zone_id, 'Kamino', 'Monde océanique perpétuellement balayé par les tempêtes, Kamino est le secret le mieux gardé de la République. Dans les cités immaculées de Tipoca, les Kaminoans produisent et entraînent les millions de soldats clones qui constituent la Grande Armée de la République. La sécurité y est draconienne, car toute attaque contre Kamino menacerait directement le renouvellement des troupes républicaines.', 'planet'), - (2, zone_id, 'Tatooine', 'Désert impitoyable dominé par les Hutts, Tatooine est une plaque tournante pour les mercenaires, les chasseurs de primes et les fugitifs. Bien qu''officiellement hors de la juridiction de la République, sa position sur les routes de la Bordure en fait un point de passage crucial. Les escarmouches entre les forces séparatistes et les intérêts locaux y sont fréquentes, tandis que les Jedi y mènent parfois des missions de reconnaissance discrètes.', 'planet'), - (2, zone_id, 'Ryloth', 'Monde natal des Twi''leks, Ryloth est dévasté par l''occupation séparatiste qui cherche à s''emparer de ses ressources en Ryll. La résistance locale, menée par des guerriers intrépides, lutte pied à pied dans les canyons et les cavernes pour libérer leur peuple. La République envoie souvent des contingents de clones pour soutenir ces insurgés, transformant la planète en un symbole de lutte pour la liberté.', 'planet'); - - -- ========================================== - -- 4. ESPACE INCONNU & MONDES SECRETS - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (2, 'Espace Inconnu & Mondes Secrets', 'Régions mystérieuses et oubliées où la Force et les secrets anciens dominent.', 'region', 4) - RETURNING id INTO reg_id; - - -- ZONE : Mystères de la Force - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (2, reg_id, 'Mystères de la Force', 'Lieux de pouvoir et de légende, accessibles uniquement aux initiés ou par pur hasard.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (2, zone_id, 'Ilum', 'Planète glacée et secrète, Ilum est le lieu sacré où les Jedi viennent récolter les cristaux Kyber pour leurs sabres laser. Ses grottes cristallines sont imprégnées de la Force, offrant des visions et des défis à ceux qui cherchent la sagesse. En temps de guerre, la protection d''Ilum est devenue une priorité absolue pour l''Ordre Jedi, afin d''éviter que ses secrets ne tombent entre les mains des Sith.', 'planet'), - (2, zone_id, 'Mortis', 'Un monolithe éthéré flottant dans l''espace, Mortis est un royaume qui défie les lois de la physique galactique. On dit qu''il est le foyer des "Élus" de la Force, des entités représentant l''Équilibre, le Côté Lumineux et le Côté Obscur. Peu ont trouvé le chemin de Mortis, et ceux qui en reviennent sont changés à jamais par les révélations sur la nature profonde de la Force.', 'planet'); - - -- ZONE : Frontières de l''Ombre - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (2, reg_id, 'Frontières de l''Ombre', 'Mondes hantés par des puissances anciennes et des cultures guerrières.', 'region', 2) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (2, zone_id, 'Dathomir', 'Monde de brumes rouges et de forêts de pierre, Dathomir est le domaine des Sœurs de la Nuit et des Frères de la Nuit. Imprégnée d''une magie obscure et ancienne, la planète est un lieu de danger constant. Les séparatistes ont tenté de forger des alliances avec ces clans puissants, mais la loyauté sur Dathomir est aussi changeante que les ombres qui hantent ses paysages désolés.', 'planet'); - -END $$; diff --git a/supabase/seeds/04_atlas_civil_war.sql b/supabase/seeds/04_atlas_civil_war.sql deleted file mode 100644 index f0bf719..0000000 --- a/supabase/seeds/04_atlas_civil_war.sql +++ /dev/null @@ -1,106 +0,0 @@ --- ================================================================================= --- SEED 04 : ATLAS GALACTIQUE - GUERRE CIVILE GALACTIQUE (REFONTE TOTALE) --- ================================================================================= - -DO $$ -DECLARE - reg_id INTEGER; - zone_id INTEGER; -BEGIN - -- ========================================== - -- 1. LE CENTRE IMPÉRIAL (L'ORDRE NOUVEAU) - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (3, 'Le Centre Impérial', 'Le bastion de la puissance impériale, où la surveillance est absolue et la discipline de fer garantit la paix de l''Empereur.', 'region', 1) - RETURNING id INTO reg_id; - - -- ZONE : Le Cœur de l''Empire - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (3, reg_id, 'Le Cœur de l''Empire', 'Le centre politique et industriel de la galaxie, entièrement dévoué à la gloire de l''Empire Galactique.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (3, zone_id, 'Coruscant', 'Ancienne capitale de la République, Coruscant est devenue le Centre Impérial. Le Palais de l''Empereur, autrefois le Temple Jedi, domine désormais une planète transformée par une bureaucratie étouffante et une surveillance constante du BSI. Les niveaux supérieurs sont réservés à l''élite impériale, tandis que les bas-fonds sont devenus des foyers de dissidence réprimés avec une brutalité implacable. Chaque bloc urbain est un rappel de l''Ordre Nouveau, où la peur a remplacé la démocratie.', 'planet'), - (3, zone_id, 'Kuat', 'Les chantiers navals de Kuat Drive Yards sont le poumon militaire de l''Empire. Sous une occupation militaire stricte, les ouvriers produisent les Destroyers Stellaires qui patrouillent la galaxie. L''anneau orbital de Kuat est l''une des structures les mieux défendues au monde, un symbole de la puissance navale impériale. Toute trace de l''ancienne culture aristocratique a été mise au service de l''effort de guerre impérial.', 'planet'); - - -- ZONE : Mondes de Discipline - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (3, reg_id, 'Mondes de Discipline', 'Bastions de formation et de propagande où les futurs officiers et soldats de l''Empire sont forgés.', 'region', 2) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (3, zone_id, 'Eriadu', 'Monde industriel et foyer de la famille Tarkin, Eriadu est le modèle de la discipline impériale en Bordure Extérieure. La planète est une cité-monde polluée mais efficace, où l''ordre est maintenu par une garnison massive. C''est un centre de commandement régional crucial pour la coordination des opérations anti-insurrectionnelles dans les secteurs périphériques.', 'planet'), - (3, zone_id, 'Carida', 'Siège de l''Académie Impériale, Carida est la forge où sont formés les Stormtroopers et les officiers de l''élite. Ses environnements variés, des déserts brûlants aux pôles glacés, servent de terrains d''entraînement impitoyables. La planète est un bastion de loyauté inébranlable, où chaque citoyen est éduqué dans le culte de l''Empereur et la supériorité de l''Ordre Nouveau.', 'planet'); - - -- ========================================== - -- 2. BORDURES DE LA RÉBELLION (L'ÉTINCELLE DE L'ESPOIR) - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (3, 'Bordures de la Rébellion', 'Zones de conflit et refuges pour ceux qui refusent de se plier à la tyrannie impériale.', 'region', 2) - RETURNING id INTO reg_id; - - -- ZONE : Bases Clandestines - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (3, reg_id, 'Bases Clandestines', 'Lieux secrets où l''Alliance Rebelle regroupe ses forces et planifie ses frappes contre l''Empire.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (3, zone_id, 'Yavin IV', 'Lune forestière luxuriante abritant d''anciens temples Massassi, Yavin IV sert de base principale à l''Alliance Rebelle. Sous la canopée épaisse, les rebelles ont installé leurs hangars et leurs centres de communication, espérant que l''isolement de la lune les protégera des patrouilles impériales. C''est un lieu chargé d''histoire et d''espoir, où chaque pilote sait que la prochaine mission pourrait être la dernière.', 'planet'), - (3, zone_id, 'Hoth', 'Monde de glace désolé aux confins de la Bordure Extérieure, Hoth est le dernier refuge de la Base Echo. Les rebelles y luttent contre des températures mortelles et une faune hostile pour maintenir leur présence secrète. L''isolement total de la planète est sa seule défense contre la puissance écrasante de la flotte impériale qui traque sans relâche l''étincelle de la révolte.', 'planet'), - (3, zone_id, 'Dantooine', 'Ancienne base rebelle désormais abandonnée, Dantooine reste un monde agraire paisible mais marqué par le passage de l''Alliance. Les ruines des installations rebelles sont parfois fouillées par des patrouilles impériales, tandis que la population locale tente de rester neutre, craignant des représailles pour avoir autrefois hébergé les "traîtres" républicains.', 'planet'); - - -- ZONE : Mondes en Révolte - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (3, reg_id, 'Mondes en Révolte', 'Systèmes courageux qui soutiennent ouvertement ou secrètement l''Alliance pour la Restauration de la République.', 'region', 2) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (2, zone_id, 'Mon Cala', 'Monde océanique dont les chantiers navals produisent les croiseurs stellaires de l''Alliance. Les Mon Calamaris et les Quarrens ont uni leurs forces après avoir été exploités par l''Empire, transformant leurs cités flottantes en bastions de résistance navale. La planète est en état de siège permanent, protégée par une flotte rebelle déterminée à défendre son principal centre de production.', 'planet'), - (3, zone_id, 'Sullust', 'Monde volcanique dont l''industrie est contrôlée par la corporation SoroSuub, Sullust est un terrain de lutte entre les collaborateurs impériaux et les syndicats rebelles. Ses vastes réseaux de tunnels et ses usines géothermiques sont le théâtre de sabotages et de guérilla urbaine, alors que l''Alliance cherche à rallier ce monde industriel crucial à sa cause.', 'planet'), - (3, zone_id, 'Chandrila', 'Foyer de Mon Mothma, Chandrila est un symbole de résistance diplomatique. Bien que sous surveillance impériale, la planète conserve ses traditions démocratiques et sert de lien secret entre les sénateurs dissidents et l''Alliance armée. Ses paysages sereins cachent une agitation politique intense et un réseau d''espionnage sophistiqué.', 'planet'); - - -- ========================================== - -- 3. LA BORDURE EXTÉRIEURE (ZONE DE NON-DROIT) - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (3, 'La Bordure Extérieure', 'Vaste étendue sauvage où l''autorité impériale est contestée par les cartels criminels et la nature elle-même.', 'region', 3) - RETURNING id INTO reg_id; - - -- ZONE : L''Espace Hutt & Crime - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (3, reg_id, 'L''Espace Hutt & Crime', 'Territoires dominés par les syndicats du crime, où tout s''achète et se vend, même la loyauté.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (3, zone_id, 'Tatooine', 'Désert impitoyable sous l''influence de Jabba le Hutt, Tatooine est le carrefour de la pègre galactique. L''Empire y maintient une présence symbolique à Mos Eisley, mais la véritable loi est celle des crédits et des blasters. C''est un refuge pour les contrebandiers, les chasseurs de primes et les agents rebelles en quête d''anonymat dans les sables mouvants de la Bordure.', 'planet'), - (3, zone_id, 'Nal Hutta', 'Le "Joyau Glorieux" est le cœur de l''empire criminel des Hutts. Planète marécageuse et polluée, elle est le siège du Conseil des Hutts qui tire les ficelles de l''Underworld galactique. L''Empire évite une confrontation directe, préférant des accords pragmatiques pour assurer la stabilité des routes commerciales de la Bordure.', 'planet'), - (3, zone_id, 'Kessel', 'Astéroïde minier infernal, Kessel est célèbre pour son épice et son "Raid de Kessel". L''Empire y exploite des prisonniers politiques et des esclaves dans des conditions inhumaines pour alimenter les marchés noirs et les besoins militaires. C''est un lieu de souffrance et de richesse rapide, protégé par des tempêtes ioniques permanentes.', 'planet'); - - -- ZONE : Confins Sauvages - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (3, reg_id, 'Confins Sauvages', 'Mondes isolés et mystérieux, souvent ignorés par les grandes puissances galactiques.', 'region', 2) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (3, zone_id, 'Bespin', 'Géante gazeuse abritant la Cité des Nuages, Bespin tente de maintenir une neutralité précaire grâce à son isolation. Ses mines de gaz Tibanna sont vitales pour l''armement, attirant l''attention de l''Empire et de l''Alliance. La cité flottante est un havre de luxe et de jeu, mais l''ombre du conflit galactique finit toujours par l''atteindre.', 'planet'), - (3, zone_id, 'Endor', 'Lune forestière reculée, Endor est le foyer des Ewoks et le site top secret de la construction de la seconde Étoile de la Mort. Ses forêts denses et sa position isolée en font le théâtre final d''une confrontation qui décidera du sort de la galaxie. C''est un monde d''une beauté sauvage cachant une arme d''une destruction inimaginable.', 'planet'), - (3, zone_id, 'Dagobah', 'Monde de marécages et de brumes, Dagobah est absent des cartes impériales. Imprégnée par la Force, la planète est le refuge secret du Maître Yoda. C''est un lieu de pure nature où le côté lumineux et le côté obscur se côtoient dans un équilibre primal, loin du vacarme de la guerre civile.', 'planet'); - - -- ========================================== - -- 4. LES SECRETS DE L'EMPEREUR - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (3, 'Les Secrets de l''Empereur', 'Zones interdites et mondes cachés abritant les projets les plus sombres de Palpatine.', 'region', 4) - RETURNING id INTO reg_id; - - -- ZONE : L''Espace Inconnu - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (3, reg_id, 'L''Espace Inconnu', 'Régions non cartographiées protégées par des anomalies spatiales, où l''Empire prépare son futur ou cache son passé.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (3, zone_id, 'Exegol', 'Monde de ténèbres éternelles et d''éclairs, Exegol est le bastion caché des Sith. Loin des regards de la galaxie, des cultistes et des ingénieurs y travaillent sur des technologies de clonage et des flottes de guerre secrètes pour assurer la pérennité de l''Ordre Sith. C''est un lieu où la mort n''est qu''un obstacle temporaire pour l''Empereur.', 'planet'), - (3, zone_id, 'Byss', 'Monde paradisiaque en apparence, Byss est en réalité une prison dorée imprégnée par le Côté Obscur. L''Empereur y a établi une retraite privée où il draine l''énergie vitale de la population pour prolonger sa propre existence. C''est un centre de recherches ésotériques et de sombres rituels, protégé par une sécurité impériale d''élite.', 'planet'), - (3, zone_id, 'Jakku', 'Désert de poussière sans intérêt apparent, Jakku cache une installation secrète de l''Observatoire de l''Empereur. Ce monde est destiné à devenir le point de rassemblement final pour le plan de contingence de Palpatine en cas de défaite, transformant ce désert en un gigantesque piège pour les flottes galactiques.', 'planet'); - -END $$; diff --git a/supabase/seeds/05_atlas_new_republic.sql b/supabase/seeds/05_atlas_new_republic.sql deleted file mode 100644 index 39c20f0..0000000 --- a/supabase/seeds/05_atlas_new_republic.sql +++ /dev/null @@ -1,105 +0,0 @@ --- ================================================================================= --- SEED 05 : ATLAS GALACTIQUE - NOUVELLE RÉPUBLIQUE (REFONTE TOTALE) --- ================================================================================= - -DO $$ -DECLARE - reg_id INTEGER; - zone_id INTEGER; -BEGIN - -- ========================================== - -- 1. LE NOYAU RESTAURÉ (LA NOUVELLE DÉMOCRATIE) - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (4, 'Le Noyau Restauré', 'Le centre de la galaxie renaissante, où la Nouvelle République tente de rebâtir les fondations de la paix et de la justice.', 'region', 1) - RETURNING id INTO reg_id; - - -- ZONE : Sièges du Pouvoir - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (4, reg_id, 'Sièges du Pouvoir', 'Les centres politiques tournants de la Nouvelle République, symbolisant le retour de la démocratie.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (4, zone_id, 'Chandrila', 'Premier siège du Sénat de la Nouvelle République, Chandrila est le symbole de la victoire de la diplomatie sur la tyrannie. Sous ses paysages sereins et ses jardins suspendus, la planète vibre d''une activité politique intense. C''est ici que Mon Mothma et les leaders républicains ont posé les bases d''une nouvelle ère, privilégiant la démocratie décentralisée et la réduction des forces militaires.', 'planet'), - (4, zone_id, 'Hosnian Prime', 'Nouvelle capitale désignée de la République, Hosnian Prime est une métropole étincelante de verre et d''acier. Elle incarne l''ambition d''une galaxie unie et moderne, accueillant des délégués de milliers de mondes dans son immense rotonde sénatoriale. La sécurité y est assurée par une garde d''honneur républicaine, alors que la planète devient le cœur battant de la vie culturelle et politique galactique.', 'planet'), - (4, zone_id, 'Coruscant', 'Ancien centre impérial, Coruscant est en pleine reconstruction. Bien qu''elle ne soit plus la capitale officielle, la cité-monde reste un pôle financier et historique incontournable. Les stigmates de l''occupation impériale s''effacent lentement, remplacés par des projets de rénovation urbaine et le retour des libertés civiles. C''est un monde en transition, cherchant sa place dans une galaxie qui n''est plus centrée uniquement sur son dôme.', 'planet'); - - -- ZONE : Mondes Fondateurs Libérés - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (4, reg_id, 'Mondes Fondateurs Libérés', 'Anciens piliers de l''industrie impériale redevenus les moteurs économiques de la galaxie.', 'region', 2) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (4, zone_id, 'Kuat', 'Libérée de la poigne militaire de l''Empire, Kuat Drive Yards collabore désormais avec la Nouvelle République pour démanteler les restes de la marine impériale. Les chantiers produisent désormais des vaisseaux de transport et des croiseurs de défense, symbolisant la conversion de l''industrie de guerre vers une économie de paix. L''aristocratie de Kuat s''adapte avec prudence aux nouvelles régulations démocratiques.', 'planet'), - (4, zone_id, 'Corellia', 'Les chantiers navals corelliens ont retrouvé leur gloire marchande. La planète est redevenue le centre de l''innovation technologique pour les moteurs hyperspatiaux et les vaisseaux civils. L''esprit d''indépendance corellien, autrefois étouffé par l''Empire, fleurit à nouveau dans les spatioports et les cantinas, alors que la planète redevient la porte d''entrée principale vers les routes commerciales.', 'planet'); - - -- ========================================== - -- 2. LA BORDURE EN RECONSTRUCTION (L'ÂGE DE L'ESPOIR) - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (4, 'La Bordure en Reconstruction', 'Zones autrefois ravagées par la guerre civile, désormais engagées dans des programmes ambitieux de développement.', 'region', 2) - RETURNING id INTO reg_id; - - -- ZONE : Territoires Libérés - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (4, reg_id, 'Territoires Libérés', 'Mondes qui ont activement participé à la Rébellion et célèbrent aujourd''hui leur liberté retrouvée.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (4, zone_id, 'Naboo', 'Joyau culturel et bucolique, Naboo est l''un des piliers de la Nouvelle République en Bordure Médiane. La planète a pansé ses plaies et sert désormais de modèle pour l''intégration des arts et de la diplomatie dans la vie publique. Ses cités sont des havres de paix où les anciennes traditions royales coexistent avec une vision moderne de la coopération galactique.', 'planet'), - (4, zone_id, 'Lothal', 'Monde agraire qui fut le théâtre d''une résistance opiniâtre, Lothal est aujourd''hui en pleine renaissance industrielle. Ses plaines sont à nouveau verdoyantes, et la population célèbre les héros de sa libération. La Nouvelle République y a investi massivement pour en faire un centre de production alimentaire et technologique exemplaire pour les mondes de la bordure.', 'planet'), - (4, zone_id, 'Mon Cala', 'Bastion naval de la République, Mon Cala continue de fournir l''élite de la flotte de défense. Les Mon Calamaris ont ouvert leurs cités sous-marines au commerce galactique, tout en maintenant une vigilance accrue face aux derniers vestiges impériaux. La planète est un symbole de courage et de persévérance, dont les navires protègent désormais les nouvelles routes de la paix.', 'planet'); - - -- ZONE : Zones de Stabilité - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (4, reg_id, 'Zones de Stabilité', 'Secteurs sécurisés servant de points d''ancrage pour l''administration républicaine en expansion.', 'region', 2) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (4, zone_id, 'Onderon', 'Après des années de guerre civile et d''occupation, Onderon a retrouvé son unité sous une monarchie constitutionnelle alliée à la République. La cité d''Iziz est redevenue un pôle de stabilité, alors que les jungles environnantes sont lentement pacifiées. La planète sert de base de coordination pour les opérations de sécurité dans le secteur de l''Expansion.', 'planet'), - (4, zone_id, 'Thyferra', 'La production de Bacta est désormais supervisée par une commission républicaine pour garantir une distribution équitable. Les tensions entre les corporations locales se sont apaisées, laissant place à une prospérité partagée. Thyferra est devenue le centre médical de la galaxie, fournissant les ressources nécessaires pour soigner les millions de victimes de la guerre passée.', 'planet'); - - -- ========================================== - -- 3. LA BORDURE EXTÉRIEURE (LA NOUVELLE FRONTIÈRE) - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (4, 'La Bordure Extérieure', 'Régions sauvages où la Nouvelle République tente d''imposer l''ordre face aux seigneurs de guerre et aux cartels.', 'region', 3) - RETURNING id INTO reg_id; - - -- ZONE : Zones de Conflit des Vestiges - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (4, reg_id, 'Zones de Conflit des Vestiges', 'Territoires instables où les débris de l''Empire et les syndicats criminels luttent pour le contrôle.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (4, zone_id, 'Nevarro', 'Ancien repaire de chasseurs de primes, Nevarro est devenue une cité marchande florissante sous la gouvernance du Haut Magistrat Greef Karga. Malgré les tentatives des vestiges impériaux de reprendre le contrôle, la ville reste un bastion de liberté en Bordure Extérieure, symbole de la capacité des mondes de frontière à se réinventer loin de l''influence des grandes puissances.', 'planet'), - (4, zone_id, 'Jakku', 'Cimetière géant de vaisseaux impériaux et rebelles, Jakku est le domaine des ferrailleurs et des pillards d''épaves. La planète est un rappel constant de la violence de la guerre civile. Bien que désolée, ses débris cachent des technologies précieuses que la République tente de sécuriser avant qu''elles ne tombent entre de mauvaises mains.', 'planet'), - (4, zone_id, 'Tatooine', 'Toujours dominée par les cartels après la chute de Jabba, Tatooine reste un défi pour la Nouvelle République. Des marshalls isolés tentent d''y faire régner une justice précaire, alors que la planète redevient un carrefour pour les réfugiés et les opportunistes cherchant une nouvelle vie loin du Noyau.', 'planet'); - - -- ZONE : Mondes de Frontière - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (4, reg_id, 'Mondes de Frontière', 'Bastions de cultures fières et indépendantes cherchant leur voie dans la nouvelle galaxie.', 'region', 2) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (4, zone_id, 'Mandalore', 'En pleine reconstruction après des décennies de purge et d''occupation, Mandalore redevient le point de ralliement des clans dispersés. Les Mandaloriens travaillent à restaurer leur foyer ancestral et leur culture guerrière, tout en maintenant une neutralité vigilante vis-à-vis de la Nouvelle République. C''est un monde de résilience et de mystère.', 'planet'), - (4, zone_id, 'Eriadu', 'L''ancienne cité impériale tente de se transformer en centre industriel ouvert au commerce républicain. Bien que les traditions militaires y soient encore fortes, une nouvelle génération de leaders cherche à intégrer la planète dans l''économie galactique, espérant effacer son image de bastion de l''Ordre Nouveau.', 'planet'); - - -- ========================================== - -- 4. LES RÉGIONS DE L'OMBRE - -- ========================================== - INSERT INTO public.forums (category_id, name, description, type, display_order) - VALUES (4, 'Les Régions de l''Ombre', 'Zones reculées et mystérieuses où les secrets anciens et les menaces futures se cachent.', 'region', 4) - RETURNING id INTO reg_id; - - -- ZONE : Les Confins des Vestiges - INSERT INTO public.forums (category_id, parent_id, name, description, type, display_order) - VALUES (4, reg_id, 'Les Confins des Vestiges', 'Mondes hantés par l''histoire des Jedi et les ombres résiduelles de l''Empire.', 'region', 1) - RETURNING id INTO zone_id; - - INSERT INTO public.forums (category_id, parent_id, name, description, type) VALUES - (4, zone_id, 'Ahch-To', 'Monde océanique oublié et refuge de Luke Skywalker, Ahch-To abrite les ruines du premier temple Jedi. La planète est un lieu de paix absolue et de connexion profonde avec la Force, protégé par son isolement total. Seuls quelques initiés connaissent son emplacement, en faisant un sanctuaire de sagesse ancienne dans une galaxie en mouvement.', 'planet'), - (4, zone_id, 'Exegol', 'Surveillé par des sondes républicaines, Exegol reste un monde de cauchemar. Les rumeurs de rituels Sith et de flottes cachées persistent, bien que la planète semble stérile et abandonnée. C''est un rappel sombre que le mal peut s''enraciner dans les ténèbres les plus profondes de l''Espace Inconnu, attendant son heure.', 'planet'), - (4, zone_id, 'Ajan Kloss', 'Monde forestier sauvage, Ajan Kloss sert de base d''entraînement secrète pour une nouvelle génération de voyageurs et de gardiens de la paix. Sous sa canopée dense, les idéaux de l''Alliance et les leçons des Jedi sont transmis, préparant la galaxie aux défis que le futur ne manquera pas de poser.', 'planet'); - -END $$; From 87b350c3d9ccf6d8c82f89fec6caa2ec42ca8e11 Mon Sep 17 00:00:00 2001 From: TakCastel Date: Fri, 3 Jul 2026 02:26:17 +0200 Subject: [PATCH 2/3] Versionne bootstrap/cache/.gitignore pour corriger la CI. Co-Authored-By: Claude Fable 5 --- api/bootstrap/cache/.gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 api/bootstrap/cache/.gitignore diff --git a/api/bootstrap/cache/.gitignore b/api/bootstrap/cache/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/api/bootstrap/cache/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore From 8a5f5505ae6a9205978cc170d65987fea9e49ffa Mon Sep 17 00:00:00 2001 From: TakCastel Date: Fri, 3 Jul 2026 02:29:51 +0200 Subject: [PATCH 3/3] Fixe APP_KEY de test dans phpunit.xml pour la CI. Co-Authored-By: Claude Fable 5 --- api/phpunit.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/api/phpunit.xml b/api/phpunit.xml index 61c031c..afbd8fd 100644 --- a/api/phpunit.xml +++ b/api/phpunit.xml @@ -19,6 +19,7 @@ +