@elevasis/sdk 1.8.2 → 1.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +1 -1
- package/dist/index.d.ts +88 -39
- package/dist/types/worker/adapters/lead.d.ts +1 -1
- package/dist/worker/index.js +2 -0
- package/package.json +2 -2
- package/reference/_navigation.md +7 -1
- package/reference/_reference-manifest.json +14 -0
- package/reference/claude-config/logs/scaffold-registry-reminder.log +3 -0
- package/reference/claude-config/rules/agent-start-here.md +254 -254
- package/reference/claude-config/rules/frontend.md +43 -43
- package/reference/claude-config/rules/operations.md +64 -64
- package/reference/claude-config/rules/organization-model.md +42 -43
- package/reference/claude-config/rules/organization-os.md +107 -107
- package/reference/claude-config/rules/shared-types.md +2 -2
- package/reference/claude-config/rules/task-tracking.md +1 -1
- package/reference/claude-config/rules/ui.md +202 -202
- package/reference/claude-config/rules/vibe.md +202 -202
- package/reference/claude-config/skills/configure/SKILL.md +98 -98
- package/reference/claude-config/skills/configure/operations/codify-level-a.md +100 -100
- package/reference/claude-config/skills/configure/operations/codify-level-b.md +158 -158
- package/reference/claude-config/skills/configure/operations/customers.md +150 -150
- package/reference/claude-config/skills/configure/operations/features.md +162 -162
- package/reference/claude-config/skills/configure/operations/goals.md +147 -147
- package/reference/claude-config/skills/configure/operations/identity.md +133 -133
- package/reference/claude-config/skills/configure/operations/labels.md +128 -128
- package/reference/claude-config/skills/configure/operations/offerings.md +159 -159
- package/reference/claude-config/skills/configure/operations/roles.md +153 -153
- package/reference/claude-config/skills/configure/operations/techStack.md +139 -139
- package/reference/claude-config/skills/explore/SKILL.md +78 -78
- package/reference/claude-config/skills/git-sync/SKILL.md +126 -0
- package/reference/claude-config/skills/save/SKILL.md +183 -183
- package/reference/claude-config/skills/setup/SKILL.md +275 -275
- package/reference/claude-config/skills/sync/SKILL.md +10 -44
- package/reference/claude-config/sync-notes/2026-04-22-git-sync-and-sync-notes.md +27 -0
- package/reference/claude-config/sync-notes/2026-04-22-lead-gen-deliverability-removal.md +30 -0
- package/reference/claude-config/sync-notes/README.md +43 -0
- package/reference/packages/core/src/README.md +39 -36
- package/reference/packages/core/src/business/README.md +52 -52
- package/reference/packages/core/src/organization-model/README.md +97 -97
- package/reference/packages/core/src/test-utils/README.md +42 -0
- package/reference/scaffold/core/organization-graph.mdx +272 -272
- package/reference/scaffold/core/organization-model.mdx +320 -320
- package/reference/scaffold/index.mdx +64 -64
- package/reference/scaffold/operations/propagation-pipeline.md +125 -104
- package/reference/scaffold/operations/scaffold-maintenance.md +122 -122
- package/reference/scaffold/operations/workflow-recipes.md +436 -436
- package/reference/scaffold/recipes/add-a-feature.md +158 -158
- package/reference/scaffold/recipes/add-a-resource.md +158 -158
- package/reference/scaffold/recipes/customize-organization-model.md +400 -400
- package/reference/scaffold/recipes/extend-a-base-entity.md +140 -140
- package/reference/scaffold/recipes/gate-by-feature-or-admin.md +158 -158
- package/reference/scaffold/recipes/index.md +32 -32
- package/reference/scaffold/reference/contracts.md +608 -607
- package/reference/scaffold/reference/feature-registry.md +2 -0
- package/reference/scaffold/reference/glossary.md +105 -105
- package/reference/scaffold/ui/composition-extensibility.mdx +1 -1
- package/reference/scaffold/ui/feature-flags-and-gating.md +1 -1
|
@@ -1,202 +1,202 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: UI shell, route structure, auth flow, API access, and template customization points for the ui/ surface
|
|
3
|
-
paths:
|
|
4
|
-
- ui/**
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# UI Features
|
|
8
|
-
|
|
9
|
-
**Status:** Stable
|
|
10
|
-
|
|
11
|
-
## App Shell Overview
|
|
12
|
-
|
|
13
|
-
The template frontend is a React 19 + TanStack Router app that composes a local dashboard shell with published feature manifests from `@elevasis/ui`.
|
|
14
|
-
|
|
15
|
-
The main join points are:
|
|
16
|
-
|
|
17
|
-
- `ui/src/main.tsx` -- boots the app with `ElevasisUIProvider`, query client, theme config, WorkOS AuthKit, notifications, and the generated route tree
|
|
18
|
-
- `ui/src/routes/__root.tsx` -- composes the authenticated shell with `ElevasisFeaturesProvider`, published feature manifests, app-local dashboard nav, shell runtime dependencies, and `FeatureShell`
|
|
19
|
-
- `ui/src/config/nav-items.ts` -- keeps the host-local dashboard entry separate from the published feature manifests
|
|
20
|
-
- `foundations/config/organization-model.ts` -- is the template's semantic source of truth, adapting `@elevasis/core/organization-model` into the preserved branding, dashboard label, quick-access, feature-label, and legacy surface helpers the shell still uses
|
|
21
|
-
|
|
22
|
-
Published feature manifests mounted by the template shell:
|
|
23
|
-
|
|
24
|
-
- `lead-gen`
|
|
25
|
-
- `crm`
|
|
26
|
-
- `delivery` at `/projects`
|
|
27
|
-
- `operations`
|
|
28
|
-
- `monitoring`
|
|
29
|
-
- `settings`
|
|
30
|
-
|
|
31
|
-
Important distinction:
|
|
32
|
-
|
|
33
|
-
- shared manifests gate on grouped org-model keys such as `acquisition` and `delivery`
|
|
34
|
-
- template routes and local nav may still use legacy aliases such as `crm`, `lead-gen`, and `projects`
|
|
35
|
-
- `foundations/config/organization-model.ts` and `ui/src/lib/hooks/useFeatureAccess.ts` are the bridge between those two vocabularies
|
|
36
|
-
|
|
37
|
-
Dashboard remains a host-local route at `/`, not a shared feature manifest.
|
|
38
|
-
|
|
39
|
-
This template should be treated as the downstream reference implementation for this composition:
|
|
40
|
-
|
|
41
|
-
- foundations owns the organization/runtime semantics
|
|
42
|
-
- `ui/src/config/nav-items.ts` preserves the host-local dashboard entry instead of pushing that concern into shared manifests
|
|
43
|
-
- `ui/src/routes/__root.tsx` threads `canonicalOrganizationModel` from foundations into `ElevasisFeaturesProvider` so the shared shell/runtime uses the same semantic source of truth as the local template helpers
|
|
44
|
-
- host-local customizations still stay local: dashboard remains app-owned nav, branding stays in app config, and quick-access/dashboard UX stays in the template app
|
|
45
|
-
|
|
46
|
-
## Auth and Initialization
|
|
47
|
-
|
|
48
|
-
The app uses WorkOS AuthKit through `ElevasisUIProvider`. Authentication is enforced by the local `ProtectedRoute` wrapper in `ui/src/features/auth/ProtectedRoute.tsx`.
|
|
49
|
-
|
|
50
|
-
**Sign-in flow:**
|
|
51
|
-
|
|
52
|
-
1. Unauthenticated user hits a protected route -- `ProtectedRoute` redirects to `/login?returnTo=<path>`
|
|
53
|
-
2. `/login` renders a sign-in card; user clicks Sign In, triggering `signIn({ returnTo })` from `useAuth()`
|
|
54
|
-
3. User authenticates on the WorkOS-hosted sign-in page
|
|
55
|
-
4. WorkOS redirects back to `/auth-redirect` -- `ui/src/routes/auth-redirect.tsx` waits for auth to complete, then navigates to the requested path or `/`
|
|
56
|
-
5. User lands on the home page, fully authenticated
|
|
57
|
-
|
|
58
|
-
**Route protection:**
|
|
59
|
-
|
|
60
|
-
Wrap protected route components with the local `ProtectedRoute` from `@/features/auth`, which adds the full-screen loader and delegates to the shared guard from `@elevasis/ui/auth`:
|
|
61
|
-
|
|
62
|
-
```tsx
|
|
63
|
-
import { ProtectedRoute } from '@/features/auth'
|
|
64
|
-
|
|
65
|
-
function HomePageGuarded() {
|
|
66
|
-
return (
|
|
67
|
-
<ProtectedRoute>
|
|
68
|
-
<HomePage />
|
|
69
|
-
</ProtectedRoute>
|
|
70
|
-
)
|
|
71
|
-
}
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
**Initialization state:**
|
|
75
|
-
|
|
76
|
-
Use `useInitialization()` from `@elevasis/ui/initialization` anywhere inside the app to read aggregated auth + org readiness:
|
|
77
|
-
|
|
78
|
-
```ts
|
|
79
|
-
const { allReady, userReady, isInitializing, error, retry, profile } = useInitialization()
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
**Organization context:**
|
|
83
|
-
|
|
84
|
-
Use `useOrganization()` from `@elevasis/ui/organization` to access org-scoped IDs and memberships:
|
|
85
|
-
|
|
86
|
-
```ts
|
|
87
|
-
const { currentWorkOSOrganizationId, currentSupabaseOrganizationId, memberships, switchOrganization } = useOrganization()
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
## API and Streaming
|
|
91
|
-
|
|
92
|
-
Use `useApiClient()` from `@/lib/hooks/useApiClient` in route components and feature hooks:
|
|
93
|
-
|
|
94
|
-
```ts
|
|
95
|
-
const { apiRequest, isOrganizationReady } = useApiClient()
|
|
96
|
-
const data = await apiRequest('/executions', { method: 'GET' })
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
The template also re-exports `useApiClientContext()` and the shared API client types from `@/lib/hooks/useApiClient`.
|
|
100
|
-
|
|
101
|
-
For real-time updates, feature surfaces use the local singleton wrapper:
|
|
102
|
-
|
|
103
|
-
```ts
|
|
104
|
-
import { sseConnectionManager } from '@/lib/sse/SSEConnectionManager'
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
**Required env vars:**
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
VITE_WORKOS_CLIENT_ID=client_...
|
|
111
|
-
VITE_WORKOS_REDIRECT_URI=http://localhost:4300/auth-redirect
|
|
112
|
-
VITE_WORKOS_SIGNOUT_URI=http://localhost:4300/login
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
The API URL is centralized in `ui/src/lib/constants/api.ts`. In the current template it is hard-coded to `https://api.elevasis.io`, so if the bootstrap is repointed to another API target, that file is the source of truth.
|
|
116
|
-
|
|
117
|
-
## Route Structure
|
|
118
|
-
|
|
119
|
-
Current top-level app sections:
|
|
120
|
-
|
|
121
|
-
- `/` -- host-local dashboard entrypoint with quick links derived from `organizationModel.navigation.quickAccessSurfaceIds`
|
|
122
|
-
- `/lead-gen/*` -- lead generation pages (`lists`, `companies`, `contacts`, `deliverability`)
|
|
123
|
-
- `/crm/*` -- CRM overview, pipeline, and deals
|
|
124
|
-
- `/projects/*` -- delivery feature pages (projects, milestones, tasks, notes)
|
|
125
|
-
- `/operations/*` -- operations overview, resources, command queue, command view, sessions, task scheduler
|
|
126
|
-
- `/monitoring/*` -- execution logs, execution health, activity log, cost analytics, notifications
|
|
127
|
-
- `/settings/*` -- account, organization, credentials, API keys, deployments, webhooks, and appearance
|
|
128
|
-
- `/login` and `/auth-redirect` -- auth entry/callback routes
|
|
129
|
-
|
|
130
|
-
Section guards currently follow this pattern:
|
|
131
|
-
|
|
132
|
-
- `ProtectedRoute` for all authenticated sections
|
|
133
|
-
- `FeatureGuard` on all feature sections that should hard-stop when a feature is disabled: `crm`, `lead-gen`, `projects`, `operations`, and `monitoring`
|
|
134
|
-
- provider-level shell gating for shared feature nav and sub-shell behavior
|
|
135
|
-
|
|
136
|
-
The app shell in `__root.tsx` derives visible nav from `shellModel.navItems`, filters admin-only entries locally using the signed-in profile, and passes `canonicalOrganizationModel` into `ElevasisFeaturesProvider` so shared nav labels, paths, and graph runtime behavior resolve from the same foundations-backed semantic model.
|
|
137
|
-
|
|
138
|
-
## Dashboard and Feature Areas
|
|
139
|
-
|
|
140
|
-
**Dashboard**
|
|
141
|
-
|
|
142
|
-
`ui/src/features/dashboard/components/Dashboard.tsx` is intentionally lightweight. It acts as the host-owned landing page and renders quick access cards for the most important organization surfaces instead of duplicating the shared operations overview.
|
|
143
|
-
|
|
144
|
-
**Operations**
|
|
145
|
-
|
|
146
|
-
The operations area is the richest shared shell in the template. It includes:
|
|
147
|
-
|
|
148
|
-
- resource inventory and detail pages
|
|
149
|
-
- command queue and command view
|
|
150
|
-
- sessions screens
|
|
151
|
-
- the shared operations overview at `/operations/`
|
|
152
|
-
|
|
153
|
-
**Monitoring**
|
|
154
|
-
|
|
155
|
-
Monitoring is scaffolded as a shared feature area with route files for:
|
|
156
|
-
|
|
157
|
-
- activity log
|
|
158
|
-
- cost analytics
|
|
159
|
-
- execution health
|
|
160
|
-
- execution logs
|
|
161
|
-
- notifications
|
|
162
|
-
|
|
163
|
-
## Customization Points
|
|
164
|
-
|
|
165
|
-
The main template-owned customization surfaces are:
|
|
166
|
-
|
|
167
|
-
- `ui/src/config/app-config.ts` -- brand name, logos, and app version
|
|
168
|
-
- `ui/src/config/theme.ts` -- theme presets and defaults
|
|
169
|
-
- `ui/src/config/background.tsx` -- shared background treatment
|
|
170
|
-
- `ui/src/config/loader.tsx` -- global loader element
|
|
171
|
-
- `ui/src/config/nav-items.ts` -- app-local nav entries, including the preserved dashboard/home entry
|
|
172
|
-
- `foundations/config/organization-model.ts` -- product labels, feature enablement, semantic surfaces, canonical-to-legacy surface aliases, and quick-access behavior
|
|
173
|
-
- `ui/src/config/README.md` -- the deeper guide for those config files
|
|
174
|
-
|
|
175
|
-
## Customizing Feature Sidebars
|
|
176
|
-
|
|
177
|
-
The template demonstrates one override pattern in `ui/src/routes/__root.tsx`: it extends `CRM_ITEMS` with a template-owned Reports link and replaces `crmManifest` with `customCrmManifest` in the feature manifest array. The backing route lives at `ui/src/routes/crm/reports.tsx` -- delete both the nav item and the route if you don't need them.
|
|
178
|
-
|
|
179
|
-
Two customization layers are available for every shared feature sidebar:
|
|
180
|
-
|
|
181
|
-
1. **Nav-item shortcut (`items` prop)** -- when you just need to swap or extend the nav array, spread the published items constant and pass the result to `*SidebarMiddle`. The template's CRM customization uses this path.
|
|
182
|
-
|
|
183
|
-
```tsx
|
|
184
|
-
import { crmManifest, CrmSidebar, CrmSidebarMiddle, CRM_ITEMS } from '@elevasis/ui/features/crm'
|
|
185
|
-
import type { NavItem } from '@elevasis/ui/layout'
|
|
186
|
-
|
|
187
|
-
const customItems: NavItem[] = [...CRM_ITEMS, { label: 'Reports', to: '/crm/reports', icon: IconFileText, exact: false }]
|
|
188
|
-
const CustomCrmSidebar = () => <CrmSidebar><CrmSidebarMiddle items={customItems} /></CrmSidebar>
|
|
189
|
-
const customCrmManifest = { ...crmManifest, sidebar: CustomCrmSidebar }
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
2. **Compose-primitives (structural changes)** -- when you need to inject panels, reorder sections, or add a new section, drop down to `CrmSidebarTop` + `SubshellNavList` + `SubshellSidebarSection` + published panels (`MyTasksPanel`, `QuickCreateActions`) and compose your own Middle.
|
|
193
|
-
|
|
194
|
-
`manifest.sidebar` accepts any component, so arbitrary customization is always available. The `items` prop is an abstraction barrier for the common case, not a limit.
|
|
195
|
-
|
|
196
|
-
See `node_modules/@elevasis/sdk/reference/scaffold/ui/customization.md` for the decision tree, page-wrapping pattern, and delivery's three-section variant. See `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` for `NavItem`, `FeatureModule`, and related TypeScript shapes.
|
|
197
|
-
|
|
198
|
-
## Notes
|
|
199
|
-
|
|
200
|
-
- `ui/src/routeTree.gen.ts` is generated by TanStack Router tooling. Do not hand-edit it.
|
|
201
|
-
- The template ships a broad route surface so downstream projects can trim or reshape features without having to re-derive the shared shell contract from scratch.
|
|
202
|
-
- For package-export discovery, glob `node_modules/@elevasis/sdk/reference/` or `node_modules/@repo/ui/dist/` for the current SDK/UI package surface.
|
|
1
|
+
---
|
|
2
|
+
description: UI shell, route structure, auth flow, API access, and template customization points for the ui/ surface
|
|
3
|
+
paths:
|
|
4
|
+
- ui/**
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# UI Features
|
|
8
|
+
|
|
9
|
+
**Status:** Stable
|
|
10
|
+
|
|
11
|
+
## App Shell Overview
|
|
12
|
+
|
|
13
|
+
The template frontend is a React 19 + TanStack Router app that composes a local dashboard shell with published feature manifests from `@elevasis/ui`.
|
|
14
|
+
|
|
15
|
+
The main join points are:
|
|
16
|
+
|
|
17
|
+
- `ui/src/main.tsx` -- boots the app with `ElevasisUIProvider`, query client, theme config, WorkOS AuthKit, notifications, and the generated route tree
|
|
18
|
+
- `ui/src/routes/__root.tsx` -- composes the authenticated shell with `ElevasisFeaturesProvider`, published feature manifests, app-local dashboard nav, shell runtime dependencies, and `FeatureShell`
|
|
19
|
+
- `ui/src/config/nav-items.ts` -- keeps the host-local dashboard entry separate from the published feature manifests
|
|
20
|
+
- `foundations/config/organization-model.ts` -- is the template's semantic source of truth, adapting `@elevasis/core/organization-model` into the preserved branding, dashboard label, quick-access, feature-label, and legacy surface helpers the shell still uses
|
|
21
|
+
|
|
22
|
+
Published feature manifests mounted by the template shell:
|
|
23
|
+
|
|
24
|
+
- `lead-gen`
|
|
25
|
+
- `crm`
|
|
26
|
+
- `delivery` at `/projects`
|
|
27
|
+
- `operations`
|
|
28
|
+
- `monitoring`
|
|
29
|
+
- `settings`
|
|
30
|
+
|
|
31
|
+
Important distinction:
|
|
32
|
+
|
|
33
|
+
- shared manifests gate on grouped org-model keys such as `acquisition` and `delivery`
|
|
34
|
+
- template routes and local nav may still use legacy aliases such as `crm`, `lead-gen`, and `projects`
|
|
35
|
+
- `foundations/config/organization-model.ts` and `ui/src/lib/hooks/useFeatureAccess.ts` are the bridge between those two vocabularies
|
|
36
|
+
|
|
37
|
+
Dashboard remains a host-local route at `/`, not a shared feature manifest.
|
|
38
|
+
|
|
39
|
+
This template should be treated as the downstream reference implementation for this composition:
|
|
40
|
+
|
|
41
|
+
- foundations owns the organization/runtime semantics
|
|
42
|
+
- `ui/src/config/nav-items.ts` preserves the host-local dashboard entry instead of pushing that concern into shared manifests
|
|
43
|
+
- `ui/src/routes/__root.tsx` threads `canonicalOrganizationModel` from foundations into `ElevasisFeaturesProvider` so the shared shell/runtime uses the same semantic source of truth as the local template helpers
|
|
44
|
+
- host-local customizations still stay local: dashboard remains app-owned nav, branding stays in app config, and quick-access/dashboard UX stays in the template app
|
|
45
|
+
|
|
46
|
+
## Auth and Initialization
|
|
47
|
+
|
|
48
|
+
The app uses WorkOS AuthKit through `ElevasisUIProvider`. Authentication is enforced by the local `ProtectedRoute` wrapper in `ui/src/features/auth/ProtectedRoute.tsx`.
|
|
49
|
+
|
|
50
|
+
**Sign-in flow:**
|
|
51
|
+
|
|
52
|
+
1. Unauthenticated user hits a protected route -- `ProtectedRoute` redirects to `/login?returnTo=<path>`
|
|
53
|
+
2. `/login` renders a sign-in card; user clicks Sign In, triggering `signIn({ returnTo })` from `useAuth()`
|
|
54
|
+
3. User authenticates on the WorkOS-hosted sign-in page
|
|
55
|
+
4. WorkOS redirects back to `/auth-redirect` -- `ui/src/routes/auth-redirect.tsx` waits for auth to complete, then navigates to the requested path or `/`
|
|
56
|
+
5. User lands on the home page, fully authenticated
|
|
57
|
+
|
|
58
|
+
**Route protection:**
|
|
59
|
+
|
|
60
|
+
Wrap protected route components with the local `ProtectedRoute` from `@/features/auth`, which adds the full-screen loader and delegates to the shared guard from `@elevasis/ui/auth`:
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
import { ProtectedRoute } from '@/features/auth'
|
|
64
|
+
|
|
65
|
+
function HomePageGuarded() {
|
|
66
|
+
return (
|
|
67
|
+
<ProtectedRoute>
|
|
68
|
+
<HomePage />
|
|
69
|
+
</ProtectedRoute>
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Initialization state:**
|
|
75
|
+
|
|
76
|
+
Use `useInitialization()` from `@elevasis/ui/initialization` anywhere inside the app to read aggregated auth + org readiness:
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
const { allReady, userReady, isInitializing, error, retry, profile } = useInitialization()
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Organization context:**
|
|
83
|
+
|
|
84
|
+
Use `useOrganization()` from `@elevasis/ui/organization` to access org-scoped IDs and memberships:
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
const { currentWorkOSOrganizationId, currentSupabaseOrganizationId, memberships, switchOrganization } = useOrganization()
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## API and Streaming
|
|
91
|
+
|
|
92
|
+
Use `useApiClient()` from `@/lib/hooks/useApiClient` in route components and feature hooks:
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
const { apiRequest, isOrganizationReady } = useApiClient()
|
|
96
|
+
const data = await apiRequest('/executions', { method: 'GET' })
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The template also re-exports `useApiClientContext()` and the shared API client types from `@/lib/hooks/useApiClient`.
|
|
100
|
+
|
|
101
|
+
For real-time updates, feature surfaces use the local singleton wrapper:
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
import { sseConnectionManager } from '@/lib/sse/SSEConnectionManager'
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Required env vars:**
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
VITE_WORKOS_CLIENT_ID=client_...
|
|
111
|
+
VITE_WORKOS_REDIRECT_URI=http://localhost:4300/auth-redirect
|
|
112
|
+
VITE_WORKOS_SIGNOUT_URI=http://localhost:4300/login
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The API URL is centralized in `ui/src/lib/constants/api.ts`. In the current template it is hard-coded to `https://api.elevasis.io`, so if the bootstrap is repointed to another API target, that file is the source of truth.
|
|
116
|
+
|
|
117
|
+
## Route Structure
|
|
118
|
+
|
|
119
|
+
Current top-level app sections:
|
|
120
|
+
|
|
121
|
+
- `/` -- host-local dashboard entrypoint with quick links derived from `organizationModel.navigation.quickAccessSurfaceIds`
|
|
122
|
+
- `/lead-gen/*` -- lead generation pages (`lists`, `companies`, `contacts`, `deliverability`)
|
|
123
|
+
- `/crm/*` -- CRM overview, pipeline, and deals
|
|
124
|
+
- `/projects/*` -- delivery feature pages (projects, milestones, tasks, notes)
|
|
125
|
+
- `/operations/*` -- operations overview, resources, command queue, command view, sessions, task scheduler
|
|
126
|
+
- `/monitoring/*` -- execution logs, execution health, activity log, cost analytics, notifications
|
|
127
|
+
- `/settings/*` -- account, organization, credentials, API keys, deployments, webhooks, and appearance
|
|
128
|
+
- `/login` and `/auth-redirect` -- auth entry/callback routes
|
|
129
|
+
|
|
130
|
+
Section guards currently follow this pattern:
|
|
131
|
+
|
|
132
|
+
- `ProtectedRoute` for all authenticated sections
|
|
133
|
+
- `FeatureGuard` on all feature sections that should hard-stop when a feature is disabled: `crm`, `lead-gen`, `projects`, `operations`, and `monitoring`
|
|
134
|
+
- provider-level shell gating for shared feature nav and sub-shell behavior
|
|
135
|
+
|
|
136
|
+
The app shell in `__root.tsx` derives visible nav from `shellModel.navItems`, filters admin-only entries locally using the signed-in profile, and passes `canonicalOrganizationModel` into `ElevasisFeaturesProvider` so shared nav labels, paths, and graph runtime behavior resolve from the same foundations-backed semantic model.
|
|
137
|
+
|
|
138
|
+
## Dashboard and Feature Areas
|
|
139
|
+
|
|
140
|
+
**Dashboard**
|
|
141
|
+
|
|
142
|
+
`ui/src/features/dashboard/components/Dashboard.tsx` is intentionally lightweight. It acts as the host-owned landing page and renders quick access cards for the most important organization surfaces instead of duplicating the shared operations overview.
|
|
143
|
+
|
|
144
|
+
**Operations**
|
|
145
|
+
|
|
146
|
+
The operations area is the richest shared shell in the template. It includes:
|
|
147
|
+
|
|
148
|
+
- resource inventory and detail pages
|
|
149
|
+
- command queue and command view
|
|
150
|
+
- sessions screens
|
|
151
|
+
- the shared operations overview at `/operations/`
|
|
152
|
+
|
|
153
|
+
**Monitoring**
|
|
154
|
+
|
|
155
|
+
Monitoring is scaffolded as a shared feature area with route files for:
|
|
156
|
+
|
|
157
|
+
- activity log
|
|
158
|
+
- cost analytics
|
|
159
|
+
- execution health
|
|
160
|
+
- execution logs
|
|
161
|
+
- notifications
|
|
162
|
+
|
|
163
|
+
## Customization Points
|
|
164
|
+
|
|
165
|
+
The main template-owned customization surfaces are:
|
|
166
|
+
|
|
167
|
+
- `ui/src/config/app-config.ts` -- brand name, logos, and app version
|
|
168
|
+
- `ui/src/config/theme.ts` -- theme presets and defaults
|
|
169
|
+
- `ui/src/config/background.tsx` -- shared background treatment
|
|
170
|
+
- `ui/src/config/loader.tsx` -- global loader element
|
|
171
|
+
- `ui/src/config/nav-items.ts` -- app-local nav entries, including the preserved dashboard/home entry
|
|
172
|
+
- `foundations/config/organization-model.ts` -- product labels, feature enablement, semantic surfaces, canonical-to-legacy surface aliases, and quick-access behavior
|
|
173
|
+
- `ui/src/config/README.md` -- the deeper guide for those config files
|
|
174
|
+
|
|
175
|
+
## Customizing Feature Sidebars
|
|
176
|
+
|
|
177
|
+
The template demonstrates one override pattern in `ui/src/routes/__root.tsx`: it extends `CRM_ITEMS` with a template-owned Reports link and replaces `crmManifest` with `customCrmManifest` in the feature manifest array. The backing route lives at `ui/src/routes/crm/reports.tsx` -- delete both the nav item and the route if you don't need them.
|
|
178
|
+
|
|
179
|
+
Two customization layers are available for every shared feature sidebar:
|
|
180
|
+
|
|
181
|
+
1. **Nav-item shortcut (`items` prop)** -- when you just need to swap or extend the nav array, spread the published items constant and pass the result to `*SidebarMiddle`. The template's CRM customization uses this path.
|
|
182
|
+
|
|
183
|
+
```tsx
|
|
184
|
+
import { crmManifest, CrmSidebar, CrmSidebarMiddle, CRM_ITEMS } from '@elevasis/ui/features/crm'
|
|
185
|
+
import type { NavItem } from '@elevasis/ui/layout'
|
|
186
|
+
|
|
187
|
+
const customItems: NavItem[] = [...CRM_ITEMS, { label: 'Reports', to: '/crm/reports', icon: IconFileText, exact: false }]
|
|
188
|
+
const CustomCrmSidebar = () => <CrmSidebar><CrmSidebarMiddle items={customItems} /></CrmSidebar>
|
|
189
|
+
const customCrmManifest = { ...crmManifest, sidebar: CustomCrmSidebar }
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
2. **Compose-primitives (structural changes)** -- when you need to inject panels, reorder sections, or add a new section, drop down to `CrmSidebarTop` + `SubshellNavList` + `SubshellSidebarSection` + published panels (`MyTasksPanel`, `QuickCreateActions`) and compose your own Middle.
|
|
193
|
+
|
|
194
|
+
`manifest.sidebar` accepts any component, so arbitrary customization is always available. The `items` prop is an abstraction barrier for the common case, not a limit.
|
|
195
|
+
|
|
196
|
+
See `node_modules/@elevasis/sdk/reference/scaffold/ui/customization.md` for the decision tree, page-wrapping pattern, and delivery's three-section variant. See `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` for `NavItem`, `FeatureModule`, and related TypeScript shapes.
|
|
197
|
+
|
|
198
|
+
## Notes
|
|
199
|
+
|
|
200
|
+
- `ui/src/routeTree.gen.ts` is generated by TanStack Router tooling. Do not hand-edit it.
|
|
201
|
+
- The template ships a broad route surface so downstream projects can trim or reshape features without having to re-derive the shared shell contract from scratch.
|
|
202
|
+
- For package-export discovery, glob `node_modules/@elevasis/sdk/reference/` or `node_modules/@repo/ui/dist/` for the current SDK/UI package surface.
|