team-nifty-gmbh / flux-erp
Requires
- php: ^8.2
- ext-bcmath: *
- ext-intl: *
- ext-json: *
- ext-pdo: *
- barryvdh/laravel-dompdf: ^2.0
- beyondcode/laravel-websockets: ^1.13.2
- laravel-notification-channels/webpush: ^7.1
- laravel/fortify: ^1.13
- laravel/framework: ^10.0
- laravel/sanctum: ^3.0
- laravel/scout: ^10.0
- livewire/livewire: ^3.0
- meilisearch/meilisearch-php: ^1.3
- php-http/discovery: ^1.15
- pusher/pusher-php-server: ^7.0.2
- spatie/laravel-activitylog: ^4.6
- spatie/laravel-medialibrary: ^11.0
- spatie/laravel-model-info: ^1.4
- spatie/laravel-model-states: ^2.4
- spatie/laravel-permission: ^6.0
- spatie/laravel-query-builder: ^5.0
- spatie/laravel-tags: ^4.3
- spatie/laravel-translatable: ^6.0
- spatie/laravel-translation-loader: ^2.7
- spatie/pdf-to-image: ^2.2
- team-nifty-gmbh/tall-calendar: ^0.2.3
- team-nifty-gmbh/tall-datatables: ^0.7|^0.8
- webklex/laravel-imap: ^5.3
- wireui/heroicons: ^2.3
- wireui/wireui: ^1.18.4
Requires (Dev)
- brianium/paratest: ^7.0
- friendsofphp/php-cs-fixer: ^v3.6
- laravel/dusk: ^7.11
- laravel/pint: ^1.1
- nunomaduro/collision: ^7.4
- orchestra/testbench: ^8.13
- orchestra/testbench-dusk: ^8.11
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^10.0
- squizlabs/php_codesniffer: ^3.6
- vlucas/phpdotenv: ^5.5
Suggests
- dev-main
- v0.4.0
- v0.3.0
- v0.2.11
- v0.2.10
- v0.2.9
- v0.2.8
- v0.2.7
- v0.2.6
- v0.2.5
- v0.2.4
- v0.2.3
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.13
- v0.1.12
- v0.1.11
- v0.1.10
- v0.1.9
- v0.1.8
- v0.1.7
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
- v0.0.2
- v0.0.1
- dev-extend-calendar
- dev-add-additional-addresses-to-order
- dev-file-upload-filepond
- dev-dependabot/composer/wireui/wireui-tw-2.1.3
- dev-fix-stock-posting-subscriber
- dev-fix-order-detail-file-download
- dev-add-sections-to-project
- dev-add-percentage-cast
- dev-fix-portal-order-detail
- dev-fix-flux-seeders
- dev-update-wireui-v2
- dev-browser-test-orders
- dev-ticket-types-refactor
- dev-change-tests-to-build-against-multiple-laravel-versions
- dev-automation
- dev-add-model-locking
- dev-form-builder-frontend
This package is auto-updated.
Last update: 2024-09-29 02:35:58 UTC
README
1. 安装
从 routes/web.php
中移除欢迎路由。
将以下内容添加到您的 config/filesystem.php
配置文件中
'links' => [ ... public_path('flux') => base_path('vendor/team-nifty-gmbh/flux-erp/public'), ],
链接 flux-erp 资产
php artisan storage:link
这将创建一个指向 public/flux
的符号链接到 vendor/team-nifty-gmbh/flux/public
,这是 flux-erp 资产存储的位置。
如果您想使用种子文件,请将以下内容添加到您的 DatabaseSeeder.php 文件中
$this->call(\FluxErp\Database\Seeders\FluxSeeder::class);
因为 vite 将推送数据包含在构建过程中,所以在安装后需要重新构建资产。
vite build
请记住,在设置 .env 文件中的推送者凭证后执行此操作。
2. 开发
如果您想为 flux-erp 开发,应发布 docker 文件(这使用 nginx 而不是 artisan serve)
php artisan vendor:publish --tag="flux-docker"
作为替代方案,您可以更改您的 docker-compose.yml 文件以使用来自 vendor 文件夹的 flux-erp docker 文件。
laravel.test: build: context: ./vendor/team-nifty-gmbh/flux-erp/docker/8.2 # <--- Here ...
如果您已经构建了 docker 镜像,您应该重新构建它们
sail build --no-cache
3. 运行测试
cd vendor/flux-erp composer i composer test
2. Websockets
我期望您使用 nginx 和 certbot ssl 运行 flux 应用程序。重要的是要理解 nginx 作为运行在 supervisor 中的 websockets 的代理。
这意味着您的 supervisor 配置文件应使用与 nginx 配置文件中不同的端口。您应使用端口 443 构建Pusher配置,因为它应该是您的应用程序的生产端口。
// resources/js/bootstrap.js import Echo from 'laravel-echo' import Pusher from 'pusher-js'; window.Pusher = Pusher; window.Echo = new Echo({ broadcaster: 'pusher', key: import.meta.env.VITE_PUSHER_APP_KEY, cluster:import.meta.env.VITE_PUSHER_APP_CLUSTER, wsHost: window.location.hostname, // <-- important if you dont build the js file on the prod server wsPort: 80, // <-- this ensures that nginx will receive the request wssPort: 443, // <-- this ensures that nginx will receive the request disableStats: true, enabledTransports: ['ws', 'wss'], });
您的 nginx 配置应如下所示
# Virtual Host configuration for tnconnect # # You can move that to a different file under sites-available/ and symlink that # to sites-enabled/ to enable it. # map $http_upgrade $type { default "web"; websocket "wss"; } server { # SSL configuration # # listen 443 ssl default_server; # listen [::]:443 ssl default_server; # # Note: You should disable gzip for SSL traffic. # See: https://bugs.debian.org/773332 # # Read up on ssl_ciphers to ensure a secure configuration. # See: https://bugs.debian.org/765782 # # Self signed certs generated by the ssl-cert package # Don't use them in a production server! # # include snippets/snakeoil.conf; root /var/www/your.domain.com/public; charset utf-8; error_page 404 /index.php; add_header X-Content-Type-Options "nosniff"; add_header X-XSS-Protection "1; mode=block"; add_header X-Frame-Options "SAMEORIGIN"; # Add index.php to the list if you are using PHP index index.php; server_name your.domain.com; location / { try_files /nonexistent @$type; } location @web { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ /index.php?$args; } location @wss { proxy_pass http://127.0.0.1:6001; proxy_set_header Host $host; proxy_read_timeout 60; proxy_connect_timeout 60; proxy_redirect off; # Allow the use of websockets proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } # pass PHP scripts to FastCGI server # location ~ \.php$ { include fastcgi_params; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; fastcgi_pass unix:/run/php/php8.2-fpm.sock; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\.ht { deny all; } ssl on; listen [::]:443 ssl ipv6only=on; # managed by Certbot listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/your.domain.com/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/your.domain.com/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot } server { if ($host = your.domain.com) { return 301 https://$host$request_uri; } # managed by Certbot listen 80 default_server; listen [::]:80 default_server; server_name your.domain.com; return 404; # managed by Certbot }
您的 .env 文件应如下所示
# .env REVERB_APP_ID=local REVERB_APP_KEY=local REVERB_APP_SECRET=local REVERB_HOST=your.domain.com REVERB_SCHEME=https REVERB_PORT=443
这确保了 nginx 处理您的请求,如果您在同一服务器上运行多个 websockets 实例,nginx 将处理到正确实例的请求。
如果您只有一个 websockets 实例运行,您可以使用默认端口 6001 并从您的 .env 文件中删除 PUSHER_PORT
。
# .env REVERB_APP_ID=local REVERB_APP_KEY=local REVERB_APP_SECRET=local REVERB_HOST=0.0.0.0 REVERB_PORT=8080 REVERB_SCHEME=http
这不会通过 nginx 处理,而是由 websocket 服务器直接处理。