@nextsparkjs/theme-default 0.1.0-beta.28 → 0.1.0-beta.29

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 NextSpark
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -91,78 +91,51 @@ export const APP_CONFIG_OVERRIDES = {
91
91
  // =============================================================================
92
92
  // DOCUMENTATION CONFIGURATION
93
93
  // =============================================================================
94
+ /**
95
+ * Documentation system configuration
96
+ *
97
+ * Structure:
98
+ * - public: User-facing documentation at /docs
99
+ * - superadmin: Admin documentation at /superadmin/docs
100
+ *
101
+ * NOTE: Plugin docs are NOT in the registry - they are for developer reference only (IDE/LLM).
102
+ */
94
103
  docs: {
95
- /**
96
- * Enable/disable documentation system
97
- */
104
+ /** Enable/disable documentation system */
98
105
  enabled: true,
99
106
 
100
- /**
101
- * Public access to documentation
102
- * - true: Documentation accessible without authentication
103
- * - false: Requires user to be logged in
104
- */
105
- public: true,
107
+ /** Make public documentation accessible without authentication */
108
+ publicAccess: true,
106
109
 
107
- /**
108
- * Enable search functionality in documentation
109
- */
110
+ /** Enable search functionality in documentation */
110
111
  searchEnabled: true,
111
112
 
112
- /**
113
- * Show breadcrumbs in documentation pages
114
- */
113
+ /** Show breadcrumbs in documentation pages */
115
114
  breadcrumbs: true,
116
115
 
117
116
  /**
118
- * Theme Documentation Configuration
119
- * Controls how theme-level documentation appears in the sidebar
117
+ * Public Documentation Configuration
118
+ * Controls public-facing documentation at /docs routes
120
119
  */
121
- theme: {
122
- /** Show/hide theme documentation category */
120
+ public: {
121
+ /** Show/hide public documentation */
123
122
  enabled: true,
124
- /** Expand theme category by default on page load */
123
+ /** Expand sections by default on page load */
125
124
  open: true,
126
- /** Custom label displayed in sidebar for theme category */
127
- label: "Default Theme",
125
+ /** Custom label displayed in sidebar */
126
+ label: "Documentation",
128
127
  },
129
128
 
130
129
  /**
131
- * Plugins Documentation Configuration
132
- * Controls how plugin documentation appears in the sidebar
130
+ * Superadmin Documentation Configuration
131
+ * Controls admin documentation at /superadmin/docs routes
133
132
  */
134
- plugins: {
135
- /** Show/hide plugin documentation category */
133
+ superadmin: {
134
+ /** Show/hide superadmin documentation */
136
135
  enabled: true,
137
- /** Expand plugins category by default on page load */
138
- open: false,
139
- /** Custom label displayed in sidebar for plugins category */
140
- label: "Plugins",
136
+ /** Custom label displayed in sidebar */
137
+ label: "Admin Docs",
141
138
  },
142
-
143
- /**
144
- * Core Documentation Configuration
145
- * Controls how core framework documentation appears in the sidebar
146
- */
147
- core: {
148
- /** Show/hide core documentation category */
149
- enabled: true,
150
- /** Expand core category by default on page load */
151
- open: true,
152
- /** Custom label displayed in sidebar for core category */
153
- label: "Core",
154
- },
155
-
156
- /**
157
- * Additional environment-based check for plugin docs in production
158
- * Plugin docs will only show if BOTH conditions are met:
159
- * 1. plugins.enabled is true
160
- * 2. Either in development OR showPluginsDocsInProd is true
161
- *
162
- * @deprecated Prefer using plugins.enabled for simpler control
163
- * By default plugins documentation is not available in prod environments
164
- */
165
- showPluginsDocsInProd: false,
166
139
  },
167
140
 
168
141
  // =============================================================================
@@ -0,0 +1,74 @@
1
+ # Configuration Guide
2
+
3
+ This guide covers the configuration options available to administrators for setting up and customizing your NextSpark application.
4
+
5
+ ## Environment Variables
6
+
7
+ ### Required Variables
8
+
9
+ ```bash
10
+ # Database
11
+ DATABASE_URL="postgresql://user:password@localhost:5432/dbname"
12
+
13
+ # Authentication
14
+ BETTER_AUTH_SECRET="your-secret-key"
15
+
16
+ # Application
17
+ NEXT_PUBLIC_APP_URL="https://your-domain.com"
18
+ ```
19
+
20
+ ### Optional Variables
21
+
22
+ ```bash
23
+ # Email (for notifications)
24
+ SMTP_HOST="smtp.example.com"
25
+ SMTP_PORT="587"
26
+ SMTP_USER="user@example.com"
27
+ SMTP_PASSWORD="password"
28
+
29
+ # Billing (Stripe)
30
+ STRIPE_SECRET_KEY="sk_..."
31
+ STRIPE_WEBHOOK_SECRET="whsec_..."
32
+ NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_..."
33
+ ```
34
+
35
+ ## Configuration Files
36
+
37
+ ### app.config.ts
38
+
39
+ The main application configuration file located at `config/app.config.ts`:
40
+
41
+ ```typescript
42
+ export const APP_CONFIG_OVERRIDES = {
43
+ app: {
44
+ name: 'Your App Name',
45
+ version: '1.0.0',
46
+ },
47
+ teams: {
48
+ mode: 'multi-tenant', // or 'single-tenant', 'single-user'
49
+ },
50
+ i18n: {
51
+ supportedLocales: ['en', 'es'],
52
+ defaultLocale: 'en',
53
+ },
54
+ }
55
+ ```
56
+
57
+ ### permissions.config.ts
58
+
59
+ Define roles and permissions in `config/permissions.config.ts`:
60
+
61
+ ```typescript
62
+ export const PERMISSIONS_CONFIG = {
63
+ roles: {
64
+ additionalRoles: ['editor'],
65
+ hierarchy: { editor: 5 },
66
+ },
67
+ // ... permissions
68
+ }
69
+ ```
70
+
71
+ ## Next Steps
72
+
73
+ - [Deployment Guide](./02-deployment.md)
74
+ - [User Management](../02-management/01-users.md)
@@ -0,0 +1,77 @@
1
+ # Deployment Guide
2
+
3
+ This guide covers deploying your NextSpark application to production environments.
4
+
5
+ ## Prerequisites
6
+
7
+ - Node.js 18+ installed
8
+ - PostgreSQL database provisioned
9
+ - Domain configured with SSL
10
+
11
+ ## Vercel Deployment
12
+
13
+ ### 1. Connect Repository
14
+
15
+ 1. Go to [Vercel Dashboard](https://vercel.com/dashboard)
16
+ 2. Click "Add New Project"
17
+ 3. Import your Git repository
18
+
19
+ ### 2. Configure Environment Variables
20
+
21
+ Add all required environment variables in Vercel project settings:
22
+
23
+ ```
24
+ DATABASE_URL=postgresql://...
25
+ BETTER_AUTH_SECRET=...
26
+ NEXT_PUBLIC_APP_URL=https://your-domain.com
27
+ ```
28
+
29
+ ### 3. Deploy
30
+
31
+ Vercel will automatically build and deploy your application.
32
+
33
+ ## Docker Deployment
34
+
35
+ ### Build Image
36
+
37
+ ```bash
38
+ docker build -t nextspark-app .
39
+ ```
40
+
41
+ ### Run Container
42
+
43
+ ```bash
44
+ docker run -p 3000:3000 \
45
+ -e DATABASE_URL="postgresql://..." \
46
+ -e BETTER_AUTH_SECRET="..." \
47
+ nextspark-app
48
+ ```
49
+
50
+ ## Database Migrations
51
+
52
+ Run migrations before starting the application:
53
+
54
+ ```bash
55
+ pnpm db:migrate
56
+ ```
57
+
58
+ ## Health Checks
59
+
60
+ The application exposes health check endpoints:
61
+
62
+ - `/api/health` - Basic health check
63
+ - `/api/health/db` - Database connectivity check
64
+
65
+ ## Monitoring
66
+
67
+ Configure monitoring and alerting for:
68
+
69
+ - Application errors
70
+ - Database connection issues
71
+ - API response times
72
+ - Memory and CPU usage
73
+
74
+ ## Next Steps
75
+
76
+ - [Configuration Guide](./01-configuration.md)
77
+ - [User Management](../02-management/01-users.md)
@@ -0,0 +1,78 @@
1
+ # User Management
2
+
3
+ This guide covers managing users and teams in your NextSpark application.
4
+
5
+ ## User Roles
6
+
7
+ ### System Roles
8
+
9
+ | Role | Description |
10
+ |------|-------------|
11
+ | `superadmin` | Full system access, can manage all users and teams |
12
+ | `developer` | Access to developer tools and debugging features |
13
+ | `member` | Standard user role |
14
+
15
+ ### Team Roles
16
+
17
+ | Role | Description |
18
+ |------|-------------|
19
+ | `owner` | Team creator, full team management |
20
+ | `admin` | Can manage team settings and members |
21
+ | `member` | Standard team member |
22
+ | `viewer` | Read-only access |
23
+
24
+ ## Managing Users
25
+
26
+ ### View All Users
27
+
28
+ Access the user management panel at `/superadmin/users`:
29
+
30
+ 1. Navigate to Superadmin Dashboard
31
+ 2. Click on "Users" in the sidebar
32
+ 3. Use filters to search by name, email, or role
33
+
34
+ ### Update User Role
35
+
36
+ 1. Find the user in the list
37
+ 2. Click on the user row to open details
38
+ 3. Select new role from dropdown
39
+ 4. Click "Save Changes"
40
+
41
+ ### Deactivate User
42
+
43
+ 1. Open user details
44
+ 2. Click "Deactivate Account"
45
+ 3. Confirm the action
46
+
47
+ ## Managing Teams
48
+
49
+ ### View All Teams
50
+
51
+ Access team management at `/superadmin/teams`:
52
+
53
+ - See all teams across the platform
54
+ - View team member counts
55
+ - Monitor team activity
56
+
57
+ ### Team Impersonation
58
+
59
+ Superadmins can view the application as any team member:
60
+
61
+ 1. Navigate to team details
62
+ 2. Click "Impersonate" on a team member
63
+ 3. You'll see the app from their perspective
64
+ 4. Click "Exit Impersonation" when done
65
+
66
+ ## Audit Logs
67
+
68
+ All administrative actions are logged. View logs at `/superadmin/logs`:
69
+
70
+ - User creation/deletion
71
+ - Role changes
72
+ - Team modifications
73
+ - Login attempts
74
+
75
+ ## Next Steps
76
+
77
+ - [Configuration Guide](../01-setup/01-configuration.md)
78
+ - [Deployment Guide](../01-setup/02-deployment.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextsparkjs/theme-default",
3
- "version": "0.1.0-beta.28",
3
+ "version": "0.1.0-beta.29",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./config/theme.config.ts",
@@ -23,4 +23,4 @@
23
23
  "type": "theme",
24
24
  "name": "default"
25
25
  }
26
- }
26
+ }
@@ -2,17 +2,17 @@
2
2
  * Cypress Configuration for Default Theme
3
3
  *
4
4
  * This config works in both monorepo and npm mode.
5
- * Run with: NEXT_PUBLIC_ACTIVE_THEME=default pnpm cy:open
5
+ * Run with: pnpm cy:open or pnpm cy:run
6
+ *
7
+ * Filter by tags: pnpm cy:tags "@smoke" or pnpm cy:run --env grepTags="@smoke"
6
8
  */
7
9
 
8
10
  import { defineConfig } from 'cypress'
9
11
  import path from 'path'
10
12
  import fs from 'fs'
11
- import { fileURLToPath } from 'url'
12
13
 
13
- // ESM-compatible __dirname
14
- const __filename = fileURLToPath(import.meta.url)
15
- const __dirname = path.dirname(__filename)
14
+ // __dirname is available because ts-node processes this file as CommonJS
15
+ // (Next.js projects don't use "type": "module" in package.json)
16
16
 
17
17
  // Paths relative to this config file
18
18
  const themeRoot = path.resolve(__dirname, '..')
File without changes