Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2

[docker-compose.yml]
indent_size = 4
44 changes: 38 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@
# Variables d'environnement pour Docker Compose (racine du projet).
# Copiez ce fichier vers .env : npm run setup
# Gardez les mêmes valeurs que docker/supabase/.env
# =============================================================================
# Laravel (monolithe — voir docs/LARAVEL.md)
# =============================================================================

APP_NAME=Swor
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost:8000

APP_LOCALE=fr
APP_FALLBACK_LOCALE=fr
APP_FAKER_LOCALE=fr_FR

LOG_CHANNEL=stack
LOG_LEVEL=debug

# Postgres local — base dédiée Laravel (distincte du schéma Supabase sur `postgres`)
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=54322
DB_DATABASE=swor
DB_USERNAME=postgres
DB_PASSWORD=postgres

SESSION_DRIVER=database
SESSION_LIFETIME=120

BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database
CACHE_STORE=database

VITE_APP_NAME="${APP_NAME}"

# =============================================================================
# Legacy — Docker Compose Supabase (front/ et back/ Next.js)
# =============================================================================

POSTGRES_PASSWORD=postgres
POSTGRES_PORT=54322
Expand All @@ -9,15 +44,12 @@ KONG_PORT=54321
KONG_ADMIN_PORT=54325
STUDIO_PORT=54323

# JWT Secret (au moins 32 caractères)
JWT_SECRET=super-secret-jwt-token-with-at-least-32-characters-long
JWT_EXPIRY=3600

# Clés API Supabase (doivent correspondre à front/.env.local et back/.env.local)
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
Expand Down
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
* text=auto eol=lf

*.blade.php diff=html
*.css diff=css
*.html diff=html
*.md diff=markdown
*.php diff=php

CHANGELOG.md export-ignore
README.md export-ignore
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,18 @@ docker/supabase/volumes/storage/

# Claude Code (réglages personnels, non partagés)
.claude/settings.local.json

# Laravel
/vendor/
/public/build
/public/hot
/public/storage
/storage/*.key
/database/database.sqlite
/bootstrap/cache/*.php
.phpunit.result.cache
/auth.json
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resources/js/components/ui/*
18 changes: 18 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"semi": true,
"singleQuote": true,
"singleAttributePerLine": false,
"htmlWhitespaceSensitivity": "css",
"printWidth": 150,
"plugins": ["prettier-plugin-organize-imports", "prettier-plugin-tailwindcss"],
"tailwindFunctions": ["clsx", "cn"],
"tabWidth": 4,
"overrides": [
{
"files": "**/*.yml",
"options": {
"tabWidth": 2
}
}
]
}
9 changes: 9 additions & 0 deletions app/Enums/EconomyType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace App\Enums;

enum EconomyType: string
{
case Income = 'income';
case Expense = 'expense';
}
13 changes: 13 additions & 0 deletions app/Enums/ForumType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace App\Enums;

enum ForumType: string
{
case Category = 'category';
case Region = 'region';
case Sector = 'sector';
case Planet = 'planet';
case Location = 'location';
case Forum = 'forum';
}
12 changes: 12 additions & 0 deletions app/Enums/ItemRarity.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace App\Enums;

enum ItemRarity: string
{
case Common = 'common';
case Uncommon = 'uncommon';
case Rare = 'rare';
case Epic = 'epic';
case Legendary = 'legendary';
}
12 changes: 12 additions & 0 deletions app/Enums/ItemType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace App\Enums;

enum ItemType: string
{
case Weapon = 'weapon';
case Armor = 'armor';
case Consumable = 'consumable';
case Tool = 'tool';
case Misc = 'misc';
}
10 changes: 10 additions & 0 deletions app/Enums/ShipModuleStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App\Enums;

enum ShipModuleStatus: string
{
case Active = 'active';
case Damaged = 'damaged';
case Offline = 'offline';
}
11 changes: 11 additions & 0 deletions app/Enums/ShipModuleType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace App\Enums;

enum ShipModuleType: string
{
case Engine = 'engine';
case Shield = 'shield';
case Weapon = 'weapon';
case Utility = 'utility';
}
11 changes: 11 additions & 0 deletions app/Enums/UserRole.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace App\Enums;

enum UserRole: string
{
case User = 'user';
case Moderator = 'moderator';
case Admin = 'admin';
case GameMaster = 'game_master';
}
51 changes: 51 additions & 0 deletions app/Http/Controllers/Auth/AuthenticatedSessionController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Http\Requests\Auth\LoginRequest;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;
use Inertia\Inertia;
use Inertia\Response;

class AuthenticatedSessionController extends Controller
{
/**
* Show the login page.
*/
public function create(Request $request): Response
{
return Inertia::render('auth/login', [
'canResetPassword' => 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('/');
}
}
41 changes: 41 additions & 0 deletions app/Http/Controllers/Auth/ConfirmablePasswordController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Validation\ValidationException;
use Inertia\Inertia;
use Inertia\Response;

class ConfirmablePasswordController extends Controller
{
/**
* Show the confirm password page.
*/
public function show(): Response
{
return Inertia::render('auth/confirm-password');
}

/**
* Confirm the user's password.
*/
public function store(Request $request): RedirectResponse
{
if (! Auth::guard('web')->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));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;

class EmailVerificationNotificationController extends Controller
{
/**
* Send a new email verification notification.
*/
public function store(Request $request): RedirectResponse
{
if ($request->user()->hasVerifiedEmail()) {
return redirect()->intended(route('dashboard', absolute: false));
}

$request->user()->sendEmailVerificationNotification();

return back()->with('status', 'verification-link-sent');
}
}
22 changes: 22 additions & 0 deletions app/Http/Controllers/Auth/EmailVerificationPromptController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Inertia\Inertia;
use Inertia\Response;

class EmailVerificationPromptController extends Controller
{
/**
* Show the email verification prompt page.
*/
public function __invoke(Request $request): Response|RedirectResponse
{
return $request->user()->hasVerifiedEmail()
? redirect()->intended(route('dashboard', absolute: false))
: Inertia::render('auth/verify-email', ['status' => $request->session()->get('status')]);
}
}
Loading
Loading