realtimex-crm 0.4.1 → 0.5.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "realtimex-crm",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "RealTimeX CRM - A full-featured CRM built with React, shadcn-admin-kit, and Supabase. Fork of Atomic CRM with RealTimeX App SDK integration.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -66,6 +66,7 @@
66
66
  "registry:build": "npx shadcn build",
67
67
  "registry:gen": "node ./scripts/generate-registry.mjs",
68
68
  "setup:gen": "cat supabase/migrations/*.sql > public/setup.sql && echo 'Generated public/setup.sql from migrations'",
69
+ "db:migrate": "node ./scripts/auto-migrate.mjs",
69
70
  "ghpages:deploy": "node ./scripts/ghpages-deploy.mjs",
70
71
  "supabase:remote:init": "node ./scripts/supabase-remote-init.mjs",
71
72
  "prepare": "husky"
@@ -61,17 +61,65 @@ export function DatabaseSetupGuide({
61
61
  </div>
62
62
  </div>
63
63
 
64
- {/* Option 1: Direct SQL File */}
64
+ {/* Option 1: Automatic Migration */}
65
65
  <div className="space-y-3">
66
66
  <div className="flex items-center gap-2">
67
67
  <div className="flex items-center justify-center w-6 h-6 rounded-full bg-primary text-primary-foreground text-sm font-bold">
68
68
  1
69
69
  </div>
70
- <h3 className="font-semibold">Quick Setup (Recommended)</h3>
70
+ <h3 className="font-semibold">Automatic Migration (Recommended)</h3>
71
71
  </div>
72
72
  <div className="ml-8 space-y-3">
73
73
  <p className="text-sm text-muted-foreground">
74
- Download and run the combined migration file:
74
+ Run the automated migration script from your terminal:
75
+ </p>
76
+
77
+ <div className="space-y-3">
78
+ <div>
79
+ <p className="text-sm text-muted-foreground mb-2 font-semibold">
80
+ If you used the CLI to create your project:
81
+ </p>
82
+ <pre className="bg-muted p-3 rounded text-sm overflow-x-auto">
83
+ npm run db:migrate
84
+ </pre>
85
+ </div>
86
+
87
+ <div>
88
+ <p className="text-sm text-muted-foreground mb-2 font-semibold">
89
+ Or clone the repository first:
90
+ </p>
91
+ <pre className="bg-muted p-3 rounded text-sm overflow-x-auto">
92
+ git clone https://github.com/therealtimex/realtimex-crm.git{"\n"}
93
+ cd realtimex-crm{"\n"}
94
+ npm install{"\n"}
95
+ npm run db:migrate
96
+ </pre>
97
+ </div>
98
+
99
+ <div className="text-sm text-muted-foreground space-y-2">
100
+ <p>The script will:</p>
101
+ <ul className="list-disc list-inside ml-2 space-y-1">
102
+ <li>Install Supabase CLI if needed</li>
103
+ <li>Link your project using Project ID and Database Password</li>
104
+ <li>Apply all migrations automatically</li>
105
+ <li>Take about 5-10 seconds to complete</li>
106
+ </ul>
107
+ </div>
108
+ </div>
109
+ </div>
110
+ </div>
111
+
112
+ {/* Option 2: SQL Editor */}
113
+ <div className="space-y-3">
114
+ <div className="flex items-center gap-2">
115
+ <div className="flex items-center justify-center w-6 h-6 rounded-full bg-primary text-primary-foreground text-sm font-bold">
116
+ 2
117
+ </div>
118
+ <h3 className="font-semibold">Manual SQL Editor</h3>
119
+ </div>
120
+ <div className="ml-8 space-y-3">
121
+ <p className="text-sm text-muted-foreground">
122
+ Copy and paste SQL directly into Supabase:
75
123
  </p>
76
124
 
77
125
  <ol className="list-decimal list-inside space-y-2 text-sm text-muted-foreground">
@@ -82,7 +130,7 @@ export function DatabaseSetupGuide({
82
130
  target="_blank"
83
131
  rel="noopener noreferrer"
84
132
  className="text-primary hover:underline inline-flex items-center gap-1"
85
- download
133
+ download="setup.sql"
86
134
  >
87
135
  setup.sql
88
136
  <ExternalLink className="h-3 w-3" />
@@ -100,15 +148,9 @@ export function DatabaseSetupGuide({
100
148
  <ExternalLink className="h-3 w-3" />
101
149
  </a>
102
150
  </li>
103
- <li>
104
- Copy the entire contents of setup.sql and paste into the SQL Editor
105
- </li>
106
- <li>
107
- Click "Run" to execute all migrations at once
108
- </li>
109
- <li>
110
- Reload this page after completion
111
- </li>
151
+ <li>Copy all contents from setup.sql and paste into the editor</li>
152
+ <li>Click "Run" to execute</li>
153
+ <li>Reload this page after completion</li>
112
154
  </ol>
113
155
 
114
156
  {projectRef && (
@@ -126,13 +168,13 @@ export function DatabaseSetupGuide({
126
168
  </div>
127
169
  </div>
128
170
 
129
- {/* Option 2: Supabase CLI */}
171
+ {/* Option 3: Supabase CLI Manual */}
130
172
  <div className="space-y-3">
131
173
  <div className="flex items-center gap-2">
132
174
  <div className="flex items-center justify-center w-6 h-6 rounded-full bg-primary text-primary-foreground text-sm font-bold">
133
- 2
175
+ 3
134
176
  </div>
135
- <h3 className="font-semibold">Using Supabase CLI</h3>
177
+ <h3 className="font-semibold">Advanced: Manual CLI Setup</h3>
136
178
  </div>
137
179
  <div className="ml-8 space-y-3">
138
180
  <div>
@@ -180,53 +222,6 @@ export function DatabaseSetupGuide({
180
222
  </div>
181
223
  </div>
182
224
 
183
- {/* Option 3: Individual Migrations */}
184
- <div className="space-y-3">
185
- <div className="flex items-center gap-2">
186
- <div className="flex items-center justify-center w-6 h-6 rounded-full bg-primary text-primary-foreground text-sm font-bold">
187
- 3
188
- </div>
189
- <h3 className="font-semibold">Advanced: Run Individual Migrations</h3>
190
- </div>
191
- <div className="ml-8 space-y-3">
192
- <p className="text-sm text-muted-foreground">
193
- For advanced users who want to review each migration:
194
- </p>
195
-
196
- <ol className="list-decimal list-inside space-y-2 text-sm text-muted-foreground">
197
- <li>
198
- Browse migrations at{" "}
199
- <a
200
- href="https://github.com/therealtimex/realtimex-crm/tree/main/supabase/migrations"
201
- target="_blank"
202
- rel="noopener noreferrer"
203
- className="text-primary hover:underline inline-flex items-center gap-1"
204
- >
205
- GitHub
206
- <ExternalLink className="h-3 w-3" />
207
- </a>
208
- </li>
209
- <li>
210
- Open your{" "}
211
- <a
212
- href={`https://supabase.com/dashboard/project/${projectRef}/sql/new`}
213
- target="_blank"
214
- rel="noopener noreferrer"
215
- className="text-primary hover:underline inline-flex items-center gap-1"
216
- >
217
- Supabase SQL Editor
218
- <ExternalLink className="h-3 w-3" />
219
- </a>
220
- </li>
221
- <li>
222
- Run each migration file in chronological order (by date in filename)
223
- </li>
224
- <li>
225
- Reload this page after all migrations are complete
226
- </li>
227
- </ol>
228
- </div>
229
- </div>
230
225
 
231
226
  {/* Verification */}
232
227
  <div className="space-y-3 pt-4 border-t">