@fleetbase/customer-portal-engine

中文文档
0.0.16发布于 2026/10/14AGPL-3.0-or-later近 30 天下载 2412

Extendable Customer Portal for Fleetbase

原始使用文档
文档目录11 节
  1. Overview
  2. Features
  3. Architecture
  4. Frontend package
  5. Backend package
  6. Installation
  7. Development Setup
  8. Configuration
  9. Quality Checks
  10. Contributing
  11. License

Fleetbase Customer Portal

An extendable customer workspace for Fleetbase with self-service orders, billing, documents, support, account settings, and dashboard widgets.

License npm package Packagist package Node.js >= 22 Ember 5.4 PHP ^8.0

Fleetbase Customer Portal

Overview

Fleetbase Customer Portal is a first-party Fleetbase extension that gives customers a secure, self-service workspace connected to Fleetbase Console, FleetOps, and Ledger. It ships as an Ember engine for the frontend and a Laravel package for the backend API.

The portal is designed for customer-facing logistics workflows: customers can sign in, track orders, place new orders, view invoices, manage documents, open support tickets, update account preferences, and use dashboard widgets tailored to their account.

Features

  • Customer authentication - Customer login, two-factor verification, password recovery, customer session loading, and automatic redirects from customer access URLs.
  • Dashboard workspace - Customer dashboard registration with widgets for active orders, completed orders, unpaid invoices, open support tickets, recent orders, and pending actions.
  • Order management - Order listing, order details, order creation, route preview, place lookup, payload/entities, custom fields, notes, documents, cancel, reschedule, and file attachments.
  • Quotes and payments - Preliminary service quote lookup, portal-scoped purchase rates, optional Stripe checkout sessions, payment status checks, and Ledger invoice reconciliation.
  • Billing - Customer invoice lists, invoice details, and invoice summaries backed by Ledger when it is installed and available.
  • Support - Customer support tickets backed by FleetOps Issues, including issue creation, summaries, comments, replies, editing, and deletion.
  • Documents and address book - Customer-visible order documents plus account-scoped place search, lookup, creation, update, and deletion.
  • Account settings - Account profile data, self-service password change, vendor conversion flows, personnel management, and notification preferences.
  • Admin configuration - Console settings panel for portal configuration, access URL validation, enabled order configs, enabled service rates, and payment settings.
  • Extension points - Sidebar and login registries, dashboard/widget registration, virtual routes, and menu integration for extending the portal from other Fleetbase packages.

Architecture

This repository contains both sides of the extension:

addon/      Ember engine source: routes, templates, components, services, widgets, and extension registration
app/        Re-exports that make addon modules available to the consuming Fleetbase Console app
server/     Laravel package source: routes, controllers, services, providers, notifications, and observers
tests/      Ember/QUnit tests and dummy app support

Frontend package

@fleetbase/customer-portal-engine

The Ember engine mounts at the Fleetbase route configured in package.json:

{
    "fleetbase": {
        "route": "customer-portal",
        "mount": "root"
    }
}

The engine registers customer portal routes for authentication, dashboard, orders, billing, support, documents, address book, notifications, settings, account management, and virtual extension pages.

Backend package

fleetbase/customer-portal-api

The Laravel package registers portal APIs under the configurable prefix:

customer-portal/int/v1

Backend controllers and services scope data to the authenticated customer account, integrate with FleetOps orders and issues, integrate with Ledger invoices and transactions, and expose portal configuration for Console admins.

Installation

Install the backend package in the Fleetbase API:

composer require fleetbase/customer-portal-api

Install the Ember engine in Fleetbase Console:

pnpm install @fleetbase/customer-portal-engine

The package also depends on Fleetbase shared frontend packages and first-party backend packages, including Core API, FleetOps, and Ledger.

Development Setup

For local Fleetbase extension development, use Fleetbase's package linker so Console and API resolve this checkout instead of published package versions. See the official Fleetbase Development Setup guide for the full workflow.

Clone Fleetbase with submodules:

git clone https://github.com/fleetbase/fleetbase.git
cd fleetbase
git submodule update --init --recursive

Install the package linker once from the Fleetbase repository root:

npm link
flb-package-linker --help

Enable the customer portal package:

flb-package-linker enable customer-portal
flb-package-linker install customer-portal

You can let the linker run install commands immediately:

flb-package-linker enable customer-portal --install

For backend package work in Docker, mount local source into the application container:

services:
  application:
    environment:
      ENVIRONMENT: "development"
      APP_DEBUG: "true"
    volumes:
      - ./api:/fleetbase/api
      - ./packages:/fleetbase/packages

Restart the stack after changing Docker mounts:

docker compose up -d

Fleetbase runs Laravel Octane, so reload the application worker after PHP changes:

docker compose exec application php artisan octane:reload

For frontend work, run the Fleetbase Console development server locally or in Docker. The local path is usually the fastest:

docker compose stop console
cd console
pnpm install
pnpm start:dev

Console will be available at:

http://localhost:4200

Configuration

The backend config lives in server/config/customer-portal.php:

return [
    'api' => [
        'version' => '0.0.1',
        'routing' => [
            'prefix' => 'customer-portal',
            'internal_prefix' => 'int',
        ],
    ],
];

Portal admins can configure customer portal behavior from Fleetbase Console settings. The package includes API support for:

  • Portal configuration loading and saving
  • Customer access URL slug validation
  • Enabled order configurations
  • Enabled service rates
  • Payment availability and Stripe-backed checkout configuration

Quality Checks

Install dependencies for this package:

pnpm install
composer install

Run frontend checks:

pnpm lint
pnpm test

Run backend checks:

composer test

Useful focused commands:

pnpm start
pnpm build
pnpm test:ember
pnpm test:ember-compatibility
composer test:lint
composer test:types
composer test:unit

Contributing

Contributions are welcome. Keep changes scoped, include tests for behavior changes, and verify both the Ember engine and Laravel package paths when a feature crosses the frontend/backend boundary.

When developing inside the Fleetbase monorepo, prefer flb-package-linker over manual package.json, composer.json, or workspace edits so local development links remain reversible.

License

Fleetbase Customer Portal is released under the GNU Affero General Public License v3.0 or later. See LICENSE.md for details.

版本与发布记录

@fleetbase/customer-portal-engine 共发布 16 个版本,首次发布于 2024/10/02;过去 12 个月发布了 8 个版本。

版本发布日期距今
0.0.16latest2026/10/141 个月前
0.0.152026/09/281 个月前
0.0.142026/09/231 个月前
0.0.132026/08/172 个月前
0.0.122026/07/014 个月前
0.0.112026/06/055 个月前

关于 @fleetbase/customer-portal-engine 的常见问题

@fleetbase/customer-portal-engine 是什么?

Extendable Customer Portal for Fleetbase

如何安装 @fleetbase/customer-portal-engine?

在项目目录运行 npm install @fleetbase/customer-portal-engine,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:ember-engines(^0.9.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@fleetbase/customer-portal-engine 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/fleetbase__customer-portal-engine 是否存在。

@fleetbase/customer-portal-engine 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >= 22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@fleetbase/customer-portal-engine 可以商用吗?

@fleetbase/customer-portal-engine 使用 AGPL-3.0-or-later 许可。最严格的 Copyleft:除分发外,通过网络向用户提供基于它的服务也需要开源对应源码。闭源 SaaS 使用前务必评估。以上为概括,不构成法律意见,请以许可原文为准。

@fleetbase/customer-portal-engine 的下载量有多少?

根据 npm 官方下载统计,@fleetbase/customer-portal-engine 在 2026/10/15 – 2026/11/13 这 30 天内被下载 2,412 次,日均约 80 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fleetbase/customer-portal-engine 还在维护吗?

最新版本 0.0.16 发布于 2026/10/14(1 个月前);至今共发布 16 个版本,其中过去 12 个月发布了 8 个;首次发布于 2024/10/02。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。