spine-framework-portal 0.2.9 → 0.2.11

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/LICENSE.md ADDED
@@ -0,0 +1,193 @@
1
+ Spine Framework Internal Use License 1.0.0
2
+ Source-available. Free for internal use. Commercial rights reserved.
3
+
4
+ This license is based on the structure and intent of the PolyForm Internal Use License 1.0.0, but it has been modified for Spine Framework. This is not the unmodified PolyForm Internal Use License.
5
+
6
+ Required Notice
7
+ Required Notice: Copyright © 2026 Dahl Ventures Inc. All rights reserved.
8
+
9
+ 1. Acceptance
10
+ In order to receive any license under these terms, you must agree to these terms as both strict obligations and conditions to all licenses granted to you.
11
+
12
+ If you do not agree to these terms, you do not have permission to use, copy, modify, run, install, access, or create works based on Spine Framework.
13
+
14
+ 2. Definitions
15
+ Software means Spine Framework, including its source code, object code, packages, modules, templates, schemas, migrations, configuration files, documentation, examples, command-line tools, SDKs, application packs, and related materials provided by the licensor.
16
+
17
+ Licensor means the legal owner of Spine Framework.
18
+
19
+ You means the individual or legal entity receiving the Software.
20
+
21
+ Your Company means the legal entity on whose behalf you use the Software, including that entity's employees and authorized contractors.
22
+
23
+ Internal Business Use means use of the Software solely inside Your Company for Your Company's own internal business operations, internal workflows, internal applications, internal data, internal users, and internal customers or accounts.
24
+
25
+ Third Party means any person or legal entity other than You or Your Company.
26
+
27
+ Commercial License means a separate written agreement signed by the Licensor that grants rights beyond this license.
28
+
29
+ 3. Copyright License
30
+ The Licensor grants You a copyright license to do everything with the Software that would otherwise infringe the Licensor's copyright, but only for Internal Business Use and only as permitted by these terms.
31
+
32
+ You may install, run, access, evaluate, test, configure, and use the Software for Internal Business Use.
33
+
34
+ You may copy the Software only as reasonably necessary for Internal Business Use, including backup, deployment, development, testing, staging, disaster recovery, and internal security review.
35
+
36
+ You may not distribute the Software except as expressly allowed in these terms.
37
+
38
+ 4. Changes and New Works
39
+ The Licensor grants You a copyright license to modify the Software and create new works based on the Software, but only for Internal Business Use.
40
+
41
+ You may create internal applications, extensions, workflows, integrations, automations, schemas, roles, agents, triggers, pipelines, dashboards, reports, and other internal business systems using the Software.
42
+
43
+ You may not distribute, sell, sublicense, transfer, lease, rent, host for others, white-label, resell, or commercially exploit any modified version, derivative work, extension, application pack, template, or implementation of the Software except under a Commercial License.
44
+
45
+ 5. Internal Contractors
46
+ Your Company may allow employees and contractors to access and use the Software solely on behalf of Your Company and solely for Your Company's Internal Business Use.
47
+
48
+ Contractors do not receive any independent right to use the Software for themselves, their other clients, their own products, or any Third Party.
49
+
50
+ Your Company is responsible for all use of the Software by its employees, contractors, agents, and representatives.
51
+
52
+ 6. Your Data and Application-Specific Work
53
+ As between You and the Licensor, You own Your Company's data, records, content, prompts, business logic, customer records, internal workflows, and application-specific code that You independently create using the Software.
54
+
55
+ These terms do not give the Licensor ownership of Your Company's data or independently created application-specific business content.
56
+
57
+ However, ownership of Your Company's data or application-specific work does not give You the right to distribute, resell, white-label, host, or commercially exploit the Software or any portion of the Software except as allowed by these terms or a Commercial License.
58
+
59
+ 7. Prohibited Uses
60
+ You may not do any of the following without a Commercial License:
61
+
62
+ Sell, resell, sublicense, rent, lease, lend, transfer, assign, publish, or distribute the Software.
63
+ Offer the Software, or any modified version of the Software, to Third Parties as software, infrastructure, a framework, a platform, a service, or a hosted product.
64
+ Offer the Software as SaaS, PaaS, IaaS, framework-as-a-service, backend-as-a-service, workflow-as-a-service, automation-as-a-service, AI-agent platform, managed service, support service, or similar commercial service.
65
+ White-label, private-label, rebrand, or remove Spine Framework identity from the Software in order to provide it to Third Parties.
66
+ Embed, bundle, package, or include the Software in any product, service, appliance, marketplace offering, application pack, starter kit, template library, SDK, CLI, distribution, or managed implementation made available to Third Parties.
67
+ Use the Software to operate, power, support, or provide a product or service for Third Parties where those Third Parties receive access to the Software or to functionality substantially provided by the Software.
68
+ Use the Software to build, operate, or improve a competing framework, platform, marketplace, application generator, agentic software infrastructure product, or commercial development infrastructure product.
69
+ Provide implementation, consulting, hosting, support, customization, training, migration, or managed services for the Software to Third Parties as a paid or commercial offering, except as expressly authorized by the Licensor.
70
+ Remove, alter, obscure, or bypass copyright notices, license notices, attribution, trademarks, branding, license keys, license checks, usage limits, or technical protection measures included in the Software.
71
+ Use the Software in violation of law, regulation, third-party rights, or these terms.
72
+ 8. Examples of Permitted Use
73
+ The following are permitted under this license, provided they are solely for Internal Business Use:
74
+
75
+ A company installs Spine Framework to build its own internal CRM.
76
+ A company uses Spine Framework to operate an internal customer support portal for its own support team and its own customers.
77
+ A company modifies Spine Framework for its internal workflows, roles, permissions, automations, pipelines, and integrations.
78
+ A company lets its employees and authorized contractors configure, maintain, and support its internal Spine Framework installation.
79
+ A company creates internal dashboards, agents, knowledge bases, audit trails, and operational tools on top of Spine Framework.
80
+ 9. Examples Requiring a Commercial License
81
+ The following are not permitted under this license and require a Commercial License:
82
+
83
+ Selling Spine Framework or a modified version of Spine Framework.
84
+ Offering Spine Framework as a hosted SaaS product.
85
+ Offering a white-labeled application built on Spine Framework to customers.
86
+ Packaging Spine Framework into a commercial starter kit, template, marketplace app, agency offering, or developer platform.
87
+ Running Spine Framework for multiple clients as a managed service provider, agency, consultant, systems integrator, or outsourcing firm.
88
+ Embedding Spine Framework into a product sold to customers.
89
+ Forking Spine Framework to launch a competing framework, backend, app platform, AI-agent platform, or development infrastructure product.
90
+ Publishing modified Spine Framework source code to a public repository.
91
+ Giving a customer, client, partner, reseller, or affiliate a copy of Spine Framework.
92
+ 10. Distribution
93
+ You may not distribute the Software, modified versions of the Software, or works based on the Software to any Third Party except as expressly permitted by these terms or a Commercial License.
94
+
95
+ You may share copies of the Software with employees and contractors of Your Company only as necessary for Internal Business Use and only if they are bound by obligations consistent with these terms.
96
+
97
+ Any copy of the Software must include this license and all Required Notices.
98
+
99
+ 11. Trademarks
100
+ This license does not grant You any right to use the Licensor's names, trademarks, service marks, logos, product names, domain names, or branding except as necessary to identify the Software for Internal Business Use.
101
+
102
+ You may not use Spine Framework branding in a way that suggests sponsorship, endorsement, partnership, certification, resale authorization, or commercial authorization without written permission from the Licensor.
103
+
104
+ 12. Patent License
105
+ The Licensor grants You a patent license for the Software that covers patent claims the Licensor can license, or later becomes able to license, that You would infringe by using the Software as permitted by these terms.
106
+
107
+ 13. Patent Defense
108
+ If You make any written claim that the Software infringes or contributes to infringement of any patent, Your patent license for the Software ends immediately.
109
+
110
+ If Your Company makes such a claim, Your Company's patent license ends immediately.
111
+
112
+ 14. Fair Use and Other Legal Rights
113
+ You may have fair use, fair dealing, or other rights under applicable law. These terms do not limit rights that the law does not allow these terms to limit.
114
+
115
+ 15. No Other Rights
116
+ These terms do not allow You to sublicense, transfer, assign, or delegate any license granted under these terms except as expressly allowed here.
117
+
118
+ These terms do not prevent the Licensor from granting licenses to anyone else.
119
+
120
+ These terms do not imply any license other than the licenses expressly granted here.
121
+
122
+ All rights not expressly granted are reserved by the Licensor.
123
+
124
+ 16. Violations and Cure
125
+ The first time You are notified in writing that You have violated these terms, or done anything with the Software not covered by these terms, Your licenses can continue if You:
126
+
127
+ come into full compliance with these terms;
128
+ take practical steps to correct past violations; and
129
+ complete both within 32 days of receiving written notice.
130
+ If You do not satisfy those requirements, all licenses granted to You under these terms end immediately.
131
+
132
+ For any later violation, all licenses granted to You under these terms end immediately without any cure period.
133
+
134
+ 17. Termination
135
+ When Your licenses end, You must stop all use of the Software and destroy all copies of the Software in Your possession or control, except copies you are legally required to retain for archival, compliance, or legal purposes.
136
+
137
+ Sections concerning ownership, prohibited uses, trademarks, patent defense, no other rights, violations, termination, no warranty, limitation of liability, and general terms survive termination.
138
+
139
+ 18. No Warranty
140
+ As far as the law allows, the Software is provided as is and as available, without any warranty or condition, express or implied.
141
+
142
+ The Licensor disclaims all warranties and conditions, including warranties of merchantability, fitness for a particular purpose, title, non-infringement, availability, accuracy, security, and quiet enjoyment.
143
+
144
+ 19. Limitation of Liability
145
+ As far as the law allows, the Licensor will not be liable to You for any indirect, incidental, special, consequential, exemplary, punitive, or other damages arising out of these terms or the Software.
146
+
147
+ As far as the law allows, the Licensor will not be liable for lost profits, lost revenue, lost savings, lost data, business interruption, security incidents, procurement of substitute services, or loss of goodwill.
148
+
149
+ The Licensor's total liability arising out of these terms or the Software will not exceed the amount You paid the Licensor for the Software during the 12 months before the event giving rise to liability, or USD $100 if You paid nothing.
150
+
151
+ 20. Commercial Licensing
152
+ Rights not granted under this license may be available under a separate Commercial License from the Licensor.
153
+
154
+ A Commercial License is required for resale, redistribution, SaaS, managed services, white-label use, OEM use, marketplace distribution, partner use, commercial hosting, commercial support offerings, or any use outside Internal Business Use.
155
+
156
+ To request commercial rights, contact:
157
+
158
+ spine-framework.com
159
+ webmaster@spine-framework.com
160
+ 21. License Updates
161
+ The Licensor may publish updated versions of this license from time to time.
162
+
163
+ Each release, package, download, or copy of the Software is governed by the license terms included with that release, package, download, or copy, unless You and the Licensor have signed a separate written agreement.
164
+
165
+ Updated license terms apply only to future releases, downloads, packages, updates, upgrades, patches, hosted access, or other versions of the Software made available after the updated terms are published.
166
+
167
+ The Licensor may require acceptance of updated license terms as a condition of receiving or using future releases, updates, hosted services, commercial features, support, documentation, marketplace access, license keys, portals, application packs, or other Spine Framework services.
168
+
169
+ Nothing in this section gives You rights to continue using future versions of the Software under earlier license terms.
170
+
171
+ 22. General Terms
172
+ If any part of these terms is held unenforceable, the rest remains in effect as far as the law allows.
173
+
174
+ Failure by the Licensor to enforce any term is not a waiver.
175
+
176
+ Any waiver must be in writing and signed by the Licensor.
177
+
178
+ These terms are the entire license terms for the Software unless You and the Licensor have signed a separate written agreement.
179
+
180
+ 23. Plain-English Summary
181
+ This summary is not part of the legal license.
182
+
183
+ You may use Spine Framework inside your own company for your own internal business operations.
184
+
185
+ You may modify Spine Framework for your own internal use.
186
+
187
+ You may let your employees and contractors work on your internal Spine Framework installation.
188
+
189
+ You may not sell it, redistribute it, white-label it, host it for others, offer it as SaaS, package it into another product, use it as a managed service offering, or use it to build a competing framework without a separate commercial license.
190
+
191
+ Future versions, updates, services, support, portals, packs, license keys, and commercial features may require acceptance of updated terms.
192
+
193
+ Spine Framework is source-available. It is not open source.
package/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # Spine Framework Portal
2
+
3
+ Portal is a customer-facing self-service app for [Spine Framework](https://spine-framework.com). It gives customers access to tickets, knowledge base, courses, community, and marketplace — all under your brand.
4
+
5
+ ## Features
6
+
7
+ - **Tickets** — Submit and track support tickets
8
+ - **Knowledge Base** — Browse and search help articles
9
+ - **Courses** — Access course catalog and track progress
10
+ - **Community** — Community discussions and Q&A
11
+ - **Marketplace** — App and integration marketplace
12
+
13
+ ## Requirements
14
+
15
+ - [Spine Framework](https://www.npmjs.com/package/spine-framework) `>=0.1.0`
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ npx spine-framework install-app spine-framework-portal
21
+ ```
22
+
23
+ This will:
24
+ 1. Copy app files to `custom/apps/portal/`
25
+ 2. Run any pending migrations
26
+ 3. Seed roles, types, link-types, and triggers into the database
27
+ 4. Register the app in `spine.config.json`
28
+
29
+ ## Configuration
30
+
31
+ After installation, edit `custom/apps/portal/manifest.json` to configure:
32
+
33
+ - `route_prefix` — where the app is served (default: `/portal`)
34
+ - `registration` — self-registration behaviour and account strategy (`new` creates a new account per customer, `existing` assigns to a shared account)
35
+
36
+ To apply manifest changes to the database without reinstalling:
37
+
38
+ ```bash
39
+ npx spine-framework update-db-app portal
40
+ ```
41
+
42
+ ## License
43
+
44
+ See [LICENSE.md](./LICENSE.md)
@@ -2,7 +2,7 @@ import { useState } from 'react'
2
2
  import { NavLink, useNavigate } from 'react-router-dom'
3
3
  import { Ticket, Users, BookOpen, GraduationCap, Store, LayoutGrid, User, LogOut, Save } from 'lucide-react'
4
4
  import { useAuth } from '@core/contexts/AuthContext'
5
- import { useCurrentApp } from '@core/contexts/AppContext'
5
+ import { useAppPath } from '@core/hooks/useAppPath'
6
6
  import { Button } from '@core/components/ui/button'
7
7
  import { Avatar, AvatarFallback } from '@core/components/ui/avatar'
8
8
  import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from '@core/components/ui/dialog'
@@ -20,14 +20,11 @@ const NAV_ITEMS = [
20
20
 
21
21
  export function PortalHeader() {
22
22
  const { user, logout } = useAuth()
23
- const app = useCurrentApp()
23
+ const appPath = useAppPath()
24
24
  const navigate = useNavigate()
25
25
  const [accountOpen, setAccountOpen] = useState(false)
26
26
  const [displayName, setDisplayName] = useState(user?.full_name || user?.email?.split('@')[0] || '')
27
27
 
28
- // Normalize route_prefix: '/' → '' so paths are /, /tickets, /kb, etc.
29
- const base = app.route_prefix === '/' ? '' : (app.route_prefix || '')
30
-
31
28
  const initials = (displayName || user?.email || 'U')
32
29
  .split(' ')
33
30
  .map((w: string) => w[0])
@@ -48,7 +45,7 @@ export function PortalHeader() {
48
45
  <>
49
46
  <header className="sticky top-0 z-50 bg-background border-b border-border shadow-sm">
50
47
  <div className="flex items-center h-14 px-6 gap-6">
51
- <NavLink to={`${base}/`} className="flex items-center gap-2 shrink-0 text-foreground hover:text-primary transition-colors">
48
+ <NavLink to={appPath('/')} className="flex items-center gap-2 shrink-0 text-foreground hover:text-primary transition-colors">
52
49
  <LayoutGrid size={18} className="text-primary" />
53
50
  <span className="font-semibold tracking-tight text-sm">Customer Portal</span>
54
51
  </NavLink>
@@ -57,7 +54,7 @@ export function PortalHeader() {
57
54
  {NAV_ITEMS.map(({ label, path, icon: Icon }) => (
58
55
  <NavLink
59
56
  key={path}
60
- to={`${base}${path}`}
57
+ to={appPath(path)}
61
58
  className={({ isActive }) =>
62
59
  [
63
60
  'flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors',
@@ -1,5 +1,5 @@
1
- import { createHandler } from '../../../.framework/functions/_shared/middleware'
2
- import { adminDb } from '../../../.framework/functions/_shared/db'
1
+ import { createHandler } from './_shared/middleware'
2
+ import { adminDb } from './_shared/db'
3
3
 
4
4
  /**
5
5
  * Portal Community Escalation Handler
@@ -1,5 +1,5 @@
1
- import { createHandler } from '../../../.framework/functions/_shared/middleware'
2
- import { processSignal } from '../../functions/custom_funnel-signal'
1
+ import { createHandler } from './_shared/middleware'
2
+ import { processSignal } from './custom_funnel-signal'
3
3
 
4
4
  export const handler = createHandler(async (ctx, body) => {
5
5
  const {
@@ -43,7 +43,7 @@ export const handler = createHandler(async (ctx, body) => {
43
43
  occurred_at: new Date().toISOString()
44
44
  }
45
45
 
46
- const result = await processSignal(payload, { accountId: ctx.accountId, requestId: ctx.requestId }, {})
46
+ const result = await processSignal(payload, { accountId: ctx.accountId, requestId: ctx.requestId }, {}, ctx)
47
47
 
48
48
  if (result?.status === 'error') {
49
49
  const err: any = new Error(result.error || 'Signal processing failed')
package/index.tsx CHANGED
@@ -16,14 +16,6 @@ const DeveloperSettingsPage = lazy(() => import('./pages/DeveloperSettingsPage')
16
16
 
17
17
  function PortalLayout() {
18
18
  const location = useLocation()
19
- const app = useCurrentApp()
20
-
21
- // Normalize route_prefix: '/' → '' so paths are /, /tickets, /kb, etc.
22
- const base = app.route_prefix === '/' ? '' : (app.route_prefix || '')
23
- const prefixDepth = base.split('/').filter(Boolean).length
24
-
25
- const segments = location.pathname.split('/').filter(Boolean)
26
- const appSegments = segments.slice(prefixDepth) // strips the prefix segments
27
19
 
28
20
  return (
29
21
  <div className="h-full flex flex-col bg-background overflow-hidden">
package/manifest.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "Portal",
3
3
  "slug": "portal",
4
4
  "description": "Self-service portal for customers to access tickets, knowledge base, courses, and community",
5
- "version": "0.2.9",
5
+ "version": "0.2.10",
6
6
  "app_type": "full",
7
7
  "route_prefix": "/portal",
8
8
  "required_roles": ["member"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spine-framework-portal",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "private": false,
5
5
  "description": "Customer Portal — self-service portal app for Spine Framework",
6
6
  "type": "module",