Files
catalog/readme.md
T

174 lines
6.8 KiB
Markdown

# @serve.zone/catalog
`@serve.zone/catalog` is the shared web-component catalog for serve.zone dashboards. It packages the UI building blocks used by Onebox, DcRouter-style operations views, and other serve.zone admin surfaces: dashboards, service views, app-store screens, DNS and routing tools, registry panels, email views, settings, tokens, and demo shells.
## Issue Reporting and Security
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
## Install
```bash
pnpm add @serve.zone/catalog
```
## What It Provides
The package exports browser-first TypeScript modules from `ts_web/index.ts`:
```typescript
export * from './elements/index.js';
export * from './pages/index.js';
```
Importing a component registers its custom element through `@design.estate/dees-element` decorators. Components use the Dees design system, support light and dark themes through Dees theme helpers, and communicate through DOM properties plus `CustomEvent` dispatching.
```typescript
import {
SzDashboardView,
SzLoginView,
SzServiceDetailView,
} from '@serve.zone/catalog';
```
```html
<sz-dashboard-view></sz-dashboard-view>
<sz-login-view></sz-login-view>
<sz-service-detail-view></sz-service-detail-view>
```
## Component Areas
| Area | Components |
| --- | --- |
| Dashboard | `SzDashboardView`, `SzResourceUsageCard`, `SzTrafficCard`, `SzPlatformServicesCard`, `SzCertificatesCard`, `SzReverseProxyCard`, `SzDnsSslCard`, `SzQuickActionsCard`, and status-grid components. |
| Services | `SzServicesListView`, `SzServiceDetailView`, `SzServiceCreateView`, `SzServicesBackupsView`, and `SzAppStoreView`. |
| Network and domains | `SzNetworkProxyView`, `SzNetworkDnsView`, `SzNetworkDomainsView`, and `SzDomainDetailView`. |
| Routes | `SzRouteListView` and `SzRouteCard` for route configuration, match criteria, actions, TLS mode, and security profile display. |
| Mail | `SzMtaListView` and `SzMtaDetailView` for inbound/outbound email operations views. |
| Registries | `SzRegistryAdvertisement` and `SzRegistryExternalView`. |
| Auth and settings | `SzLoginView`, `SzTokensView`, and `SzSettingsView`. |
| Configuration | `SzConfigOverview` and `SzConfigSection`. |
| Demo pages | `SzDemoAppShell`, `SzDemoApp`, `Mainpage`, and `SzDemoView*` components used by the development/demo environment. |
The exported catalog currently contains more than 30 product UI components plus demo orchestration components. Prefer the exported barrel imports over deep file imports unless you are working inside this repository.
## Usage Patterns
Most components expose data through typed properties and emit actions as DOM events.
```typescript
import { html } from '@design.estate/dees-element';
import '@serve.zone/catalog';
const dashboardTemplate = html`
<sz-dashboard-view
.data=${dashboardData}
@action-click=${(event: CustomEvent) => {
console.log('dashboard action selected', event.detail);
}}
></sz-dashboard-view>
`;
```
For a full app-style demo shell with navigation, import the package and render `<sz-demo-app-shell>`:
```html
<sz-demo-app-shell></sz-demo-app-shell>
```
The demo shell is useful for development and visual review. Production apps usually compose the lower-level components into their own routing and data-fetching layer.
## TypeScript Interfaces
Many components export their own data interfaces alongside the custom element class. These interfaces are intended for UI-facing view models, not as replacements for backend contracts from `@serve.zone/interfaces`.
```typescript
import type {
IDashboardData,
IRouteConfig,
IServiceDetail,
IAppTemplate,
} from '@serve.zone/catalog';
```
Use these types to shape component props in the frontend. Use `@serve.zone/interfaces` for API and persisted platform contracts.
## Architecture
The catalog follows a consistent component pattern:
```typescript
import {
DeesElement,
css,
cssManager,
customElement,
html,
property,
} from '@design.estate/dees-element';
@customElement('sz-example-card')
export class SzExampleCard extends DeesElement {
@property({ type: String })
public accessor label = '';
public static styles = [
cssManager.defaultStyles,
css`
:host {
color: ${cssManager.bdTheme('#18181b', '#fafafa')};
}
`,
];
public render() {
return html`<span>${this.label}</span>`;
}
}
```
Project layout:
```text
@serve.zone/catalog/
├── html/ # WccTools dev server shell
├── ts_web/
│ ├── index.ts # package barrel export
│ ├── elements/ # reusable sz-* web components
│ └── pages/ # demo app and shell pages
└── dist_ts_web/ # compiled npm entry point
```
## Development
```bash
pnpm install
pnpm run watch
pnpm run build
pnpm test
```
`pnpm run watch` starts the WccTools development environment for browsing the catalog with demo data. `pnpm run build` compiles TypeScript folders and creates the browser bundle with `tsbundle`.
## License and Legal Information
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [license](./license) file.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
### Company Information
Task Venture Capital GmbH
Registered at District Court Bremen HRB 35230 HB, Germany
For any legal inquiries or further information, please contact us via email at hello@task.vc.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.