Skip to content

Modular logistics and supply chain operating system (LSOS)

mergeable

Ronald A. Richardsonbc854c5d6cc2
diff --git a/api/app/Http/Middleware/Authenticate.php b/api/app/Http/Middleware/Authenticate.php
index 704089a7..432de0c8 100644
--- a/api/app/Http/Middleware/Authenticate.php
+++ b/api/app/Http/Middleware/Authenticate.php
@@ -14,8 +14,6 @@ class Authenticate extends Middleware
*/
protected function redirectTo($request)
{
- if (! $request->expectsJson()) {
- return route('login');
- }
+ return response()->error('Unauthenticated.');
}
}
diff --git a/api/composer.json b/api/composer.json
index c9f8e82a..77ea5b28 100644
--- a/api/composer.json
+++ b/api/composer.json
@@ -2,14 +2,16 @@
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
- "keywords": ["framework", "laravel"],
+ "keywords": [
+ "framework",
+ "laravel"
+ ],
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
- "fleetbase/core-api": "^1.1.1-alpha",
- "fleetbase/fleetops-api": "^1.0.5-alpha",
- "fleetbase/storefront-api": "^1.0.4-alpha",
- "fleetbase/billing-api": "^0.0.1",
+ "fleetbase/core-api": "^1.1.6-alpha",
+ "fleetbase/fleetops-api": "^1.0.9-alpha",
+ "fleetbase/storefront-api": "^1.0.8-alpha",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^8.75",
@@ -31,24 +33,6 @@
"nunomaduro/collision": "^5.10",
"phpunit/phpunit": "^9.5.10"
},
- "repositories": [
- {
- "type": "path",
- "url": "../packages/core-api"
- },
- {
- "type": "path",
- "url": "../packages/fleetops-api"
- },
- {
- "type": "path",
- "url": "../packages/storefront-api"
- },
- {
- "type": "path",
- "url": "../packages/billing-api"
- }
- ],
"autoload": {
"psr-4": {
"App\\": "app/",
@@ -62,15 +46,38 @@
}
},
"scripts": {
- "post-autoload-dump": ["Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "@php artisan package:discover --ansi"],
- "post-update-cmd": ["@php artisan vendor:publish --tag=laravel-assets --ansi --force"],
- "post-root-package-install": ["@php -r \"file_exists('.env') || copy('.env.example', '.env');\""],
- "post-create-project-cmd": ["@php artisan key:generate --ansi"],
- "clear-logs": ["rm -rf storage/logs/*.log", "composer dump-autoload", "chmod -R 777 storage", "chmod -R 777 bootstrap/cache", "chmod -R 777 resources"],
- "clean-logs": ["composer run-script clear-logs"],
- "dock": ["docker exec -it fleetbase_os_application_1 /usr/bin/tmux -u new"],
- "dock-server": ["docker exec -it fleetbase_os_httpd_1 /bin/sh"],
- "tunnel": ["ngrok http --region=ap --hostname=fleetbase.ap.ngrok.io 8000"]
+ "post-autoload-dump": [
+ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
+ "@php artisan package:discover --ansi"
+ ],
+ "post-update-cmd": [
+ "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
+ ],
+ "post-root-package-install": [
+ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
+ ],
+ "post-create-project-cmd": [
+ "@php artisan key:generate --ansi"
+ ],
+ "clear-logs": [
+ "rm -rf storage/logs/*.log",
+ "composer dump-autoload",
+ "chmod -R 777 storage",
+ "chmod -R 777 bootstrap/cache",
+ "chmod -R 777 resources"
+ ],
+ "clean-logs": [
+ "composer run-script clear-logs"
+ ],
+ "dock": [
+ "docker exec -it fleetbase_os_application_1 /usr/bin/tmux -u new"
+ ],
+ "dock-server": [
+ "docker exec -it fleetbase_os_httpd_1 /bin/sh"
+ ],
+ "tunnel": [
+ "ngrok http --region=ap --hostname=fleetbase.ap.ngrok.io 8000"
+ ]
},
"extra": {
"laravel": {
diff --git a/api/composer.lock b/api/composer.lock
index 594b1de0..0837429f 100644
--- a/api/composer.lock
+++ b/api/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": "d0072faf370f873d34e1469db0df9f42",
+ "content-hash": "e3385c144f1b88363d861cef4eb001ca",
"packages": [
{
"name": "aloha/twilio",
@@ -192,16 +192,16 @@
},
{
"name": "aws/aws-sdk-php",
- "version": "3.275.7",
+ "version": "3.276.3",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
- "reference": "54dcef3349c81b46c0f5f6e54b5f9bfb5db19903"
+ "reference": "c8b38cfab677a3ec98e3f40bccd1a2bf851a014f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/54dcef3349c81b46c0f5f6e54b5f9bfb5db19903",
- "reference": "54dcef3349c81b46c0f5f6e54b5f9bfb5db19903",
+ "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/c8b38cfab677a3ec98e3f40bccd1a2bf851a014f",
+ "reference": "c8b38cfab677a3ec98e3f40bccd1a2bf851a014f",
"shasum": ""
},
"require": {
@@ -281,9 +281,9 @@
"support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues",
- "source": "https://github.com/aws/aws-sdk-php/tree/3.275.7"
+ "source": "https://github.com/aws/aws-sdk-php/tree/3.276.3"
},
- "time": "2023-07-13T18:21:04+00:00"
+ "time": "2023-07-21T18:30:18+00:00"
},
{
"name": "aws/aws-sdk-php-laravel",
@@ -2000,98 +2000,19 @@
},
"time": "2023-07-14T18:33:00+00:00"
},
- {
- "name": "fleetbase/billing-api",
- "version": "0.0.1",
- "dist": {
- "type": "path",
- "url": "../packages/billing-api",
- "reference": "9f0048b786cdbb0d637ff8313a45da51e44d7f05"
- },
- "require": {
- "fleetbase/core-api": "^1.1.4-alpha",
- "php": "^7.4|^8.0",
- "php-http/guzzle7-adapter": "^1.0",
- "psr/http-factory-implementation": "*"
- },
- "require-dev": {
- "friendsofphp/php-cs-fixer": "^2.16.4",
- "pestphp/pest": "^0.3.8",
- "phpstan/phpstan": "^0.12.48",
- "symfony/var-dumper": "^5.2.0"
- },
- "type": "library",
- "extra": {
- "laravel": {
- "providers": [
- "Fleetbase\\Billing\\Providers\\BillingServiceProvider"
- ]
- }
- },
- "autoload": {
- "psr-4": {
- "Fleetbase\\Billing\\": "src/"
- }
- },
- "autoload-dev": {
- "psr-4": {
- "Fleetbase\\Billing\\Tests\\": "tests/"
- }
- },
- "scripts": {
- "lint": [
- "php-cs-fixer fix -v"
- ],
- "test:lint": [
- "php-cs-fixer fix -v --dry-run"
- ],
- "test:types": [
- "phpstan analyse --ansi --memory-limit=0"
- ],
- "test:unit": [
- "pest --colors=always"
- ],
- "test": [
- "@test:lint",
- "@test:types",
- "@test:unit"
- ]
- },
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fleetbase Pte Ltd.",
- "email": "[email protected]"
- },
- {
- "name": "Ronald A. Richardson",
- "email": "[email protected]"
- }
- ],
- "description": "Enables billing of organizations on Fleetbase instance to generate revenue.",
- "keywords": [
- "billing",
- "billing system",
- "fleetbase",
- "fleetbase-extension",
- "revenue engine",
- "revenue generator",
- "stripe",
- "stripe api"
- ],
- "transport-options": {
- "relative": true
- }
- },
{
"name": "fleetbase/core-api",
- "version": "1.1.4-alpha",
+ "version": "1.1.6-alpha",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/fleetbase/core-api.git",
+ "reference": "9f33ddeae8e3df7ae296cb59997904639b276364"
+ },
"dist": {
- "type": "path",
- "url": "../packages/core-api",
- "reference": "46138923b54cebe5d6cbd6b3285379ef1ba0b967"
+ "type": "zip",
+ "url": "https://api.github.com/repos/fleetbase/core-api/zipball/9f33ddeae8e3df7ae296cb59997904639b276364",
+ "reference": "9f33ddeae8e3df7ae296cb59997904639b276364",
+ "shasum": ""
},
"require": {
"aloha/twilio": "^5.0",
@@ -2130,7 +2051,7 @@
"extra": {
"laravel": {
"providers": [
- "Fleetbase\\Activate\\CoreServiceProvider",
+ "Fleetbase\\Providers\\CoreServiceProvider",
"Fleetbase\\Providers\\EventServiceProvider",
"Fleetbase\\Providers\\SocketClusterServiceProvider"
]
@@ -2142,30 +2063,7 @@
"Fleetbase\\Seeds\\": "seeds/"
}
},
- "autoload-dev": {
- "psr-4": {
- "Fleetbase\\Tests\\": "tests/"
- }
- },
- "scripts": {
- "lint": [
- "php-cs-fixer fix -v"
- ],
- "test:lint": [
- "php-cs-fixer fix -v --dry-run"
- ],
- "test:types": [
- "phpstan analyse --ansi --memory-limit=0"
- ],
- "test:unit": [
- "pest --colors=always"
- ],
- "test": [
- "@test:lint",
- "@test:types",
- "@test:unit"
- ]
- },
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -2184,23 +2082,31 @@
"fleetbase",
"logistics platform"
],
- "transport-options": {
- "relative": true
- }
+ "support": {
+ "issues": "https://github.com/fleetbase/core-api/issues",
+ "source": "https://github.com/fleetbase/core-api/tree/v1.1.6-alpha"
+ },
+ "time": "2023-07-23T09:32:15+00:00"
},
{
"name": "fleetbase/fleetops-api",
- "version": "1.0.7-alpha",
+ "version": "1.0.9-alpha",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/fleetbase/fleetops-api.git",
+ "reference": "12a1c68eedcffed4142af8a43a4484fbe468f160"
+ },
"dist": {
- "type": "path",
- "url": "../packages/fleetops-api",
- "reference": "f8d287d7a40bdfaafcc700942c76b08be125f493"
+ "type": "zip",
+ "url": "https://api.github.com/repos/fleetbase/fleetops-api/zipball/12a1c68eedcffed4142af8a43a4484fbe468f160",
+ "reference": "12a1c68eedcffed4142af8a43a4484fbe468f160",
+ "shasum": ""
},
"require": {
"barryvdh/laravel-dompdf": "^2.0",
"brick/geo": "0.7.2",
"cknow/laravel-money": "^7.1",
- "fleetbase/core-api": "^1.1.3-alpha",
+ "fleetbase/core-api": "^1.1.6-alpha",
"geocoder-php/google-maps-places-provider": "^1.4",
"giggsey/libphonenumber-for-php": "^8.13",
"league/geotools": "^1.1.0",
@@ -2231,30 +2137,7 @@
"Fleetbase\\FleetOps\\": "src/"
}
},
- "autoload-dev": {
- "psr-4": {
- "Fleetbase\\Tests\\": "tests/"
- }
- },
- "scripts": {
- "lint": [
- "php-cs-fixer fix -v"
- ],
- "test:lint": [
- "php-cs-fixer fix -v --dry-run"
- ],
- "test:types": [
- "phpstan analyse --ansi --memory-limit=0"
- ],
- "test:unit": [
- "pest --colors=always"
- ],
- "test": [
- "@test:lint",
- "@test:types",
- "@test:unit"
- ]
- },
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -2276,21 +2159,29 @@
"last-mile",
"tms"
],
- "transport-options": {
- "relative": true
- }
+ "support": {
+ "issues": "https://github.com/fleetbase/fleetops-api/issues",
+ "source": "https://github.com/fleetbase/fleetops-api/tree/v1.0.9-alpha"
+ },
+ "time": "2023-07-23T09:34:55+00:00"
},
{
"name": "fleetbase/storefront-api",
- "version": "1.0.6-alpha",
+ "version": "1.0.8-alpha",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/fleetbase/storefront-api.git",
+ "reference": "102aaf2fe3a2bff1ed5c8ce7d300aba68a6e46f8"
+ },
"dist": {
- "type": "path",
- "url": "../packages/storefront-api",
- "reference": "8af95806b4291ccda29ab7e8ecb661206e7606fd"
+ "type": "zip",
+ "url": "https://api.github.com/repos/fleetbase/storefront-api/zipball/102aaf2fe3a2bff1ed5c8ce7d300aba68a6e46f8",
+ "reference": "102aaf2fe3a2bff1ed5c8ce7d300aba68a6e46f8",
+ "shasum": ""
},
"require": {
- "fleetbase/core-api": "^1.1.3-alpha",
- "fleetbase/fleetops-api": "^1.0.7-alpha",
+ "fleetbase/core-api": "^1.1.6-alpha",
+ "fleetbase/fleetops-api": "^1.0.9-alpha",
"geocoder-php/google-maps-places-provider": "^1.4",
"laravel-notification-channels/apn": "^3.8",
"laravel-notification-channels/fcm": "^2.7",
@@ -2317,7 +2208,8 @@
},
"fleetbase": {
"create-database": "storefront",
- "order-config": "Fleetbase\\Storefront\\Support\\OrderConfig"
+ "order-config": "Fleetbase\\Storefront\\Support\\OrderConfig",
+ "sandbox-migrations": false
}
},
"autoload": {
@@ -2325,30 +2217,7 @@
"Fleetbase\\Storefront\\": "src/"
}
},
- "autoload-dev": {
- "psr-4": {
- "Fleetbase\\Storefront\\Tests\\": "tests/"
- }
- },
- "scripts": {
- "lint": [
- "php-cs-fixer fix -v"
- ],
- "test:lint": [
- "php-cs-fixer fix -v --dry-run"
- ],
- "test:types": [
- "phpstan analyse --ansi --memory-limit=0"
- ],
- "test:unit": [
- "pest --colors=always"
- ],
- "test": [
- "@test:lint",
- "@test:types",
- "@test:unit"
- ]
- },
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -2370,9 +2239,11 @@
"marketplace",
"storefront"
],
- "transport-options": {
- "relative": true
- }
+ "support": {
+ "issues": "https://github.com/fleetbase/storefront-api/issues",
+ "source": "https://github.com/fleetbase/storefront-api/tree/v1.0.8-alpha"
+ },
+ "time": "2023-07-23T09:36:54+00:00"
},
{
"name": "fruitcake/laravel-cors",
@@ -2854,16 +2725,16 @@
},
{
"name": "giggsey/libphonenumber-for-php",
- "version": "8.13.16",
+ "version": "8.13.17",
"source": {
"type": "git",
"url": "https://github.com/giggsey/libphonenumber-for-php.git",
- "reference": "7716e1c385f293416bc7bbd1ff4ec93b04a821e2"
+ "reference": "dee92bfa0782fd5899fe6b295dea40cdb0607476"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/giggsey/libphonenumber-for-php/zipball/7716e1c385f293416bc7bbd1ff4ec93b04a821e2",
- "reference": "7716e1c385f293416bc7bbd1ff4ec93b04a821e2",
+ "url": "https://api.github.com/repos/giggsey/libphonenumber-for-php/zipball/dee92bfa0782fd5899fe6b295dea40cdb0607476",
+ "reference": "dee92bfa0782fd5899fe6b295dea40cdb0607476",
"shasum": ""
},
"require": {
@@ -2922,7 +2793,7 @@
"issues": "https://github.com/giggsey/libphonenumber-for-php/issues",
"source": "https://github.com/giggsey/libphonenumber-for-php"
},
- "time": "2023-07-10T19:39:54+00:00"
+ "time": "2023-07-20T10:32:50+00:00"
},
{
"name": "giggsey/locale",
@@ -14317,37 +14188,33 @@
},
{
"name": "mockery/mockery",
- "version": "1.6.2",
+ "version": "1.6.4",
"source": {
"type": "git",
"url": "https://github.com/mockery/mockery.git",
- "reference": "13a7fa2642c76c58fa2806ef7f565344c817a191"
+ "reference": "d1413755e26fe56a63455f7753221c86cbb88f66"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/mockery/mockery/zipball/13a7fa2642c76c58fa2806ef7f565344c817a191",
- "reference": "13a7fa2642c76c58fa2806ef7f565344c817a191",
+ "url": "https://api.github.com/repos/mockery/mockery/zipball/d1413755e26fe56a63455f7753221c86cbb88f66",
+ "reference": "d1413755e26fe56a63455f7753221c86cbb88f66",
"shasum": ""
},
"require": {
"hamcrest/hamcrest-php": "^2.0.1",
"lib-pcre": ">=7.0",
- "php": "^7.4 || ^8.0"
+ "php": ">=7.4,<8.3"
},
"conflict": {
"phpunit/phpunit": "<8.0"
},
"require-dev": {
"phpunit/phpunit": "^8.5 || ^9.3",
- "psalm/plugin-phpunit": "^0.18",
- "vimeo/psalm": "^5.9"
+ "psalm/plugin-phpunit": "^0.18.4",
+ "symplify/easy-coding-standard": "^11.5.0",
+ "vimeo/psalm": "^5.13.1"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "1.6.x-dev"
- }
- },
"autoload": {
"files": [
"library/helpers.php",
@@ -14365,12 +14232,20 @@
{
"name": "Pádraic Brady",
"email": "[email protected]",
- "homepage": "http://blog.astrumfutura.com"
+ "homepage": "https://github.com/padraic",
+ "role": "Author"
},
{
"name": "Dave Marshall",
"email": "[email protected]",
- "homepage": "http://davedevelopment.co.uk"
+ "homepage": "https://davedevelopment.co.uk",
+ "role": "Developer"
+ },
+ {
+ "name": "Nathanael Esayeas",
+ "email": "[email protected]",
+ "homepage": "https://github.com/ghostwriter",
+ "role": "Lead Developer"
}
],
"description": "Mockery is a simple yet flexible PHP mock object framework",
@@ -14388,10 +14263,13 @@
"testing"
],
"support": {
+ "docs": "https://docs.mockery.io/",
"issues": "https://github.com/mockery/mockery/issues",
- "source": "https://github.com/mockery/mockery/tree/1.6.2"
+ "rss": "https://github.com/mockery/mockery/releases.atom",
+ "security": "https://github.com/mockery/mockery/security/advisories",
+ "source": "https://github.com/mockery/mockery"
},
- "time": "2023-06-07T09:07:52+00:00"
+ "time": "2023-07-19T15:51:02+00:00"
},
{
"name": "myclabs/deep-copy",
diff --git a/api/config/app.php b/api/config/app.php
index ebd4fd1c..5a7d8993 100644
--- a/api/config/app.php
+++ b/api/config/app.php
@@ -165,8 +165,7 @@ return [
/*
* Package Service Providers...
*/
- Fleetbase\Providers\CoreServiceProvider::class,
-
+
/*
* Application Service Providers...
*/
diff --git a/api/config/cors.php b/api/config/cors.php
index 1fd744fa..1ec1d105 100644
--- a/api/config/cors.php
+++ b/api/config/cors.php
@@ -19,7 +19,7 @@ return [
'allowed_methods' => ['*'],
- 'allowed_origins' => ['http://localhost:4200'],
+ 'allowed_origins' => ['http://localhost:4200', env('CONSOLE_HOST')],
'allowed_origins_patterns' => [],
diff --git a/docker/Dockerfile b/docker/Dockerfile
index b1c7e2c2..e7ac4727 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -50,18 +50,13 @@ RUN composer dumpautoload
USER root
WORKDIR /
-# Copy nginx config
-COPY nginx.conf /etc/nginx/sites-enabled/default
-
-# Copy the startup script into the Docker image
-COPY startup.sh /startup.sh
-
-# Make sure the script is executable
-RUN chmod +x /startup.sh
-
# Create unique instance ID
RUN echo $(cat /proc/sys/kernel/random/uuid) > /.fleetbase
+# Setup composer auth if applicable
+RUN mkdir -p ~/.composer
+COPY composer-auth.jso[n] ~/.composer/auth.json
+
# Set environment
ARG ENVIRONMENT=production
ENV APP_ENV=$ENVIRONMENT
@@ -90,21 +85,14 @@ CMD ["go-crond", "--verbose", "--no-auto", "root:./crontab"]
# Application dev stage
FROM base as app-dev
ENTRYPOINT ["docker-php-entrypoint"]
-EXPOSE 80
-CMD ["/startup.sh"]
+CMD ["php-fpm"]
# Events stage
FROM base as events
ENTRYPOINT ["/sbin/ssm-parent", "-c", ".ssm-parent.yaml", "run", "--", "docker-php-entrypoint"]
-CMD ["php", "artisan", "queue:work", "events"]
-
-# Jobs stage
-FROM base as jobs
-ENTRYPOINT ["/sbin/ssm-parent", "-c", ".ssm-parent.yaml", "run", "--", "docker-php-entrypoint"]
CMD ["php", "artisan", "queue:work", "sqs"]
# Application stage
FROM base as app
ENTRYPOINT ["/sbin/ssm-parent", "-c", ".ssm-parent.yaml", "run", "--", "docker-php-entrypoint"]
-EXPOSE 80
-CMD ["/startup.sh"]
+CMD ["php-fpm"]
\ No newline at end of file
diff --git a/docker/httpd/Dockerfile b/docker/httpd/Dockerfile
index fa8d8d0a..5d26aca4 100644
--- a/docker/httpd/Dockerfile
+++ b/docker/httpd/Dockerfile
@@ -1,5 +1,7 @@
# alpine is more secure
FROM nginx:stable-alpine
-COPY docker/httpd/vhost.conf /etc/nginx/conf.d/default.conf
+ENV NGINX_APPLICATION_HOSTNAME application
+
+COPY docker/httpd/vhost.conf /etc/nginx/templates/default.conf.template
COPY api/public/ /var/www/html/api/public/
\ No newline at end of file
diff --git a/docker/httpd/vhost.conf b/docker/httpd/vhost.conf
index 2adf349b..062df1ec 100644
--- a/docker/httpd/vhost.conf
+++ b/docker/httpd/vhost.conf
@@ -4,7 +4,12 @@ server {
root /var/www/html/api/public;
# hide nginx version for security purposes
server_tokens off;
-
+ access_log /var/log/nginx/access.log;
+ error_log /var/log/nginx/error_log;
+ proxy_connect_timeout 600;
+ proxy_send_timeout 600;
+ proxy_read_timeout 600;
+ send_timeout 600;
index index.php;
location / {
@@ -34,7 +39,7 @@ server {
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
- fastcgi_pass application:9000;
+ fastcgi_pass ${NGINX_APPLICATION_HOSTNAME}:9000;
fastcgi_index index.php;
}
}
\ No newline at end of file