diff --git a/Modules/Auth/app/Http/Controllers/.gitkeep b/Modules/Auth/app/Http/Controllers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Auth/app/Http/Controllers/AuthController.php b/Modules/Auth/app/Http/Controllers/AuthController.php new file mode 100644 index 0000000..92ec33b --- /dev/null +++ b/Modules/Auth/app/Http/Controllers/AuthController.php @@ -0,0 +1,56 @@ +command('inspire')->hourly(); + // } +} diff --git a/Modules/Auth/app/Providers/EventServiceProvider.php b/Modules/Auth/app/Providers/EventServiceProvider.php new file mode 100644 index 0000000..f84daf6 --- /dev/null +++ b/Modules/Auth/app/Providers/EventServiceProvider.php @@ -0,0 +1,27 @@ +> + */ + protected $listen = []; + + /** + * Indicates if events should be discovered. + * + * @var bool + */ + protected static $shouldDiscoverEvents = true; + + /** + * Configure the proper event listeners for email verification. + */ + protected function configureEmailVerification(): void {} +} diff --git a/Modules/Auth/app/Providers/RouteServiceProvider.php b/Modules/Auth/app/Providers/RouteServiceProvider.php new file mode 100644 index 0000000..4cd9ae5 --- /dev/null +++ b/Modules/Auth/app/Providers/RouteServiceProvider.php @@ -0,0 +1,50 @@ +mapApiRoutes(); + $this->mapWebRoutes(); + } + + /** + * Define the "web" routes for the application. + * + * These routes all receive session state, CSRF protection, etc. + */ + protected function mapWebRoutes(): void + { + Route::middleware('web')->group(module_path($this->name, '/routes/web.php')); + } + + /** + * Define the "api" routes for the application. + * + * These routes are typically stateless. + */ + protected function mapApiRoutes(): void + { + Route::middleware('api')->prefix('api')->name('api.')->group(module_path($this->name, '/routes/api.php')); + } +} diff --git a/Modules/Auth/composer.json b/Modules/Auth/composer.json new file mode 100644 index 0000000..88ad759 --- /dev/null +++ b/Modules/Auth/composer.json @@ -0,0 +1,30 @@ +{ + "name": "nwidart/auth", + "description": "", + "authors": [ + { + "name": "Nicolas Widart", + "email": "n.widart@gmail.com" + } + ], + "extra": { + "laravel": { + "providers": [], + "aliases": { + + } + } + }, + "autoload": { + "psr-4": { + "Modules\\Auth\\": "app/", + "Modules\\Auth\\Database\\Factories\\": "database/factories/", + "Modules\\Auth\\Database\\Seeders\\": "database/seeders/" + } + }, + "autoload-dev": { + "psr-4": { + "Modules\\Auth\\Tests\\": "tests/" + } + } +} diff --git a/Modules/Auth/config/.gitkeep b/Modules/Auth/config/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Auth/config/config.php b/Modules/Auth/config/config.php new file mode 100644 index 0000000..cba1be8 --- /dev/null +++ b/Modules/Auth/config/config.php @@ -0,0 +1,5 @@ + 'Auth', +]; diff --git a/Modules/Auth/database/factories/.gitkeep b/Modules/Auth/database/factories/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Auth/database/migrations/.gitkeep b/Modules/Auth/database/migrations/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Auth/database/seeders/.gitkeep b/Modules/Auth/database/seeders/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Auth/database/seeders/AuthDatabaseSeeder.php b/Modules/Auth/database/seeders/AuthDatabaseSeeder.php new file mode 100644 index 0000000..7a22932 --- /dev/null +++ b/Modules/Auth/database/seeders/AuthDatabaseSeeder.php @@ -0,0 +1,16 @@ +call([]); + } +} diff --git a/Modules/Auth/module.json b/Modules/Auth/module.json new file mode 100644 index 0000000..7cbf9df --- /dev/null +++ b/Modules/Auth/module.json @@ -0,0 +1,11 @@ +{ + "name": "Auth", + "alias": "auth", + "description": "", + "keywords": [], + "priority": 0, + "providers": [ + "Modules\\Auth\\Providers\\AuthServiceProvider" + ], + "files": [] +} diff --git a/Modules/Auth/package.json b/Modules/Auth/package.json new file mode 100644 index 0000000..d6fbfc8 --- /dev/null +++ b/Modules/Auth/package.json @@ -0,0 +1,15 @@ +{ + "private": true, + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build" + }, + "devDependencies": { + "axios": "^1.1.2", + "laravel-vite-plugin": "^0.7.5", + "sass": "^1.69.5", + "postcss": "^8.3.7", + "vite": "^4.0.0" + } +} diff --git a/Modules/Auth/resources/assets/.gitkeep b/Modules/Auth/resources/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Auth/resources/assets/js/app.js b/Modules/Auth/resources/assets/js/app.js new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Auth/resources/assets/sass/app.scss b/Modules/Auth/resources/assets/sass/app.scss new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Auth/resources/views/.gitkeep b/Modules/Auth/resources/views/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Auth/resources/views/components/layouts/master.blade.php b/Modules/Auth/resources/views/components/layouts/master.blade.php new file mode 100644 index 0000000..82781ec --- /dev/null +++ b/Modules/Auth/resources/views/components/layouts/master.blade.php @@ -0,0 +1,30 @@ + + + + + + + + + + Auth Module - {{ config('app.name', 'Laravel') }} + + + + + + + + + + {{-- Vite CSS --}} + {{-- {{ module_vite('build-auth', 'resources/assets/sass/app.scss') }} --}} + + + + {{ $slot }} + + {{-- Vite JS --}} + {{-- {{ module_vite('build-auth', 'resources/assets/js/app.js') }} --}} + + diff --git a/Modules/Auth/resources/views/index.blade.php b/Modules/Auth/resources/views/index.blade.php new file mode 100644 index 0000000..f2e3f1c --- /dev/null +++ b/Modules/Auth/resources/views/index.blade.php @@ -0,0 +1,5 @@ + +

Hello World

+ +

Module: {!! config('auth.name') !!}

+
diff --git a/Modules/Auth/routes/.gitkeep b/Modules/Auth/routes/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Auth/routes/api.php b/Modules/Auth/routes/api.php new file mode 100644 index 0000000..8221b98 --- /dev/null +++ b/Modules/Auth/routes/api.php @@ -0,0 +1,8 @@ +prefix('v1')->group(function () { + Route::apiResource('auths', AuthController::class)->names('auth'); +}); diff --git a/Modules/Auth/routes/web.php b/Modules/Auth/routes/web.php new file mode 100644 index 0000000..509864f --- /dev/null +++ b/Modules/Auth/routes/web.php @@ -0,0 +1,8 @@ +group(function () { + Route::resource('auths', AuthController::class)->names('auth'); +}); diff --git a/Modules/Auth/tests/Feature/.gitkeep b/Modules/Auth/tests/Feature/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Auth/tests/Unit/.gitkeep b/Modules/Auth/tests/Unit/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Auth/vite.config.js b/Modules/Auth/vite.config.js new file mode 100644 index 0000000..e5de362 --- /dev/null +++ b/Modules/Auth/vite.config.js @@ -0,0 +1,41 @@ +import { defineConfig } from 'vite'; +import laravel from 'laravel-vite-plugin'; +// Uncomment the import for your frontend framework: +// import vue from '@vitejs/plugin-vue'; +// import react from '@vitejs/plugin-react'; +// import { svelte } from '@sveltejs/vite-plugin-svelte'; + +export default defineConfig({ + build: { + outDir: '../../public/build-auth', + emptyOutDir: true, + manifest: true, + }, + plugins: [ + laravel({ + publicDirectory: '../../public', + buildDirectory: 'build-auth', + input: [ + __dirname + '/resources/assets/sass/app.scss', + __dirname + '/resources/assets/js/app.js' + ], + refresh: true, + }), + // Uncomment the plugin for your frontend framework: + // vue({ + // template: { + // transformAssetUrls: { + // base: null, + // includeAbsolute: false, + // }, + // }, + // }), + // react(), + // svelte(), + ], + resolve: { + alias: { + '@': __dirname + '/resources/js', + }, + }, +}); diff --git a/compose.yaml b/compose.yaml index 14e8acc..5cd54af 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,61 +1,36 @@ services: laravel.test: build: - context: './vendor/laravel/sail/runtimes/8.5' + context: ./vendor/laravel/sail/runtimes/8.5 dockerfile: Dockerfile args: - WWWGROUP: '${WWWGROUP}' - image: 'sail-8.5/app' + WWWGROUP: "${WWWGROUP}" + image: sail-8.5/app extra_hosts: - - 'host.docker.internal:host-gateway' + - "host.docker.internal:host-gateway" ports: - - '${APP_PORT:-80}:80' - - '${VITE_PORT:-5173}:${VITE_PORT:-5173}' + - "${APP_PORT:-80}:80" + - "${VITE_PORT:-5173}:${VITE_PORT:-5173}" environment: - WWWUSER: '${WWWUSER}' + WWWUSER: "${WWWUSER}" LARAVEL_SAIL: 1 - XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}' - XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}' - IGNITION_LOCAL_SITES_PATH: '${PWD}' + XDEBUG_MODE: "${SAIL_XDEBUG_MODE:-off}" + XDEBUG_CONFIG: "${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}" + IGNITION_LOCAL_SITES_PATH: "${PWD}" volumes: - - '.:/var/www/html' + - ".:/var/www/html" networks: - sail depends_on: - - mysql - redis - mailpit - mysql: - image: 'mysql:8.4' - ports: - - '${FORWARD_DB_PORT:-3306}:3306' - environment: - MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}' - MYSQL_ROOT_HOST: '%' - MYSQL_DATABASE: '${DB_DATABASE}' - MYSQL_USER: '${DB_USERNAME}' - MYSQL_PASSWORD: '${DB_PASSWORD}' - MYSQL_ALLOW_EMPTY_PASSWORD: 1 - MYSQL_EXTRA_OPTIONS: '${MYSQL_EXTRA_OPTIONS:-}' - volumes: - - 'sail-mysql:/var/lib/mysql' - - './vendor/laravel/sail/database/mysql/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh' - networks: - - sail - healthcheck: - test: - - CMD - - mysqladmin - - ping - - '-p${DB_PASSWORD}' - retries: 3 - timeout: 5s + - pgsql redis: - image: 'redis:alpine' + image: "redis:alpine" ports: - - '${FORWARD_REDIS_PORT:-6379}:6379' + - "${FORWARD_REDIS_PORT:-6379}:6379" volumes: - - 'sail-redis:/data' + - "sail-redis:/data" networks: - sail healthcheck: @@ -66,17 +41,42 @@ services: retries: 3 timeout: 5s mailpit: - image: 'axllent/mailpit:latest' + image: "axllent/mailpit:latest" ports: - - '${FORWARD_MAILPIT_PORT:-1025}:1025' - - '${FORWARD_MAILPIT_DASHBOARD_PORT:-8025}:8025' + - "${FORWARD_MAILPIT_PORT:-1025}:1025" + - "${FORWARD_MAILPIT_DASHBOARD_PORT:-8025}:8025" networks: - sail + pgsql: + image: "postgres:18-alpine" + ports: + - "${FORWARD_DB_PORT:-5432}:5432" + environment: + PGPASSWORD: "${DB_PASSWORD:-secret}" + POSTGRES_DB: "${DB_DATABASE}" + POSTGRES_USER: "${DB_USERNAME}" + POSTGRES_PASSWORD: "${DB_PASSWORD:-secret}" + volumes: + - "sail-pgsql:/var/lib/postgresql" + - "./vendor/laravel/sail/database/pgsql/create-testing-database.sql:/docker-entrypoint-initdb.d/10-create-testing-database.sql" + networks: + - sail + healthcheck: + test: + - CMD + - pg_isready + - "-q" + - "-d" + - "${DB_DATABASE}" + - "-U" + - "${DB_USERNAME}" + retries: 3 + timeout: 5s networks: sail: driver: bridge volumes: - sail-mysql: - driver: local sail-redis: driver: local + sail-pgsql: + driver: local diff --git a/composer.json b/composer.json index 53cf4c3..b7895a8 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,8 @@ "php": "^8.3", "laravel/framework": "^13.17", "laravel/sanctum": "^4.0", - "laravel/tinker": "^3.0" + "laravel/tinker": "^3.0", + "nwidart/laravel-modules": "^13.2" }, "require-dev": { "fakerphp/faker": "^1.23", @@ -75,6 +76,11 @@ "extra": { "laravel": { "dont-discover": [] + }, + "merge-plugin": { + "include": [ + "Modules/*/composer.json" + ] } }, "config": { @@ -83,9 +89,10 @@ "sort-packages": true, "allow-plugins": { "pestphp/pest-plugin": true, - "php-http/discovery": true + "php-http/discovery": true, + "wikimedia/composer-merge-plugin": true } }, "minimum-stability": "stable", "prefer-stable": true -} +} \ No newline at end of file diff --git a/composer.lock b/composer.lock index f19d78a..2b7a7db 100644 --- a/composer.lock +++ b/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": "0e308dcd21ed728146a3d0f78862dc52", + "content-hash": "8fe4989870c9af337cdd73028d255255", "packages": [ { "name": "brick/math", @@ -2612,6 +2612,94 @@ ], "time": "2026-02-16T23:10:27+00:00" }, + { + "name": "nwidart/laravel-modules", + "version": "v13.2.0", + "source": { + "type": "git", + "url": "https://github.com/nWidart/laravel-modules.git", + "reference": "59714840708a2aece19e810764473f53227c35fe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nWidart/laravel-modules/zipball/59714840708a2aece19e810764473f53227c35fe", + "reference": "59714840708a2aece19e810764473f53227c35fe", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-simplexml": "*", + "php": "^8.3", + "wikimedia/composer-merge-plugin": "^2.1" + }, + "require-dev": { + "larastan/larastan": "^3.9.3", + "laravel/framework": "^13.0", + "laravel/pint": "^1.16", + "mockery/mockery": "^1.6", + "orchestra/testbench": "^11.0", + "phpunit/phpunit": "^12.0", + "spatie/phpunit-snapshot-assertions": "^5.0" + }, + "type": "library", + "extra": { + "laravel": { + "aliases": { + "Module": "Nwidart\\Modules\\Facades\\Module" + }, + "providers": [ + "Nwidart\\Modules\\LaravelModulesServiceProvider" + ] + }, + "branch-alias": { + "dev-master": "13.x-dev" + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Nwidart\\Modules\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Widart", + "email": "n.widart@gmail.com", + "homepage": "https://nicolaswidart.com", + "role": "Developer" + } + ], + "description": "Laravel Module management", + "keywords": [ + "laravel", + "module", + "modules", + "nwidart", + "rad" + ], + "support": { + "issues": "https://github.com/nWidart/laravel-modules/issues", + "source": "https://github.com/nWidart/laravel-modules/tree/v13.2.0" + }, + "funding": [ + { + "url": "https://github.com/dcblogdev", + "type": "github" + }, + { + "url": "https://github.com/nwidart", + "type": "github" + } + ], + "time": "2026-10-25T18:32:55+00:00" + }, { "name": "phpoption/phpoption", "version": "1.10.0", @@ -6104,6 +6192,62 @@ } ], "time": "2026-04-26T05:33:54+00:00" + }, + { + "name": "wikimedia/composer-merge-plugin", + "version": "v2.1.0", + "source": { + "type": "git", + "url": "https://github.com/wikimedia/composer-merge-plugin.git", + "reference": "a03d426c8e9fb2c9c569d9deeb31a083292788bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wikimedia/composer-merge-plugin/zipball/a03d426c8e9fb2c9c569d9deeb31a083292788bc", + "reference": "a03d426c8e9fb2c9c569d9deeb31a083292788bc", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1||^2.0", + "php": ">=7.2.0" + }, + "require-dev": { + "composer/composer": "^1.1||^2.0", + "ext-json": "*", + "mediawiki/mediawiki-phan-config": "0.11.1", + "php-parallel-lint/php-parallel-lint": "~1.3.1", + "phpspec/prophecy": "~1.15.0", + "phpunit/phpunit": "^8.5||^9.0", + "squizlabs/php_codesniffer": "~3.7.1" + }, + "type": "composer-plugin", + "extra": { + "class": "Wikimedia\\Composer\\Merge\\V2\\MergePlugin", + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Wikimedia\\Composer\\Merge\\V2\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bryan Davis", + "email": "bd808@wikimedia.org" + } + ], + "description": "Composer plugin to merge multiple composer.json files", + "support": { + "issues": "https://github.com/wikimedia/composer-merge-plugin/issues", + "source": "https://github.com/wikimedia/composer-merge-plugin/tree/v2.1.0" + }, + "time": "2023-04-15T19:07:00+00:00" } ], "packages-dev": [ diff --git a/database/migrations/0001_01_01_000000_create_users_table.php b/database/migrations/0001_01_01_000000_create_users_table.php index 05fb5d9..6250adc 100644 --- a/database/migrations/0001_01_01_000000_create_users_table.php +++ b/database/migrations/0001_01_01_000000_create_users_table.php @@ -12,7 +12,7 @@ return new class extends Migration public function up(): void { Schema::create('users', function (Blueprint $table) { - $table->id(); + $table->uuid('id')->primary(); $table->string('name'); $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); @@ -29,7 +29,7 @@ return new class extends Migration Schema::create('sessions', function (Blueprint $table) { $table->string('id')->primary(); - $table->foreignId('user_id')->nullable()->index(); + $table->uuid('user_id')->nullable()->index(); $table->string('ip_address', 45)->nullable(); $table->text('user_agent')->nullable(); $table->longText('payload'); diff --git a/modules_statuses.json b/modules_statuses.json new file mode 100644 index 0000000..0c7f4ec --- /dev/null +++ b/modules_statuses.json @@ -0,0 +1,3 @@ +{ + "Auth": true +} \ No newline at end of file