spine-framework 0.3.17 → 0.3.19
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/.framework/cli/bin.mjs +16 -0
- package/.framework/cli/commands/create-app.ts +1 -1
- package/.framework/cli/commands/dev.ts +215 -33
- package/.framework/cli/index.ts +37 -75
- package/.framework/functions/_shared/app-manifest.ts +8 -15
- package/.framework/functions/_shared/db.ts +11 -15
- package/.framework/functions/_shared/index.ts +7 -16
- package/.framework/functions/_shared/principal.ts +4 -62
- package/.framework/functions/_shared/resolve-ids.ts +6 -6
- package/.framework/functions/_shared/webhook-registry.ts +43 -1
- package/.framework/functions/admin-funnel.ts +104 -0
- package/.framework/functions/admin-install-funnel.ts +225 -0
- package/.framework/functions/admin-signals.ts +241 -0
- package/.framework/functions/integration-routes.ts +4 -8
- package/.framework/migrations/001_schema.sql +406 -0
- package/.framework/migrations/002_rls_and_functions.sql +710 -0
- package/.framework/migrations/003_system_data.sql +520 -0
- package/.framework/migrations/004_enhancements.sql +43 -0
- package/.framework/public/_redirects +3 -0
- package/.framework/public/spine-logo.jpg +0 -0
- package/.framework/public/spine-logo.svg +3 -0
- package/{scripts → .framework/scripts}/assemble-frontend.sh +8 -5
- package/{scripts → .framework/scripts}/assemble-functions.sh +4 -47
- package/{scripts → .framework/scripts}/assemble.sh +2 -8
- package/{scripts → .framework/scripts}/boundary-check.sh +5 -9
- package/{scripts → .framework/scripts}/check-core-integrity.sh +0 -0
- package/.framework/seeds/link_types/account_cli_instances.json +9 -0
- package/.framework/seeds/types/funnel_signal_use.json +98 -0
- package/.framework/seeds/types/spine_instance.json +109 -0
- package/.framework/src/App.tsx +11 -21
- package/.framework/src/components/CustomAppLoader.tsx +2 -19
- package/.framework/src/components/ui/accordion.tsx +1 -1
- package/.framework/src/components/ui/alert-dialog.tsx +1 -1
- package/.framework/src/components/ui/aspect-ratio.tsx +1 -1
- package/.framework/src/components/ui/avatar.tsx +1 -1
- package/.framework/src/components/ui/badge.tsx +2 -2
- package/.framework/src/components/ui/breadcrumb.tsx +2 -2
- package/.framework/src/components/ui/button-group.tsx +2 -2
- package/.framework/src/components/ui/button.tsx +2 -2
- package/.framework/src/components/ui/chart.tsx +6 -1
- package/.framework/src/components/ui/checkbox.tsx +1 -1
- package/.framework/src/components/ui/collapsible.tsx +1 -1
- package/.framework/src/components/ui/context-menu.tsx +1 -1
- package/.framework/src/components/ui/dialog.tsx +1 -1
- package/.framework/src/components/ui/direction.tsx +17 -1
- package/.framework/src/components/ui/dropdown-menu.tsx +1 -1
- package/.framework/src/components/ui/hover-card.tsx +1 -1
- package/.framework/src/components/ui/item.tsx +2 -2
- package/.framework/src/components/ui/label.tsx +1 -1
- package/.framework/src/components/ui/menubar.tsx +1 -1
- package/.framework/src/components/ui/navigation-menu.tsx +1 -1
- package/.framework/src/components/ui/popover.tsx +1 -1
- package/.framework/src/components/ui/progress.tsx +1 -1
- package/.framework/src/components/ui/radio-group.tsx +1 -1
- package/.framework/src/components/ui/scroll-area.tsx +1 -1
- package/.framework/src/components/ui/select.tsx +1 -1
- package/.framework/src/components/ui/separator.tsx +1 -1
- package/.framework/src/components/ui/sheet.tsx +1 -1
- package/.framework/src/components/ui/sidebar.tsx +6 -6
- package/.framework/src/components/ui/slider.tsx +1 -1
- package/.framework/src/components/ui/switch.tsx +1 -1
- package/.framework/src/components/ui/tabs.tsx +1 -1
- package/.framework/src/components/ui/toggle-group.tsx +1 -1
- package/.framework/src/components/ui/toggle.tsx +1 -1
- package/.framework/src/components/ui/tooltip.tsx +1 -1
- package/.framework/src/pages/auth/LoginPage.tsx +10 -9
- package/LICENSE.md +63 -93
- package/README.md +254 -129
- package/custom/.devin/skills/install-app/SKILL.md +39 -0
- package/custom/.devin/workflows/app-install.yaml +83 -0
- package/custom/README.md +79 -0
- package/docs/APPS.md +232 -0
- package/docs/ARCHITECTURE.md +246 -0
- package/docs/INSTALL.md +155 -0
- package/docs/README.md +170 -0
- package/docs/design-schema-spec.md +1837 -0
- package/docs/dev-guides/01-create-an-app.md +183 -0
- package/docs/dev-guides/02-create-a-function.md +178 -0
- package/docs/dev-guides/03-create-a-component.md +178 -0
- package/docs/dev-guides/04-webhook-handlers.md +129 -0
- package/docs/dev-guides/05-testing.md +168 -0
- package/docs/dev-guides/README.md +40 -0
- package/docs/npm-packages-plan.md +288 -0
- package/docs/spine-core--api-reference.md +822 -0
- package/package.json +79 -150
- package/.framework/cli/bin.cjs +0 -14
- package/.framework/cli/commands/claim.ts +0 -430
- package/.framework/cli/commands/init.ts +0 -219
- package/.framework/cli/commands/install-app.ts +0 -685
- package/.framework/cli/commands/migrate.ts +0 -178
- package/.framework/cli/commands/publish.ts +0 -191
- package/.framework/cli/commands/status.ts +0 -268
- package/.framework/cli/commands/uninstall-app.ts +0 -166
- package/.framework/cli/commands/update-app.ts +0 -397
- package/.framework/cli/welcome.cjs +0 -45
- package/.framework/config/signal-client.ts +0 -147
- package/.framework/config/signals.ts +0 -70
- package/.framework/docs/STABILITY.md +0 -52
- package/.framework/docs/examples/custom-app/README.md +0 -77
- package/.framework/docs/examples/custom-function/README.md +0 -27
- package/.framework/docs/examples/custom-function/handler.ts +0 -48
- package/.framework/docs/examples/custom-webhook/README.md +0 -68
- package/.framework/functions/handler-registry.ts +0 -22
- package/.framework/functions/signal.ts +0 -168
- package/.framework/migrations/000_foundation.sql +0 -1302
- package/.framework/migrations/001_seed.sql +0 -163
- package/.framework/migrations/002_seed_constraints.sql +0 -19
- package/.framework/migrations/003_auth_user_trigger.sql +0 -67
- package/.framework/migrations/004_app_version_tracking.sql +0 -8
- package/.framework/migrations/005_pipelines_slug_stages.sql +0 -21
- package/.framework/src/pages/auth/RegisterPage.tsx +0 -163
- package/CHANGELOG.md +0 -71
- package/STRUCTURE.md +0 -150
- package/bin/spine-framework.cjs +0 -62
- package/bin/welcome.cjs +0 -58
- package/bin/ws-shim.ts +0 -10
- package/config/components.json +0 -25
- package/config/deno.lock +0 -108
- package/config/package-lock.json +0 -17183
- package/config/postcss.config.cjs +0 -10
- package/config/tailwind.config.cjs +0 -78
- package/config/tsconfig.build.json +0 -32
- package/config/tsconfig.cli.json +0 -18
- package/config/tsconfig.json +0 -41
- package/config/tsconfig.node.json +0 -17
- package/config/tsconfig.node.tsbuildinfo +0 -1
- package/config/tsconfig.tsbuildinfo +0 -1
- package/config/typedoc.json +0 -16
- package/config/vite.config.d.ts +0 -2
- package/config/vite.config.ts +0 -71
- package/dist/cli/commands/agents.d.ts +0 -39
- package/dist/cli/commands/agents.d.ts.map +0 -1
- package/dist/cli/commands/auth.d.ts +0 -36
- package/dist/cli/commands/auth.d.ts.map +0 -1
- package/dist/cli/commands/claim.d.ts +0 -38
- package/dist/cli/commands/claim.d.ts.map +0 -1
- package/dist/cli/commands/create-app.d.ts +0 -23
- package/dist/cli/commands/create-app.d.ts.map +0 -1
- package/dist/cli/commands/dev.d.ts +0 -24
- package/dist/cli/commands/dev.d.ts.map +0 -1
- package/dist/cli/commands/doctor.d.ts +0 -42
- package/dist/cli/commands/doctor.d.ts.map +0 -1
- package/dist/cli/commands/generate.d.ts +0 -36
- package/dist/cli/commands/generate.d.ts.map +0 -1
- package/dist/cli/commands/init.d.ts +0 -20
- package/dist/cli/commands/init.d.ts.map +0 -1
- package/dist/cli/commands/install-app.d.ts +0 -30
- package/dist/cli/commands/install-app.d.ts.map +0 -1
- package/dist/cli/commands/items.d.ts +0 -45
- package/dist/cli/commands/items.d.ts.map +0 -1
- package/dist/cli/commands/migrate.d.ts +0 -21
- package/dist/cli/commands/migrate.d.ts.map +0 -1
- package/dist/cli/commands/migrations.d.ts +0 -41
- package/dist/cli/commands/migrations.d.ts.map +0 -1
- package/dist/cli/commands/pipelines.d.ts +0 -40
- package/dist/cli/commands/pipelines.d.ts.map +0 -1
- package/dist/cli/commands/publish.d.ts +0 -23
- package/dist/cli/commands/publish.d.ts.map +0 -1
- package/dist/cli/commands/status.d.ts +0 -23
- package/dist/cli/commands/status.d.ts.map +0 -1
- package/dist/cli/commands/system.d.ts +0 -29
- package/dist/cli/commands/system.d.ts.map +0 -1
- package/dist/cli/commands/test.d.ts +0 -46
- package/dist/cli/commands/test.d.ts.map +0 -1
- package/dist/cli/commands/uninstall-app.d.ts +0 -23
- package/dist/cli/commands/uninstall-app.d.ts.map +0 -1
- package/dist/cli/commands/update-app.d.ts +0 -24
- package/dist/cli/commands/update-app.d.ts.map +0 -1
- package/dist/cli/context.d.ts +0 -88
- package/dist/cli/context.d.ts.map +0 -1
- package/dist/cli/env-loader.d.ts +0 -14
- package/dist/cli/env-loader.d.ts.map +0 -1
- package/dist/cli/index.d.ts +0 -44
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/config/signals.d.ts +0 -82
- package/dist/config/signals.d.ts.map +0 -1
- package/dist/functions/_shared/agent-runner.d.ts +0 -156
- package/dist/functions/_shared/agent-runner.d.ts.map +0 -1
- package/dist/functions/_shared/app-manifest.d.ts +0 -68
- package/dist/functions/_shared/app-manifest.d.ts.map +0 -1
- package/dist/functions/_shared/audit.d.ts +0 -91
- package/dist/functions/_shared/audit.d.ts.map +0 -1
- package/dist/functions/_shared/db.d.ts +0 -125
- package/dist/functions/_shared/db.d.ts.map +0 -1
- package/dist/functions/_shared/index.d.ts +0 -299
- package/dist/functions/_shared/index.d.ts.map +0 -1
- package/dist/functions/_shared/middleware.d.ts +0 -315
- package/dist/functions/_shared/middleware.d.ts.map +0 -1
- package/dist/functions/_shared/permissions.d.ts +0 -626
- package/dist/functions/_shared/permissions.d.ts.map +0 -1
- package/dist/functions/_shared/pipeline-runner.d.ts +0 -124
- package/dist/functions/_shared/pipeline-runner.d.ts.map +0 -1
- package/dist/functions/_shared/principal.d.ts +0 -284
- package/dist/functions/_shared/principal.d.ts.map +0 -1
- package/dist/functions/_shared/resolve-ids.d.ts +0 -10
- package/dist/functions/_shared/resolve-ids.d.ts.map +0 -1
- package/dist/functions/_shared/schema-utils.d.ts +0 -181
- package/dist/functions/_shared/schema-utils.d.ts.map +0 -1
- package/dist/functions/_shared/testing.d.ts +0 -172
- package/dist/functions/_shared/testing.d.ts.map +0 -1
- package/dist/functions/_shared/trigger-engine.d.ts +0 -140
- package/dist/functions/_shared/trigger-engine.d.ts.map +0 -1
- package/dist/functions/_shared/webhook-registration.d.ts +0 -81
- package/dist/functions/_shared/webhook-registration.d.ts.map +0 -1
- package/dist/functions/_shared/webhook-registry.d.ts +0 -41
- package/dist/functions/_shared/webhook-registry.d.ts.map +0 -1
- package/dist/functions/account-nodes.d.ts +0 -48
- package/dist/functions/account-nodes.d.ts.map +0 -1
- package/dist/functions/admin-data.d.ts +0 -178
- package/dist/functions/admin-data.d.ts.map +0 -1
- package/dist/functions/ai-agents.d.ts +0 -125
- package/dist/functions/ai-agents.d.ts.map +0 -1
- package/dist/functions/api-keys.d.ts +0 -140
- package/dist/functions/api-keys.d.ts.map +0 -1
- package/dist/functions/apps.d.ts +0 -163
- package/dist/functions/apps.d.ts.map +0 -1
- package/dist/functions/auth.d.ts +0 -74
- package/dist/functions/auth.d.ts.map +0 -1
- package/dist/functions/debug-auth.d.ts +0 -33
- package/dist/functions/debug-auth.d.ts.map +0 -1
- package/dist/functions/embeddings.d.ts +0 -205
- package/dist/functions/embeddings.d.ts.map +0 -1
- package/dist/functions/handler-registry.d.ts +0 -22
- package/dist/functions/handler-registry.d.ts.map +0 -1
- package/dist/functions/integration-routes.d.ts +0 -45
- package/dist/functions/integration-routes.d.ts.map +0 -1
- package/dist/functions/integrations.d.ts +0 -124
- package/dist/functions/integrations.d.ts.map +0 -1
- package/dist/functions/item-progress.d.ts +0 -41
- package/dist/functions/item-progress.d.ts.map +0 -1
- package/dist/functions/logs.d.ts +0 -162
- package/dist/functions/logs.d.ts.map +0 -1
- package/dist/functions/observability.d.ts +0 -123
- package/dist/functions/observability.d.ts.map +0 -1
- package/dist/functions/pipeline-executions.d.ts +0 -190
- package/dist/functions/pipeline-executions.d.ts.map +0 -1
- package/dist/functions/pipelines.d.ts +0 -171
- package/dist/functions/pipelines.d.ts.map +0 -1
- package/dist/functions/prompt-configs.d.ts +0 -125
- package/dist/functions/prompt-configs.d.ts.map +0 -1
- package/dist/functions/roles.d.ts +0 -118
- package/dist/functions/roles.d.ts.map +0 -1
- package/dist/functions/signal.d.ts +0 -73
- package/dist/functions/signal.d.ts.map +0 -1
- package/dist/functions/system-cron.d.ts +0 -65
- package/dist/functions/system-cron.d.ts.map +0 -1
- package/dist/functions/system.d.ts +0 -29
- package/dist/functions/system.d.ts.map +0 -1
- package/dist/functions/tests.d.ts +0 -28
- package/dist/functions/tests.d.ts.map +0 -1
- package/dist/functions/timers.d.ts +0 -139
- package/dist/functions/timers.d.ts.map +0 -1
- package/dist/functions/triggers.d.ts +0 -203
- package/dist/functions/triggers.d.ts.map +0 -1
- package/dist/functions/types.d.ts +0 -151
- package/dist/functions/types.d.ts.map +0 -1
- package/dist/src/types/types.d.ts +0 -364
- package/dist/src/types/types.d.ts.map +0 -1
- package/index.html +0 -13
- package/netlify.toml +0 -36
- package/package-project.json +0 -71
- package/scripts/ingest-chunks.cjs +0 -202
- package/scripts/kb-chunk-parser.cjs +0 -312
- package/scripts/kb-chunk-parser.ts +0 -330
- package/scripts/load-test-app-install.ts +0 -484
- package/scripts/netlify-dev-wrapper.sh +0 -22
- package/vitest.config.ts +0 -45
- /package/{scripts → .framework/scripts}/app-install-cli.ts +0 -0
- /package/{scripts → .framework/scripts}/build-manifest.sh +0 -0
- /package/{scripts → .framework/scripts}/verify-integrity.sh +0 -0
package/README.md
CHANGED
|
@@ -1,129 +1,254 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
npm install
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
1
|
+
Spine Framework
|
|
2
|
+
A complete enterprise application framework built on Supabase + Netlify + React for building scalable multi-tenant applications with extensible app ecosystems.
|
|
3
|
+
|
|
4
|
+
Overview
|
|
5
|
+
Spine Framework is a complete, runnable framework that provides everything you need to build enterprise applications:
|
|
6
|
+
|
|
7
|
+
Multi-tenant Architecture: Support for tenant hierarchies and isolated deployments
|
|
8
|
+
Role-Based Access Control: Fine-grained permissions and authorization
|
|
9
|
+
App Ecosystem: Install and manage custom applications
|
|
10
|
+
Real-time Features: Built-in support for real-time collaboration and notifications
|
|
11
|
+
AI Integration: Native support for AI agents and intelligent workflows
|
|
12
|
+
Developer Tools: Comprehensive tooling for development, testing, and deployment
|
|
13
|
+
Quick Start
|
|
14
|
+
Prerequisites
|
|
15
|
+
Node.js 18+
|
|
16
|
+
PostgreSQL database (via Supabase recommended)
|
|
17
|
+
Netlify account (for deployment)
|
|
18
|
+
Installation
|
|
19
|
+
# Clone the framework
|
|
20
|
+
git clone https://github.com/spine-framework/spine-framework.git
|
|
21
|
+
cd spine-framework
|
|
22
|
+
|
|
23
|
+
# Install dependencies
|
|
24
|
+
npm install
|
|
25
|
+
|
|
26
|
+
# Set up environment
|
|
27
|
+
cp .env.example .env
|
|
28
|
+
# Edit .env with your Supabase and Netlify credentials
|
|
29
|
+
|
|
30
|
+
# Start development
|
|
31
|
+
npm run dev
|
|
32
|
+
Install Custom Apps
|
|
33
|
+
# Install Cortex (CRM, Support, Community, Knowledge Base)
|
|
34
|
+
npm run app-install cortex
|
|
35
|
+
|
|
36
|
+
# Install Customer Portal
|
|
37
|
+
npm run app-install customer-portal
|
|
38
|
+
|
|
39
|
+
# List available apps
|
|
40
|
+
npm run spine-framework list-apps
|
|
41
|
+
Architecture
|
|
42
|
+
Core Components
|
|
43
|
+
Framework Core: Base functionality, authentication, and data models
|
|
44
|
+
App Registry: System for managing and distributing applications
|
|
45
|
+
Multi-tenant Engine: Tenant isolation and hierarchy management
|
|
46
|
+
Authorization Layer: Role-based permissions and access control
|
|
47
|
+
Real-time Infrastructure: WebSocket support and live updates
|
|
48
|
+
AI Agent System: Integration with AI services and workflows
|
|
49
|
+
App Ecosystem
|
|
50
|
+
Spine Framework supports a growing ecosystem of applications:
|
|
51
|
+
|
|
52
|
+
Cortex: CRM, Support, Community, and Knowledge Base
|
|
53
|
+
Customer Portal: Self-service customer portal
|
|
54
|
+
Custom Apps: Build your own applications using the framework
|
|
55
|
+
Database Schema
|
|
56
|
+
The framework uses a clean, normalized schema with:
|
|
57
|
+
|
|
58
|
+
Accounts & Tenants: Multi-tenant hierarchy support
|
|
59
|
+
People & Roles: User management and permissions
|
|
60
|
+
Items & Threads: Flexible data modeling system
|
|
61
|
+
Apps & Integrations: Extensible app registry
|
|
62
|
+
AI Agents: Intelligent workflow automation
|
|
63
|
+
Development
|
|
64
|
+
Project Structure
|
|
65
|
+
my-spine-project/
|
|
66
|
+
├── src/
|
|
67
|
+
│ ├── components/ # Reusable UI components
|
|
68
|
+
│ ├── pages/ # Application pages
|
|
69
|
+
│ ├── hooks/ # Custom React hooks
|
|
70
|
+
│ ├── contexts/ # React contexts
|
|
71
|
+
│ └── utils/ # Utility functions
|
|
72
|
+
├── functions/ # Serverless functions
|
|
73
|
+
├── migrations/ # Database migrations
|
|
74
|
+
├── custom/ # Custom app extensions
|
|
75
|
+
└── docs/ # Documentation
|
|
76
|
+
Building Apps
|
|
77
|
+
Create custom applications using the Spine Framework:
|
|
78
|
+
|
|
79
|
+
// src/apps/my-app/index.tsx
|
|
80
|
+
import { AppLayout, useCurrentApp } from '@spine-framework/core'
|
|
81
|
+
|
|
82
|
+
export default function MyApp() {
|
|
83
|
+
const app = useCurrentApp()
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<AppLayout>
|
|
87
|
+
<h1>{app.name}</h1>
|
|
88
|
+
{/* Your app content */}
|
|
89
|
+
</AppLayout>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
Database Extensions
|
|
93
|
+
Add custom database schema:
|
|
94
|
+
|
|
95
|
+
-- migrations/001_my_app.sql
|
|
96
|
+
CREATE TABLE my_app_data (
|
|
97
|
+
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
98
|
+
account_id UUID REFERENCES accounts(id),
|
|
99
|
+
title TEXT NOT NULL,
|
|
100
|
+
created_at TIMESTAMPTZ DEFAULT now()
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
-- Enable RLS
|
|
104
|
+
ALTER TABLE my_app_data ENABLE ROW LEVEL SECURITY;
|
|
105
|
+
Configuration
|
|
106
|
+
Environment Variables
|
|
107
|
+
# Database
|
|
108
|
+
DATABASE_URL=postgresql://...
|
|
109
|
+
|
|
110
|
+
# Supabase
|
|
111
|
+
SUPABASE_URL=your-project.supabase.co
|
|
112
|
+
SUPABASE_ANON_KEY=your-anon-key
|
|
113
|
+
SUPABASE_SERVICE_ROLE_KEY=your-service-key
|
|
114
|
+
|
|
115
|
+
# Framework
|
|
116
|
+
SPINE_ENV=development
|
|
117
|
+
SPINE_LOG_LEVEL=info
|
|
118
|
+
Framework Configuration
|
|
119
|
+
// spine.config.ts
|
|
120
|
+
export default {
|
|
121
|
+
database: {
|
|
122
|
+
url: process.env.DATABASE_URL,
|
|
123
|
+
poolSize: 10,
|
|
124
|
+
},
|
|
125
|
+
auth: {
|
|
126
|
+
providers: ['email', 'github', 'google'],
|
|
127
|
+
sessionTimeout: '24h',
|
|
128
|
+
},
|
|
129
|
+
apps: {
|
|
130
|
+
registry: 'https://registry.spine-framework.com',
|
|
131
|
+
autoUpdate: true,
|
|
132
|
+
},
|
|
133
|
+
ai: {
|
|
134
|
+
provider: 'openai',
|
|
135
|
+
model: 'gpt-4',
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
Deployment
|
|
139
|
+
Development
|
|
140
|
+
# Start development server
|
|
141
|
+
npm run dev
|
|
142
|
+
|
|
143
|
+
# Run tests
|
|
144
|
+
npm test
|
|
145
|
+
|
|
146
|
+
# Type checking
|
|
147
|
+
npm run type-check
|
|
148
|
+
Production
|
|
149
|
+
# Build for production
|
|
150
|
+
npm run build
|
|
151
|
+
|
|
152
|
+
# Deploy to Netlify
|
|
153
|
+
netlify deploy --prod
|
|
154
|
+
|
|
155
|
+
# Or deploy to your preferred platform
|
|
156
|
+
Database Migrations
|
|
157
|
+
# Run migrations
|
|
158
|
+
npx spine migrate up
|
|
159
|
+
|
|
160
|
+
# Create new migration
|
|
161
|
+
npx spine migrate create add_new_feature
|
|
162
|
+
|
|
163
|
+
# Rollback migration
|
|
164
|
+
npx spine migrate down
|
|
165
|
+
Available Apps
|
|
166
|
+
Official Apps
|
|
167
|
+
spine-framework-cortex
|
|
168
|
+
|
|
169
|
+
CRM, Support, Community, Knowledge Base
|
|
170
|
+
npm install spine-framework-cortex
|
|
171
|
+
spine-framework-portal
|
|
172
|
+
|
|
173
|
+
Customer self-service portal
|
|
174
|
+
npm install spine-framework-portal
|
|
175
|
+
Installing Apps
|
|
176
|
+
# Install an app
|
|
177
|
+
npx spine install-app cortex
|
|
178
|
+
|
|
179
|
+
# List available apps
|
|
180
|
+
npx spine list-apps
|
|
181
|
+
|
|
182
|
+
# Update an app
|
|
183
|
+
npx spine update-app cortex
|
|
184
|
+
API Reference
|
|
185
|
+
Core Hooks
|
|
186
|
+
// Authentication
|
|
187
|
+
import { useAuth, useUser } from '@spine-framework/core'
|
|
188
|
+
|
|
189
|
+
// App Management
|
|
190
|
+
import { useApps, useCurrentApp } from '@spine-framework/core'
|
|
191
|
+
|
|
192
|
+
// Data Management
|
|
193
|
+
import { useItems, useThreads } from '@spine-framework/core'
|
|
194
|
+
|
|
195
|
+
// Real-time
|
|
196
|
+
import { useWebSocket } from '@spine-framework/core'
|
|
197
|
+
Database Functions
|
|
198
|
+
-- Get account apps
|
|
199
|
+
SELECT * FROM get_account_apps(account_id, true, false);
|
|
200
|
+
|
|
201
|
+
-- Get accessible accounts
|
|
202
|
+
SELECT * FROM get_accessible_accounts(user_id);
|
|
203
|
+
|
|
204
|
+
-- Check permissions
|
|
205
|
+
SELECT * FROM has_permission(user_id, 'action', 'resource');
|
|
206
|
+
Contributing
|
|
207
|
+
Development Setup
|
|
208
|
+
# Clone the repository
|
|
209
|
+
git clone https://github.com/spine-framework/spine-framework.git
|
|
210
|
+
cd spine-framework
|
|
211
|
+
|
|
212
|
+
# Install dependencies
|
|
213
|
+
npm install
|
|
214
|
+
|
|
215
|
+
# Start development
|
|
216
|
+
npm run dev
|
|
217
|
+
Submitting Changes
|
|
218
|
+
Fork the repository
|
|
219
|
+
Create a feature branch
|
|
220
|
+
Make your changes
|
|
221
|
+
Add tests
|
|
222
|
+
Submit a pull request
|
|
223
|
+
Building Apps for Distribution
|
|
224
|
+
If you want to contribute an app to the ecosystem:
|
|
225
|
+
|
|
226
|
+
Create your app using the framework
|
|
227
|
+
Follow the app structure guidelines
|
|
228
|
+
Include comprehensive documentation
|
|
229
|
+
Submit for review
|
|
230
|
+
License
|
|
231
|
+
This framework is licensed under the Spine Framework Internal Use License.
|
|
232
|
+
|
|
233
|
+
✅ Free for internal business use
|
|
234
|
+
❌ Commercial redistribution requires separate license
|
|
235
|
+
📞 Contact: spine-framework.com for commercial licensing
|
|
236
|
+
Support
|
|
237
|
+
Documentation: docs.spine-framework.com
|
|
238
|
+
Issues: GitHub Issues
|
|
239
|
+
Community: Discord Server
|
|
240
|
+
Commercial: Contact Us
|
|
241
|
+
Version History
|
|
242
|
+
v1.0.0
|
|
243
|
+
Initial release
|
|
244
|
+
Multi-tenant architecture
|
|
245
|
+
App registry system
|
|
246
|
+
Role-based access control
|
|
247
|
+
Real-time features
|
|
248
|
+
AI integration
|
|
249
|
+
Roadmap
|
|
250
|
+
v1.1: Enhanced AI capabilities
|
|
251
|
+
v1.2: Advanced analytics and reporting
|
|
252
|
+
v1.3: Mobile app support
|
|
253
|
+
v2.0: Microservices architecture
|
|
254
|
+
Spine Framework - Build enterprise applications with confidence.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Install App
|
|
2
|
+
|
|
3
|
+
Installs a Spine Framework app into the custom workspace.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
Use this skill when you need to:
|
|
8
|
+
- Install an app package (portal, cortex, or third-party) into custom/apps/
|
|
9
|
+
- Configure seed data for the app
|
|
10
|
+
- Set up migrations required by the app
|
|
11
|
+
|
|
12
|
+
## Installation Process
|
|
13
|
+
|
|
14
|
+
1. **Copy app files** from the package to `custom/apps/<app-slug>/`
|
|
15
|
+
2. **Copy seed data** to `custom/apps/<app-slug>/seed/`
|
|
16
|
+
3. **Copy migrations** (if any) to `custom/migrations/`
|
|
17
|
+
4. **Update workspace configuration** to include the app
|
|
18
|
+
|
|
19
|
+
## Critical Safeguards
|
|
20
|
+
|
|
21
|
+
- **NEVER** delete existing `custom/apps/`, `custom/functions/`, or `custom/migrations/` content
|
|
22
|
+
- **ALWAYS** preserve existing custom apps during installation
|
|
23
|
+
- Seed data is additive - existing types/roles are not modified
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
Install the cortex app from spine-framework-cortex package
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The skill will:
|
|
32
|
+
1. Locate the package in node_modules or local path
|
|
33
|
+
2. Copy app files to custom/apps/cortex/
|
|
34
|
+
3. Copy seed files (types.json, roles.json, link-types.json)
|
|
35
|
+
4. Report what was installed
|
|
36
|
+
|
|
37
|
+
## Output
|
|
38
|
+
|
|
39
|
+
Reports installed files and any conflicts that need manual resolution.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
name: Install App
|
|
2
|
+
version: 1.0.0
|
|
3
|
+
description: Install a Spine Framework app into the custom workspace
|
|
4
|
+
|
|
5
|
+
triggers:
|
|
6
|
+
- type: user-prompt
|
|
7
|
+
patterns:
|
|
8
|
+
- "install app"
|
|
9
|
+
- "add app"
|
|
10
|
+
- "setup app"
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- name: Identify app package
|
|
14
|
+
action: ask-user
|
|
15
|
+
prompt: "Which app would you like to install? (e.g., cortex, portal, or package name)"
|
|
16
|
+
store: app_name
|
|
17
|
+
|
|
18
|
+
- name: Check for existing installation
|
|
19
|
+
action: shell
|
|
20
|
+
command: "test -d /Users/thistle/CascadeProjects/spine-ia/custom/apps/${app_name} && echo 'exists' || echo 'new'"
|
|
21
|
+
store: exists_status
|
|
22
|
+
|
|
23
|
+
- name: Warn about existing installation
|
|
24
|
+
condition: exists_status == "exists"
|
|
25
|
+
action: ask-user
|
|
26
|
+
prompt: "App ${app_name} already exists in custom/apps/. Overwrite? (yes/no)"
|
|
27
|
+
store: confirm_overwrite
|
|
28
|
+
|
|
29
|
+
- name: Exit on no confirmation
|
|
30
|
+
condition: exists_status == "exists" && confirm_overwrite != "yes"
|
|
31
|
+
action: exit
|
|
32
|
+
message: "Installation cancelled. Existing app preserved."
|
|
33
|
+
|
|
34
|
+
- name: Locate package
|
|
35
|
+
action: shell
|
|
36
|
+
command: |
|
|
37
|
+
if [ -d "/Users/thistle/CascadeProjects/spine-ia/custom/apps/${app_name}" ]; then
|
|
38
|
+
echo "/Users/thistle/CascadeProjects/spine-ia/custom/apps/${app_name}"
|
|
39
|
+
elif [ -d "/Users/thistle/CascadeProjects/spine-ia/custom/npm/${app_name}" ]; then
|
|
40
|
+
echo "/Users/thistle/CascadeProjects/spine-ia/custom/npm/${app_name}"
|
|
41
|
+
else
|
|
42
|
+
echo "not_found"
|
|
43
|
+
fi
|
|
44
|
+
store: package_path
|
|
45
|
+
|
|
46
|
+
- name: Report package not found
|
|
47
|
+
condition: package_path == "not_found"
|
|
48
|
+
action: exit
|
|
49
|
+
message: "Could not find app package. Expected at custom/apps/${app_name} or custom/npm/${app_name}"
|
|
50
|
+
|
|
51
|
+
- name: Install app files
|
|
52
|
+
action: shell
|
|
53
|
+
command: |
|
|
54
|
+
mkdir -p "/Users/thistle/CascadeProjects/spine-ia/custom/apps/${app_name}"
|
|
55
|
+
cp -r "${package_path}"/*/ "/Users/thistle/CascadeProjects/spine-ia/custom/apps/${app_name}/" 2>/dev/null || true
|
|
56
|
+
echo "App files copied"
|
|
57
|
+
|
|
58
|
+
- name: Install seed data
|
|
59
|
+
action: shell
|
|
60
|
+
command: |
|
|
61
|
+
if [ -d "${package_path}/seed" ]; then
|
|
62
|
+
mkdir -p "/Users/thistle/CascadeProjects/spine-ia/custom/apps/${app_name}/seed"
|
|
63
|
+
cp "${package_path}/seed/"*.json "/Users/thistle/CascadeProjects/spine-ia/custom/apps/${app_name}/seed/" 2>/dev/null || true
|
|
64
|
+
echo "Seed data copied"
|
|
65
|
+
else
|
|
66
|
+
echo "No seed data found"
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
- name: Report installation
|
|
70
|
+
action: message
|
|
71
|
+
message: |
|
|
72
|
+
App ${app_name} installed successfully!
|
|
73
|
+
|
|
74
|
+
Location: custom/apps/${app_name}/
|
|
75
|
+
|
|
76
|
+
Next steps:
|
|
77
|
+
1. Review the installed files
|
|
78
|
+
2. Apply seed data: npm run seed -- --app=${app_name}
|
|
79
|
+
3. Restart the development server
|
|
80
|
+
|
|
81
|
+
output:
|
|
82
|
+
success: "App ${app_name} installed to custom/apps/${app_name}/"
|
|
83
|
+
failure: "Failed to install app. Check the logs above."
|
package/custom/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Spine Framework Custom Workspace
|
|
2
|
+
|
|
3
|
+
This directory is your extension workspace for the Spine Framework. Customize your instance here without modifying the core framework code.
|
|
4
|
+
|
|
5
|
+
## Directory Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
custom/
|
|
9
|
+
├── apps/ # Custom apps extending Spine
|
|
10
|
+
│ ├── cortex/ # AI-powered support & CRM
|
|
11
|
+
│ ├── portal/ # Customer portal & courses
|
|
12
|
+
│ └── your-app/ # Your custom app
|
|
13
|
+
├── components/ # Shared React components
|
|
14
|
+
├── functions/ # Edge functions (Netlify/Vercel)
|
|
15
|
+
├── migrations/ # Database migrations
|
|
16
|
+
├── npm/ # Local npm packages
|
|
17
|
+
├── tests/ # Custom tests
|
|
18
|
+
└── .devin/ # Devin workflows & skills
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Getting Started
|
|
22
|
+
|
|
23
|
+
### 1. Install an App
|
|
24
|
+
|
|
25
|
+
Use the Devin skill to install an app:
|
|
26
|
+
```
|
|
27
|
+
Install the cortex app
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Or manually copy an app package to `custom/apps/`.
|
|
31
|
+
|
|
32
|
+
### 2. Apply Seed Data
|
|
33
|
+
|
|
34
|
+
Seed data defines types, roles, and configuration:
|
|
35
|
+
```bash
|
|
36
|
+
npm run seed -- --app=cortex
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 3. Start Development
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm run dev
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Creating Custom Apps
|
|
46
|
+
|
|
47
|
+
1. Create `custom/apps/my-app/` with:
|
|
48
|
+
- `index.tsx` - App entry point
|
|
49
|
+
- `manifest.json` - App configuration
|
|
50
|
+
- `seed/types.json` - Custom types
|
|
51
|
+
- `seed/roles.json` - Custom roles
|
|
52
|
+
- `pages/` - Page components
|
|
53
|
+
- `components/` - App-specific components
|
|
54
|
+
|
|
55
|
+
2. Add navigation items in `manifest.json`
|
|
56
|
+
|
|
57
|
+
3. Restart the dev server
|
|
58
|
+
|
|
59
|
+
## Database Migrations
|
|
60
|
+
|
|
61
|
+
Place custom migrations in `custom/migrations/`:
|
|
62
|
+
```
|
|
63
|
+
custom/migrations/001_add_custom_table.sql
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Migrations are applied automatically on startup.
|
|
67
|
+
|
|
68
|
+
## Best Practices
|
|
69
|
+
|
|
70
|
+
- **Never modify `.framework/`** - Use this `custom/` directory instead
|
|
71
|
+
- **Keep apps self-contained** - Each app should have its own seed data
|
|
72
|
+
- **Use the CLI** - `spine-cli` helps manage apps and migrations
|
|
73
|
+
- **Test in isolation** - Apps should work standalone
|
|
74
|
+
|
|
75
|
+
## Support
|
|
76
|
+
|
|
77
|
+
- Framework docs: `.framework/docs/`
|
|
78
|
+
- Devin skills: `custom/.devin/skills/`
|
|
79
|
+
- Community: https://github.com/spine-framework/spine
|