diff --git a/app/Controllers/WelcomeController.php b/app/Controllers/WelcomeController.php index d1df61e0..100d24d0 100644 --- a/app/Controllers/WelcomeController.php +++ b/app/Controllers/WelcomeController.php @@ -11,7 +11,7 @@ class WelcomeController extends Controller * Show index * * @param Request $request - * @return string + * @return string|null */ public function __invoke(Request $request): ?string { diff --git a/app/Exceptions/ErrorHandle.php b/app/Exceptions/ErrorHandle.php index c184e05a..ac3a2549 100644 --- a/app/Exceptions/ErrorHandle.php +++ b/app/Exceptions/ErrorHandle.php @@ -13,8 +13,9 @@ class ErrorHandle extends BaseErrorHandler * handle the error * * @param Exception $exception + * @return mixed|string */ - public function handle($exception) + public function handle(Exception $exception): mixed { if (request()->isAjax()) { return $this->json($exception); diff --git a/app/Models/User.php b/app/Models/User.php index bc54caad..3d691f53 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -2,9 +2,15 @@ namespace App\Models; -use Bow\Auth\Authentication as AuthenticatableModel; +use Bow\Auth\Authentication as AuthenticationModel; -class User extends AuthenticatableModel +/** + * @property mixed|string $name + * @property mixed|string $lastname + * @property mixed|string $email + * @property bool|mixed|string $password + */ +class User extends AuthenticationModel { /** * The list of hidden field when toJson is called diff --git a/app/Services/UserService.php b/app/Services/UserService.php index 88049267..69b03d54 100644 --- a/app/Services/UserService.php +++ b/app/Services/UserService.php @@ -25,7 +25,7 @@ public function __construct(User $user) /** * Get all available users * - * @return Collection + * @return Collection|null */ public function fetchAll(): ?Collection { @@ -38,7 +38,7 @@ public function fetchAll(): ?Collection * @param string $name * @param string $lastname * @param string $email - * @return User + * @return User|null */ public function create(string $name, string $lastname, string $email): ?User { diff --git a/bow b/bow index 03da0aa9..b1e4e9ca 100755 --- a/bow +++ b/bow @@ -7,7 +7,7 @@ use Bow\Console\Console; // Register The Auto Loader if (!file_exists(__DIR__."/vendor/autoload.php")) { - die("Please install the depencencies with 'composer update'"); + die("Please install the dependencies with 'composer update'"); } require __DIR__."/vendor/autoload.php"; diff --git a/composer.json b/composer.json index b6110cde..c06c5ce8 100644 --- a/composer.json +++ b/composer.json @@ -16,8 +16,12 @@ }, "require": { "php": "^8.1", - "bowphp/framework": "^5.0", - "bowphp/policier": "^3.0" + "bowphp/framework": "^5.x-dev", + "bowphp/policier": "^3.0", + "ext-pdo": "*", + "ext-redis": "*", + "ext-curl": "*", + "ext-ftp": "*" }, "require-dev": { "phpunit/phpunit": "^9", diff --git a/config/app.php b/config/app.php index 8c5b8bec..15237eaf 100644 --- a/config/app.php +++ b/config/app.php @@ -7,10 +7,10 @@ 'name' => app_env('APP_NAME', 'Bow Application'), /** - * The auto csrf enable csrf protected automaticly + * The auto csrf enable csrf protected automatically * on POST, DELETE, PUT */ - "auto_csrf" => app_env("APP_AUTO_CSRF", true), + "auto_csrf" => (bool) app_env("APP_AUTO_CSRF", true), /** * Root of the application diff --git a/config/cache.php b/config/cache.php index 581aff29..9dddd72c 100644 --- a/config/cache.php +++ b/config/cache.php @@ -8,7 +8,8 @@ // The filesystem connection "file" => [ "driver" => "file", - "path" => __DIR__ . '/../var/cache' + "path" => __DIR__ . '/../var/cache', + "prefix" => "", ], // The database connection @@ -16,13 +17,14 @@ "driver" => "database", "connection" => app_env('DB_DEFAULT', 'mysql'), "table" => "caches", + "prefix" => "", ], // The redis connection "redis" => [ 'driver' => 'redis', 'database' => app_env('REDIS_CACHE_DB', 5), - "prefix" => "__app__", + "prefix" => "", ] ] ]; diff --git a/config/database.php b/config/database.php index a47a1658..209e667a 100644 --- a/config/database.php +++ b/config/database.php @@ -19,7 +19,7 @@ /** * The database on which the default application will connect. * - * The database by default, it is on this data base that will connects + * The database by default, it is on this database that will connect * automatically. So you absolutely must not edit the default key. * * In the opposite box you must execute the code in each route. diff --git a/config/helpers.php b/config/helpers.php index 6790b529..3cd06063 100644 --- a/config/helpers.php +++ b/config/helpers.php @@ -2,12 +2,13 @@ if (!function_exists('mix')) { /** - * Get mixfile chunkhash version + * Get mix file chunk hash version * * @param string $path * @return string + * @throws Exception */ - function mix($path) + function mix(string $path) { $manifest = config('app.mixfile_path'); @@ -34,7 +35,7 @@ function mix($path) * @param string $path * @return string */ - function public_path($path = '') + function public_path(string $path = ''): string { return __DIR__ . '/../public/' . ltrim($path, '/'); } @@ -47,7 +48,7 @@ function public_path($path = '') * @param string $path * @return string */ - function frontend_path($path = '') + function frontend_path(string $path = '') { return __DIR__ . '/../frontend/' . ltrim($path, '/'); } @@ -60,7 +61,7 @@ function frontend_path($path = '') * @param string $path * @return string */ - function storage_path($path = '') + function storage_path(string $path = '') { return __DIR__ . '/../var/' . ltrim($path, '/'); } @@ -72,7 +73,7 @@ function storage_path($path = '') * * @return string */ - function base_path($path = '') + function base_path($path = ''): string { return rtrim(rtrim(realpath(__DIR__ . '/..'), '/') . '/' . $path, '/'); } @@ -86,7 +87,7 @@ function base_path($path = '') * @param int $len * @return string */ - function gen_slix($len = 4) + function gen_slix(int $len = 4): string { return substr(str_shuffle(uniqid()), 0, $len); } @@ -98,7 +99,7 @@ function gen_slix($len = 4) * * @return string */ - function gen_unique_id() + function gen_unique_id(): string { $id = base_convert(microtime(false), 10, 36); diff --git a/config/mail.php b/config/mail.php index a98b81cc..29eb0fe2 100644 --- a/config/mail.php +++ b/config/mail.php @@ -20,7 +20,7 @@ "from" => "sender@example.com", /** - * SMTP authentification + * SMTP authentication */ "smtp" => [ "hostname" => app_env("SMTP_HOSTNAME"), @@ -33,7 +33,7 @@ ], /** - * SMTP authentification + * SMTP authentication */ "ses" => [ "profile" => app_env("SES_PROFILE", "default"), diff --git a/config/policier.php b/config/policier.php index a9b86150..3de15a3e 100644 --- a/config/policier.php +++ b/config/policier.php @@ -1,7 +1,7 @@ app_env("APP_JWT_SECRET", "FivwuTmpJlwfXB/WMjAyMS0wMS0yNCAyMDozMTozMTE2MTE1MjAyOTEuMDEwOA=="), + "signkey" => app_env("APP_JWT_SECRET"), /** * Token expiration time diff --git a/config/queue.php b/config/queue.php index 715454a5..1d9574c9 100644 --- a/config/queue.php +++ b/config/queue.php @@ -2,9 +2,9 @@ return [ /** - * The defaut connexion + * The default connexion */ - "default" => "beanstalkd", + "default" => "sync", /** * The queue drive connection diff --git a/config/security.php b/config/security.php index 88dc8c2f..b0f6a2f3 100644 --- a/config/security.php +++ b/config/security.php @@ -30,7 +30,7 @@ ], /** - * When using token. This is the life time of a token. + * When using token. This is the lifetime of a token. * It is strongly advised to program with tokens. */ 'token_expirate_time' => 50000 diff --git a/config/storage.php b/config/storage.php index 0833b076..61d31437 100644 --- a/config/storage.php +++ b/config/storage.php @@ -30,11 +30,8 @@ 'password' => app_env('FTP_PASSWORD'), 'username' => app_env('FTP_USERNAME'), 'port' => app_env('FTP_PORT', 21), - // The basic folder of the server 'root' => app_env('FTP_STARTROOT', null), - // A `true` to activate a secure connection. 'tls' => app_env('FTP_TLS', false), - // Connection waiting time 'timeout' => app_env('FTP_TIMEOUT', 50) ], diff --git a/config/view.php b/config/view.php index 252bc558..22c5f72a 100644 --- a/config/view.php +++ b/config/view.php @@ -3,7 +3,7 @@ return [ /** * The views directory. It is in this repertory that you will put all your views. - * The views must have the instantion you have defined in 'template_extension' + * The views must have the installation you have defined in 'template_extension' * if no error will be launched */ 'path' => __DIR__ . '/../templates', @@ -17,7 +17,7 @@ * Template supported twig, php, tintin * Define the template name. * Example: define twig with package twig/twig for define twig template - * Bow Framework support actualy twig, tintin, php + * Bow Framework support actually twig, tintin, php */ 'engine' => 'tintin', @@ -36,7 +36,7 @@ /** * Additional option */ - 'aditionnal_options' => [ + 'additional_options' => [ // 'auto_reload_cache' => true ] ]; diff --git a/frontend/js/app.js b/frontend/js/app.js index a139db8b..a326af64 100644 --- a/frontend/js/app.js +++ b/frontend/js/app.js @@ -1,7 +1,6 @@ -/** - * import Vue from "vue" - * import Example from "./Example.vue" - */ +// import Vue from "vue" +// import Example from "./Example.vue" + window.axios = require('axios'); window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; @@ -16,10 +15,8 @@ if (token) { */ require('./Example.jsx'); -/* - * Vue.component('example', Example); - * - * new Vue({ - * el: "#main" - * }); - */ +// Vue.component('example', Example); + +// new Vue({ +// el: "#main" +// }); diff --git a/frontend/sass/app.scss b/frontend/sass/app.scss index e7f35b52..b74955d9 100644 --- a/frontend/sass/app.scss +++ b/frontend/sass/app.scss @@ -1,9 +1,9 @@ -@import "variables"; - -#main { - position: relative; - margin: 10% auto; - width: 550px; - text-align: center; - font-family: $font-family; -} +@use "variables"; + +#main { + position: relative; + margin: 10% auto; + width: 550px; + text-align: center; + font-family: $font-family; +} diff --git a/package.json b/package.json index adb06129..88d620f7 100644 --- a/package.json +++ b/package.json @@ -1,32 +1,29 @@ { - "scripts": { - "dev": "npm run development", - "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", - "prod": "npm run production", - "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", - "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", - "hot": "cross-env NODE_ENV=development webpack-dev-server --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", - "format": "composer run-script lint" - }, - "dependencies": { - "axios": ">=0.21.1", - "babel-loader": "^8.0.4", - "bootstrap": "^4.0.0", - "cross-env": "^5.1", - "css-loader": "^2.0.2", - "jquery": "^3.2", - "laravel-mix": "^6.0.49", - "lodash": "^4.17.5", - "popper.js": "^1.12", - "react": "^16.7.0", - "react-dom": "^16.7.0", - "resolve-url-loader": "^5.0.0", - "sass": "^1.15.2", - "sass-loader": "^7.1.0", - "vue": "^2.5.17" - }, - "devDependencies": { - "@babel/preset-react": "^7.0.0", - "vue-template-compiler": "^2.5.21" - } + "private": true, + "version": "0.0.1", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "lint": "eslint .", + "preview": "vite preview" + }, + "dependencies": { + "axios": "^1.7.9", + "react": "^18.3.1", + "react-dom": "^18.3.1" + }, + "devDependencies": { + "@eslint/js": "^9.17.0", + "@types/react": "^18.3.18", + "@types/react-dom": "^18.3.5", + "@vitejs/plugin-react": "^4.3.4", + "eslint": "^9.17.0", + "eslint-plugin-react-hooks": "^5.0.0", + "eslint-plugin-react-refresh": "^0.4.16", + "globals": "^15.14.0", + "typescript": "~5.6.2", + "typescript-eslint": "^8.18.2", + "vite": "^6.0.5" + } } diff --git a/public/img/logo.png b/public/img/logo.png new file mode 100644 index 00000000..dd384b51 Binary files /dev/null and b/public/img/logo.png differ diff --git a/public/img/logo.svg b/public/img/logo.svg deleted file mode 100644 index 0739265c..00000000 --- a/public/img/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/index.php b/public/index.php index 8475f0ee..0783293c 100644 --- a/public/index.php +++ b/public/index.php @@ -11,7 +11,7 @@ // Register The Auto Loader if (!file_exists(__DIR__ . "/../vendor/autoload.php")) { - die("Please install the depencencies with 'composer update'"); + die("Please install the dependencies with 'composer update'"); } require __DIR__."/../vendor/autoload.php"; diff --git a/seeders/_database.php b/seeders/_database.php new file mode 100644 index 00000000..aba6a35c --- /dev/null +++ b/seeders/_database.php @@ -0,0 +1,7 @@ + - %inject('title', 'It\'s Worked') -