@gv-sh/specgen-app 0.6.1 → 0.6.2

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # SpecGen App - Complete Platform
2
2
 
3
- [![Version](https://img.shields.io/badge/version-0.6.1-blue.svg)](https://github.com/gv-sh/specgen-app)
3
+ [![Version](https://img.shields.io/badge/version-0.6.2-blue.svg)](https://github.com/gv-sh/specgen-app)
4
4
 
5
5
  A unified deployment package for the SpecGen speculative fiction generator platform. **Optimized for port 8080 deployment with low memory usage.**
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gv-sh/specgen-app",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "Complete SpecGen application with server, admin, and user interfaces",
5
5
  "main": "index.js",
6
6
  "bin": {
package/scripts/deploy.sh CHANGED
@@ -130,7 +130,9 @@ if [ ! -d "admin/build" ]; then
130
130
 
131
131
  cd admin
132
132
  echo "engine-strict=false" > .npmrc
133
- npm install --no-fund --no-audit --production --maxsockets=2 --loglevel=warn
133
+ # Install ALL dependencies for build process
134
+ npm install --no-fund --no-audit --maxsockets=2 --loglevel=warn
135
+ # Build with proper environment variables (no cross-env needed on Linux)
134
136
  GENERATE_SOURCEMAP=false SKIP_PREFLIGHT_CHECK=true PUBLIC_URL=/admin npm run build
135
137
  cd ..
136
138
  fi
@@ -147,7 +149,9 @@ if [ ! -d "user/build" ]; then
147
149
 
148
150
  cd user
149
151
  echo "engine-strict=false" > .npmrc
150
- npm install --no-fund --no-audit --production --maxsockets=2 --loglevel=warn
152
+ # Install ALL dependencies for build process
153
+ npm install --no-fund --no-audit --maxsockets=2 --loglevel=warn
154
+ # Build with proper environment variables (no cross-env needed on Linux)
151
155
  GENERATE_SOURCEMAP=false SKIP_PREFLIGHT_CHECK=true REACT_APP_API_URL=/api PUBLIC_URL=/app npm run build
152
156
  cd ..
153
157
  fi
@@ -159,11 +163,13 @@ fi
159
163
  echo "✅ Verifying builds..."
160
164
  if [ ! -d "admin/build" ]; then
161
165
  echo "❌ Admin build failed"
166
+ ls -la admin/ || echo "Admin directory not found"
162
167
  exit 1
163
168
  fi
164
169
 
165
170
  if [ ! -d "user/build" ]; then
166
171
  echo "❌ User build failed"
172
+ ls -la user/ || echo "User directory not found"
167
173
  exit 1
168
174
  fi
169
175
 
@@ -172,6 +178,12 @@ echo " Admin build: $(ls -la admin/build/ | wc -l) files"
172
178
  echo " User build: $(ls -la user/build/ | wc -l) files"
173
179
  echo " Server: $(ls -la server/ | wc -l) files"
174
180
 
181
+ # Show some sample files to verify builds
182
+ echo "📄 Admin build files:"
183
+ ls admin/build/ | head -5
184
+ echo "📄 User build files:"
185
+ ls user/build/ | head -5
186
+
175
187
  # ========================================
176
188
  # PM2 DEPLOYMENT
177
189
  # ========================================
@@ -208,6 +220,9 @@ EOF
208
220
  # Create logs directory
209
221
  mkdir -p logs
210
222
 
223
+ # Copy .env to ensure PM2 picks it up
224
+ cp server/.env .env 2>/dev/null || true
225
+
211
226
  # Final port check
212
227
  if ! check_port 8080; then
213
228
  echo "Port 8080 occupied, force cleaning..."
@@ -240,23 +255,33 @@ if npx pm2 list | grep -q "online"; then
240
255
  fi
241
256
 
242
257
  # Test main page
243
- if curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/ | grep -q "200"; then
244
- echo " Main page: OK"
258
+ HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/ 2>/dev/null)
259
+ if [ "$HTTP_CODE" = "200" ]; then
260
+ echo "✅ Main page: OK (HTTP $HTTP_CODE)"
245
261
  else
246
- echo "⚠️ Main page: Check logs"
262
+ echo "⚠️ Main page: HTTP $HTTP_CODE (check if builds are served correctly)"
247
263
  fi
248
264
 
249
265
  # Test admin
250
- if curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/admin | grep -q "200"; then
251
- echo " Admin page: OK"
266
+ HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/admin 2>/dev/null)
267
+ if [ "$HTTP_CODE" = "200" ]; then
268
+ echo "✅ Admin page: OK (HTTP $HTTP_CODE)"
252
269
  else
253
- echo "⚠️ Admin page: Check logs"
270
+ echo "⚠️ Admin page: HTTP $HTTP_CODE"
271
+ fi
272
+
273
+ # Test user app
274
+ HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/app 2>/dev/null)
275
+ if [ "$HTTP_CODE" = "200" ]; then
276
+ echo "✅ User app: OK (HTTP $HTTP_CODE)"
277
+ else
278
+ echo "⚠️ User app: HTTP $HTTP_CODE"
254
279
  fi
255
280
 
256
281
  PUBLIC_IP=$(curl -s ifconfig.me 2>/dev/null || curl -s ipecho.net/plain 2>/dev/null || echo 'your-server')
257
282
 
258
283
  echo ""
259
- echo "🎉 SpecGen deployment completed successfully!"
284
+ echo "🎉 SpecGen deployment completed!"
260
285
  echo ""
261
286
  echo "🌐 Access your application at:"
262
287
  echo " - Main page: http://$PUBLIC_IP:8080/"
@@ -266,16 +291,23 @@ if npx pm2 list | grep -q "online"; then
266
291
  echo " - Health check: http://$PUBLIC_IP:8080/api/health"
267
292
  echo ""
268
293
  echo "📊 Management:"
269
- echo " npx pm2 status # Check status"
270
- echo " npx pm2 logs # View logs"
294
+ echo " npx pm2 status # Check status"
295
+ echo " npx pm2 logs specgen # View logs"
271
296
  echo " npx pm2 restart specgen # Restart"
272
297
  echo ""
298
+ echo "🔧 Troubleshooting:"
299
+ echo " curl http://localhost:8080/api/health # Test API"
300
+ echo " curl -I http://localhost:8080/ # Test main page"
301
+ echo " ls -la */build/ # Check builds"
302
+ echo ""
273
303
 
274
304
  else
275
305
  echo ""
276
306
  echo "❌ Deployment failed!"
277
307
  echo "📝 Check logs: npx pm2 logs specgen"
278
308
  echo "📊 Check status: npx pm2 status"
309
+ echo ""
310
+ echo "Recent logs:"
279
311
  npx pm2 logs specgen --lines 10
280
312
  exit 1
281
313
  fi