diff --git a/app/Controllers/Controller.php b/app/Controllers/Controller.php index 8b0176e..da2e740 100644 --- a/app/Controllers/Controller.php +++ b/app/Controllers/Controller.php @@ -7,7 +7,7 @@ use Bow\Database\Database; use Bow\Validation\Validate; use Bow\Validation\Validator; -use Bow\Queue\ProducerService; +use Bow\Queue\QueueJob; use Bow\Contracts\ResponseInterface; use Bow\Configuration\Loader as Config; use Bow\Database\QueryBuilder; @@ -17,12 +17,12 @@ class Controller /** * Push the producer on queue list * - * @param ProducerService $producer + * @param QueueJob $job * @return mixed */ - public function queue(ProducerService $producer) + public function queue(QueueJob $job) { - queue($producer); + queue($job); } /** @@ -93,7 +93,7 @@ public function config(?string $key = null, mixed $setting = null) * @param ?callable $cb * @return Database */ - public function db(?string $name = null, ?callable $cb = null) + public function app_db(?string $name = null, ?callable $cb = null) { return call_user_func_array('db', func_get_args()); } diff --git a/app/Kernel.php b/app/Kernel.php index ca15921..3c44ab7 100644 --- a/app/Kernel.php +++ b/app/Kernel.php @@ -2,6 +2,7 @@ namespace App; +use Bow\Router\Router; use Bow\Configuration\Loader as ApplicationLoader; class Kernel extends ApplicationLoader @@ -36,7 +37,7 @@ public function namespaces(): array 'event' => 'App\\Events', 'listener' => 'App\\Listeners', 'exception' => 'App\\Exceptions', - 'producer' => 'App\\Producers', + 'job' => 'App\\Jobs', 'command' => 'App\\Commands', 'messaging' => 'App\\Messages', ]; @@ -102,6 +103,22 @@ public function boot(): ApplicationLoader { parent::boot(); + $this->routes(); + return $this; } + + /** + * Load the define route + * + * @return void + */ + public function routes(): void + { + global $router; + + $router = Router::getInstance(); + + require_once base_path('routes/app.php'); + } } diff --git a/frontend/js/Example.jsx b/assets/js/Example.jsx similarity index 100% rename from frontend/js/Example.jsx rename to assets/js/Example.jsx diff --git a/frontend/js/Example.vue b/assets/js/Example.vue similarity index 100% rename from frontend/js/Example.vue rename to assets/js/Example.vue diff --git a/frontend/js/app.js b/assets/js/app.js similarity index 100% rename from frontend/js/app.js rename to assets/js/app.js diff --git a/frontend/sass/_variables.scss b/assets/sass/_variables.scss similarity index 100% rename from frontend/sass/_variables.scss rename to assets/sass/_variables.scss diff --git a/frontend/sass/app.scss b/assets/sass/app.scss similarity index 100% rename from frontend/sass/app.scss rename to assets/sass/app.scss diff --git a/bow b/bow index 25aea72..14d8417 100755 --- a/bow +++ b/bow @@ -31,10 +31,10 @@ $setting->setServiceDirectory(__DIR__.'/app/Services'); $setting->setEventDirectory(__DIR__.'/app/Events'); $setting->setEventListenerDirectory(__DIR__.'/app/Listeners'); $setting->setSeederDirectory(__DIR__.'/seeders'); -$setting->setComponentDirectory(__DIR__.'/frontend'); +$setting->setComponentDirectory(__DIR__.'/assets'); $setting->setConfigDirectory(__DIR__.'/config'); $setting->setPublicDirectory(__DIR__.'/public'); -$setting->setProducerDirectory(__DIR__.'/app/Producers'); +$setting->setJobDirectory(__DIR__.'/app/Jobs'); $setting->setCommandDirectory(__DIR__.'/app/Commands'); $setting->setMessagingDirectory(__DIR__.'/app/Messages'); @@ -50,7 +50,7 @@ $console->bind($kernel); // Load the custom command application if (file_exists(__DIR__.'/routes/console.php')) { - require __DIR__.'/routes/console.php'; + require_once __DIR__.'/routes/console.php'; } // Start console diff --git a/config/app.php b/config/app.php index 15237ea..b966404 100644 --- a/config/app.php +++ b/config/app.php @@ -30,9 +30,9 @@ 'env_file' => realpath(__DIR__ . '/../.env.json'), /** - * Path to the frontend folder + * Path to the assets folder */ - 'frontend_path' => dirname(__DIR__) . '/frontend', + 'frontend_path' => dirname(__DIR__) . '/assets', /** * Path to the seeders folder diff --git a/config/database.php b/config/database.php index 209e667..5cc45ea 100644 --- a/config/database.php +++ b/config/database.php @@ -23,7 +23,7 @@ * automatically. So you absolutely must not edit the default key. * * In the opposite box you must execute the code in each route. - * `db('the key name')` or `Bow\Database\Database::connection('the key name')` + * `app_db('the key name')` or `Bow\Database\Database::connection('the key name')` */ 'connections' => [ /** diff --git a/config/storage.php b/config/storage.php index 61d3143..b3ed31c 100644 --- a/config/storage.php +++ b/config/storage.php @@ -37,16 +37,20 @@ /** * S3 configuration + * Supports both AWS S3 and MinIO (S3-compatible storage) */ 's3' => [ 'driver' => 's3', 'bucket' => app_env('S3_BUCKET', 'settlements'), - 'region' => app_env('AWS_REGION'), + 'region' => app_env('AWS_REGION', 'us-east-1'), 'version' => 'latest', 'credentials' => [ 'key' => app_env('AWS_KEY'), 'secret' => app_env('AWS_SECRET'), ], - ] + // MinIO configuration (optional) + 'endpoint' => app_env('AWS_ENDPOINT'), // e.g., 'http://localhost:9000' for MinIO + 'use_path_style_endpoint' => app_env('AWS_USE_PATH_STYLE_ENDPOINT', false), // Set to true for MinIO + ], ], ]; diff --git a/public/index.php b/public/index.php index 3a6a2a6..218334b 100644 --- a/public/index.php +++ b/public/index.php @@ -20,11 +20,8 @@ // Bind kernel to application $app->bind( - Kernel::configure(realpath(__DIR__ . '/../config')) + Kernel::configure(base_path('config')) ); -// Load application routing -require __DIR__ . "/../routes/app.php"; - // Run The Application -$app->send(); +$app->run(); diff --git a/routes/app.php b/routes/app.php index f7357c0..d40657f 100644 --- a/routes/app.php +++ b/routes/app.php @@ -2,4 +2,4 @@ use App\Controllers\WelcomeController; -$app->get('/', WelcomeController::class)->name('app.index'); +$router->get('/', WelcomeController::class)->name('app.index'); diff --git a/routes/console.php b/routes/console.php index 585e17e..26dff23 100644 --- a/routes/console.php +++ b/routes/console.php @@ -2,10 +2,11 @@ use Bow\Console\Color; use Bow\Console\Argument; +use App\Commands\TestCommand; -$console->addCommand( - 'hello', - function (Argument $argument) { - echo Color::green("hello, bow task runner."); - } -); +$console->addCommand('hello', function (Argument $argument) { + $index = route('app.index'); + echo Color::green("hello, bow task runner."); +}); + +$console->addCommand('test:hello', TestCommand::class); diff --git a/seeders/20251220174703-user-seeder.php b/seeders/20251220174703-user-seeder.php new file mode 100644 index 0000000..2f55886 --- /dev/null +++ b/seeders/20251220174703-user-seeder.php @@ -0,0 +1,25 @@ + $faker->name, + 'description' => $faker->text(100), + 'email' => $faker->email, + 'password' => app_hash('password'), + 'created_at' => date('Y-m-d H:i:s'), + 'updated_at' => date('Y-m-d H:i:s'), + ]; + + User::create($user); + } + } +} diff --git a/seeders/_database.php b/seeders/_database.php deleted file mode 100644 index 953a9ad..0000000 --- a/seeders/_database.php +++ /dev/null @@ -1,7 +0,0 @@ - $faker->name, - 'description' => $faker->text, - 'email' => $faker->email, - 'password' => app_hash('password'), - 'created_at' => date('Y-m-d H:i:s'), - 'updated_at' => date('Y-m-d H:i:s'), - ]; -} - -return [User::class => $seeds]; diff --git a/templates/layouts/default.tintin.php b/templates/layouts/default.tintin.php index 6f58b54..941c8f6 100644 --- a/templates/layouts/default.tintin.php +++ b/templates/layouts/default.tintin.php @@ -100,8 +100,8 @@ -
- %inject('content') -
+
+ %inject('content') +
diff --git a/vite.config.js b/vite.config.js index edf10bd..aa13fde 100644 --- a/vite.config.js +++ b/vite.config.js @@ -6,13 +6,13 @@ import tailwindcss from "@tailwindcss/vite"; export default defineConfig({ plugins: [react(), vue(), tailwindcss()], - root: path.resolve(__dirname, 'frontend'), + root: path.resolve(__dirname, 'assets'), build: { outDir: path.resolve(__dirname, 'public'), emptyOutDir: true, rollupOptions: { input: { - app: path.resolve(__dirname, 'frontend/js/app.js') + app: path.resolve(__dirname, 'assets/js/app.js') }, output: { entryFileNames: 'js/[name].js', @@ -31,7 +31,7 @@ export default defineConfig({ css: { preprocessorOptions: { scss: { - additionalData: `@import "${path.resolve(__dirname, 'frontend/sass/variables.scss')}";` + additionalData: `@import "${path.resolve(__dirname, 'assets/sass/variables.scss')}";` }, less: { javascriptEnabled: true @@ -40,8 +40,8 @@ export default defineConfig({ }, resolve: { alias: { - '@': path.resolve(__dirname, 'frontend/js'), - '@sass': path.resolve(__dirname, 'frontend/sass') + '@': path.resolve(__dirname, 'assets/js'), + '@sass': path.resolve(__dirname, 'assets/sass') } }, server: {