@gv-sh/specgen-app 0.6.7 โ†’ 0.6.8

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.7-blue.svg)](https://github.com/gv-sh/specgen-app)
3
+ [![Version](https://img.shields.io/badge/version-0.6.8-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.7",
3
+ "version": "0.6.8",
4
4
  "description": "Complete SpecGen application with server, admin, and user interfaces",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -1,9 +1,9 @@
1
1
  #!/bin/bash
2
2
 
3
- # SpecGen Deploy Script - Port 8080 Production Deployment
3
+ # SpecGen Deploy Script - Port 80 Production Deployment
4
4
  set -e
5
5
 
6
- echo "๐Ÿš€ Deploying SpecGen to production on port 8080..."
6
+ echo "๐Ÿš€ Deploying SpecGen to production on port 80..."
7
7
 
8
8
  # Function to check if port is available
9
9
  check_port() {
@@ -20,11 +20,11 @@ echo "Stopping existing PM2 processes..."
20
20
  npx pm2 stop all 2>/dev/null || true
21
21
  npx pm2 delete all 2>/dev/null || true
22
22
 
23
- # Kill any processes on port 8080
24
- echo "Freeing port 8080..."
25
- if ! check_port 8080; then
26
- echo "Port 8080 is in use. Attempting to free it..."
27
- lsof -ti:8080 | xargs kill -9 2>/dev/null || true
23
+ # Kill any processes on port 80
24
+ echo "Freeing port 80..."
25
+ if ! check_port 80; then
26
+ echo "Port 80 is in use. Attempting to free it..."
27
+ lsof -ti:80 | xargs kill -9 2>/dev/null || true
28
28
  sleep 2
29
29
  fi
30
30
 
@@ -64,7 +64,7 @@ module.exports = {
64
64
  cwd: process.cwd(),
65
65
  env: {
66
66
  NODE_ENV: 'production',
67
- PORT: 8080
67
+ PORT: 80
68
68
  },
69
69
  instances: 1,
70
70
  exec_mode: 'fork',
@@ -83,8 +83,8 @@ EOF
83
83
  mkdir -p logs
84
84
 
85
85
  # Start with PM2
86
- echo "Starting SpecGen with PM2 on port 8080..."
87
- NODE_ENV=production PORT=8080 npx pm2 start ecosystem.config.js
86
+ echo "Starting SpecGen with PM2 on port 80..."
87
+ NODE_ENV=production PORT=80 npx pm2 start ecosystem.config.js
88
88
 
89
89
  # Wait for startup
90
90
  sleep 5
@@ -93,11 +93,11 @@ echo ""
93
93
  echo "โœ… SpecGen deployment completed!"
94
94
  echo ""
95
95
  echo "๐ŸŒ Access your application at:"
96
- echo " - Main page: http://$(curl -s ifconfig.me 2>/dev/null || echo 'your-server'):8080/"
97
- echo " - User app: http://$(curl -s ifconfig.me 2>/dev/null || echo 'your-server'):8080/app"
98
- echo " - Admin panel: http://$(curl -s ifconfig.me 2>/dev/null || echo 'your-server'):8080/admin"
99
- echo " - API docs: http://$(curl -s ifconfig.me 2>/dev/null || echo 'your-server'):8080/api-docs"
100
- echo " - Health check: http://$(curl -s ifconfig.me 2>/dev/null || echo 'your-server'):8080/api/health"
96
+ echo " - Main page: http://$(curl -s ifconfig.me 2>/dev/null || echo 'your-server'):80/"
97
+ echo " - User app: http://$(curl -s ifconfig.me 2>/dev/null || echo 'your-server'):80/app"
98
+ echo " - Admin panel: http://$(curl -s ifconfig.me 2>/dev/null || echo 'your-server'):80/admin"
99
+ echo " - API docs: http://$(curl -s ifconfig.me 2>/dev/null || echo 'your-server'):80/api-docs"
100
+ echo " - Health check: http://$(curl -s ifconfig.me 2>/dev/null || echo 'your-server'):80/api/health"
101
101
  echo ""
102
102
  echo "๐Ÿ“Š Check status with: npx pm2 status"
103
103
  echo "๐Ÿ“ View logs with: npx pm2 logs specgen"
package/scripts/deploy.sh CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/bin/bash
2
2
 
3
- # SpecGen Deploy Script - Self-Contained Deployment on Port 8080
3
+ # SpecGen Deploy Script - Self-Contained Deployment on Port 80
4
4
  set -e
5
5
 
6
6
  # Check for dry-run mode
@@ -10,7 +10,7 @@ if [ "$1" = "--dry-run" ] || [ "$1" = "-d" ]; then
10
10
  echo "๐Ÿงช DRY RUN MODE - Testing deployment locally"
11
11
  echo "๐Ÿ–ฅ๏ธ Platform: $(uname -s) $(uname -m)"
12
12
  else
13
- echo "๐Ÿš€ Deploying SpecGen to production on port 8080..."
13
+ echo "๐Ÿš€ Deploying SpecGen to production on port 80..."
14
14
  echo "๐Ÿ“ฆ This is a complete deployment - no separate setup needed!"
15
15
  fi
16
16
 
@@ -66,7 +66,7 @@ if [ "$DRY_RUN" = false ]; then
66
66
  rm -f ecosystem.config.js 2>/dev/null || true
67
67
 
68
68
  # Kill processes on all relevant ports
69
- for port in 8080 3000 3001 3002; do
69
+ for port in 80 3000 3001 3002; do
70
70
  if ! check_port $port; then
71
71
  echo "Killing processes on port $port..."
72
72
  lsof -ti:$port | xargs kill -9 2>/dev/null || true
@@ -117,7 +117,7 @@ if [ "$DRY_RUN" = true ]; then
117
117
  mkdir -p "$PROJECT_DIR/server"
118
118
  echo "OPENAI_API_KEY=sk-test1234567890abcdef" > "$PROJECT_DIR/server/.env"
119
119
  echo "NODE_ENV=production" >> "$PROJECT_DIR/server/.env"
120
- echo "PORT=8080" >> "$PROJECT_DIR/server/.env"
120
+ echo "PORT=80" >> "$PROJECT_DIR/server/.env"
121
121
  echo "HOST=$BIND_HOST" >> "$PROJECT_DIR/server/.env"
122
122
  elif [ ! -f "$PROJECT_DIR/server/.env" ] || grep -q "your_openai_api_key_here" "$PROJECT_DIR/server/.env" 2>/dev/null; then
123
123
  if [ "$CI" = "true" ]; then
@@ -125,7 +125,7 @@ elif [ ! -f "$PROJECT_DIR/server/.env" ] || grep -q "your_openai_api_key_here" "
125
125
  mkdir -p "$PROJECT_DIR/server"
126
126
  echo "OPENAI_API_KEY=sk-test1234" > "$PROJECT_DIR/server/.env"
127
127
  echo "NODE_ENV=production" >> "$PROJECT_DIR/server/.env"
128
- echo "PORT=8080" >> "$PROJECT_DIR/server/.env"
128
+ echo "PORT=80" >> "$PROJECT_DIR/server/.env"
129
129
  echo "HOST=$BIND_HOST" >> "$PROJECT_DIR/server/.env"
130
130
  else
131
131
  echo "โš ๏ธ OpenAI API key required for SpecGen to work."
@@ -140,7 +140,7 @@ elif [ ! -f "$PROJECT_DIR/server/.env" ] || grep -q "your_openai_api_key_here" "
140
140
  mkdir -p "$PROJECT_DIR/server"
141
141
  echo "OPENAI_API_KEY=$OPENAI_KEY" > "$PROJECT_DIR/server/.env"
142
142
  echo "NODE_ENV=production" >> "$PROJECT_DIR/server/.env"
143
- echo "PORT=8080" >> "$PROJECT_DIR/server/.env"
143
+ echo "PORT=80" >> "$PROJECT_DIR/server/.env"
144
144
  echo "HOST=$BIND_HOST" >> "$PROJECT_DIR/server/.env"
145
145
  echo "โœ… API key saved"
146
146
  fi
@@ -178,7 +178,7 @@ if [ ! -f "server/index.js" ]; then
178
178
  # Install unified server that binds to 0.0.0.0
179
179
  echo " ๐Ÿ”ง Installing unified server (binds to all interfaces)..."
180
180
  cat > server/index.js << 'EOF'
181
- // index.js - Unified server for port 8080 with public binding
181
+ // index.js - Unified server for port 80 with public binding
182
182
  /* global process */
183
183
  require('dotenv').config();
184
184
  const express = require('express');
@@ -188,7 +188,7 @@ const errorHandler = require('./middleware/errorHandler');
188
188
 
189
189
  // Initialize Express app
190
190
  const app = express();
191
- const PORT = process.env.PORT || 8080;
191
+ const PORT = process.env.PORT || 80;
192
192
  const HOST = process.env.HOST || '0.0.0.0'; // Bind to all interfaces by default
193
193
 
194
194
  // Middleware
@@ -371,7 +371,7 @@ if [ "$DRY_RUN" = true ]; then
371
371
  cd "$PROJECT_DIR"
372
372
  cp server/.env .env 2>/dev/null || true
373
373
 
374
- TEST_PORT=8080
374
+ TEST_PORT=80
375
375
  if ! check_port $TEST_PORT; then
376
376
  TEST_PORT=8081
377
377
  fi
@@ -407,7 +407,7 @@ module.exports = {
407
407
  cwd: '$PROJECT_DIR',
408
408
  env: {
409
409
  NODE_ENV: 'production',
410
- PORT: 8080,
410
+ PORT: 80,
411
411
  HOST: '$BIND_HOST'
412
412
  },
413
413
  instances: 1,
@@ -425,12 +425,12 @@ EOF
425
425
  mkdir -p logs
426
426
  cp server/.env .env 2>/dev/null || true
427
427
 
428
- if ! check_port 8080; then
429
- lsof -ti:8080 | xargs kill -9 2>/dev/null || true
428
+ if ! check_port 80; then
429
+ lsof -ti:80 | xargs kill -9 2>/dev/null || true
430
430
  sleep 2
431
431
  fi
432
432
 
433
- NODE_ENV=production PORT=8080 HOST=$BIND_HOST $PM2_CMD start ecosystem.config.js
433
+ NODE_ENV=production PORT=80 HOST=$BIND_HOST $PM2_CMD start ecosystem.config.js
434
434
 
435
435
  sleep 5
436
436
 
@@ -441,9 +441,9 @@ EOF
441
441
  echo "๐ŸŽ‰ SpecGen deployment completed!"
442
442
  echo ""
443
443
  echo "๐ŸŒ Access your application at:"
444
- echo " - Main page: http://$PUBLIC_IP:8080/"
445
- echo " - User app: http://$PUBLIC_IP:8080/app/"
446
- echo " - Admin panel: http://$PUBLIC_IP:8080/admin/"
444
+ echo " - Main page: http://$PUBLIC_IP:80/"
445
+ echo " - User app: http://$PUBLIC_IP:80/app/"
446
+ echo " - Admin panel: http://$PUBLIC_IP:80/admin/"
447
447
  echo ""
448
448
  echo "๐Ÿ”ง Binding: Server is bound to $BIND_HOST (${BIND_HOST:+publicly accessible})"
449
449
  echo "๐Ÿ“Š Management: npx pm2 status | npx pm2 logs specgen"
@@ -1,9 +1,9 @@
1
1
  #!/bin/bash
2
2
 
3
- # SpecGen Production Script - Port 8080 Low Memory Version
3
+ # SpecGen Production Script - Port 80 Low Memory Version
4
4
  set -e
5
5
 
6
- echo "๐Ÿš€ Starting SpecGen in production mode on port 8080 (Low Memory)..."
6
+ echo "๐Ÿš€ Starting SpecGen in production mode on port 80 (Low Memory)..."
7
7
 
8
8
  # Function to check if port is available
9
9
  check_port() {
@@ -94,13 +94,13 @@ if [ ! -d "admin/build" ] || [ ! -d "user/build" ]; then
94
94
  fi
95
95
  fi
96
96
 
97
- # Update server .env to use port 8080
97
+ # Update server .env to use port 80
98
98
  if [ -f "server/.env" ]; then
99
- # Update or add PORT=8080 to .env
99
+ # Update or add PORT=80 to .env
100
100
  if grep -q "^PORT=" server/.env; then
101
- sed -i.bak "s/^PORT=.*/PORT=8080/" server/.env
101
+ sed -i.bak "s/^PORT=.*/PORT=80/" server/.env
102
102
  else
103
- echo "PORT=8080" >> server/.env
103
+ echo "PORT=80" >> server/.env
104
104
  fi
105
105
  rm -f server/.env.bak
106
106
  fi
@@ -109,21 +109,21 @@ fi
109
109
  cat > server/.env.production << EOF
110
110
  $(cat server/.env)
111
111
  NODE_ENV=production
112
- PORT=8080
112
+ PORT=80
113
113
  EOF
114
114
 
115
- # Kill existing processes on port 8080 if needed
116
- echo "Checking port 8080..."
117
- if ! check_port 8080; then
118
- echo "Port 8080 is in use. Attempting to free it..."
119
- lsof -ti:8080 | xargs kill -9 2>/dev/null || true
115
+ # Kill existing processes on port 80 if needed
116
+ echo "Checking port 80..."
117
+ if ! check_port 80; then
118
+ echo "Port 80 is in use. Attempting to free it..."
119
+ lsof -ti:80 | xargs kill -9 2>/dev/null || true
120
120
  sleep 2
121
121
  fi
122
122
 
123
123
  # Start production server
124
- echo "Starting production server on port 8080..."
124
+ echo "Starting production server on port 80..."
125
125
  if [ "$CI" = "true" ]; then
126
126
  echo "CI mode detected - skipping server start"
127
127
  else
128
- cd server && NODE_ENV=production PORT=8080 npm start
128
+ cd server && NODE_ENV=production PORT=80 npm start
129
129
  fi
@@ -1,9 +1,9 @@
1
1
  #!/bin/bash
2
2
 
3
- # SpecGen Production Script - Low Memory, Port 8080 with Cleanup
3
+ # SpecGen Production Script - Low Memory, Port 80 with Cleanup
4
4
  set -e
5
5
 
6
- echo "๐Ÿš€ Starting SpecGen in production mode on port 8080..."
6
+ echo "๐Ÿš€ Starting SpecGen in production mode on port 80..."
7
7
  echo "๐Ÿงน Cleaning up existing processes..."
8
8
 
9
9
  # Function to check if port is available
@@ -27,7 +27,7 @@ npx pm2 delete all 2>/dev/null || true
27
27
 
28
28
  # Kill processes on ports we'll use
29
29
  echo "Freeing ports..."
30
- for port in 8080 3000 3001 3002; do
30
+ for port in 80 3000 3001 3002; do
31
31
  if ! check_port $port; then
32
32
  echo "Port $port is in use. Attempting to free it..."
33
33
  lsof -ti:$port | xargs kill -9 2>/dev/null || true
@@ -38,8 +38,8 @@ done
38
38
  # Stop nginx if it might interfere
39
39
  if command -v nginx &> /dev/null && systemctl is-active --quiet nginx 2>/dev/null; then
40
40
  echo "Nginx is running, checking for conflicts..."
41
- if nginx -T 2>/dev/null | grep -q ":8080"; then
42
- echo "โš ๏ธ Nginx is configured to use port 8080. You may need to reconfigure nginx."
41
+ if nginx -T 2>/dev/null | grep -q ":80"; then
42
+ echo "โš ๏ธ Nginx is configured to use port 80. You may need to reconfigure nginx."
43
43
  fi
44
44
  fi
45
45
 
@@ -138,13 +138,13 @@ fi
138
138
  # CONFIGURE ENVIRONMENT
139
139
  # ========================================
140
140
 
141
- # Update server .env to use port 8080
141
+ # Update server .env to use port 80
142
142
  if [ -f "server/.env" ]; then
143
- # Update or add PORT=8080 to .env
143
+ # Update or add PORT=80 to .env
144
144
  if grep -q "^PORT=" server/.env; then
145
- sed -i.bak "s/^PORT=.*/PORT=8080/" server/.env
145
+ sed -i.bak "s/^PORT=.*/PORT=80/" server/.env
146
146
  else
147
- echo "PORT=8080" >> server/.env
147
+ echo "PORT=80" >> server/.env
148
148
  fi
149
149
  rm -f server/.env.bak
150
150
  fi
@@ -153,7 +153,7 @@ fi
153
153
  cat > server/.env.production << EOF
154
154
  $(cat server/.env)
155
155
  NODE_ENV=production
156
- PORT=8080
156
+ PORT=80
157
157
  EOF
158
158
 
159
159
  # Create logs directory
@@ -164,17 +164,17 @@ mkdir -p logs
164
164
  # ========================================
165
165
 
166
166
  # Final port check
167
- echo "Final check for port 8080..."
168
- if ! check_port 8080; then
169
- echo "Port 8080 is still in use after cleanup. Force killing..."
170
- lsof -ti:8080 | xargs kill -9 2>/dev/null || true
167
+ echo "Final check for port 80..."
168
+ if ! check_port 80; then
169
+ echo "Port 80 is still in use after cleanup. Force killing..."
170
+ lsof -ti:80 | xargs kill -9 2>/dev/null || true
171
171
  sleep 2
172
172
  fi
173
173
 
174
174
  # Start production server
175
- echo "Starting production server on port 8080..."
175
+ echo "Starting production server on port 80..."
176
176
  if [ "$CI" = "true" ]; then
177
177
  echo "CI mode detected - skipping server start"
178
178
  else
179
- cd server && NODE_ENV=production PORT=8080 npm start
179
+ cd server && NODE_ENV=production PORT=80 npm start
180
180
  fi
package/scripts/setup.sh CHANGED
@@ -45,7 +45,7 @@ rm -rf ~/.pm2/logs/* 2>/dev/null || true
45
45
 
46
46
  # 2. Kill processes on ports we'll use
47
47
  echo "Freeing up ports..."
48
- for port in 8080 3000 3001 3002; do
48
+ for port in 80 3000 3001 3002; do
49
49
  if lsof -Pi :$port -sTCP:LISTEN -t >/dev/null 2>&1; then
50
50
  echo "Killing processes on port $port..."
51
51
  lsof -ti:$port | xargs kill -9 2>/dev/null || true
@@ -163,7 +163,7 @@ done
163
163
 
164
164
  echo "๐Ÿ”ง Setting up environment files..."
165
165
 
166
- # Server .env (default to port 8080)
166
+ # Server .env (default to port 80)
167
167
  if [ ! -f server/.env ] || [ "$CI" = "true" ]; then
168
168
  # If in CI mode, use a dummy key
169
169
  if [ "$CI" = "true" ]; then
@@ -173,7 +173,7 @@ if [ ! -f server/.env ] || [ "$CI" = "true" ]; then
173
173
  cat > server/.env << EOF
174
174
  OPENAI_API_KEY=sk-test1234
175
175
  NODE_ENV=test
176
- PORT=8080
176
+ PORT=80
177
177
  EOF
178
178
  echo "Created test .env file for CI environment"
179
179
  fi
@@ -196,7 +196,7 @@ EOF
196
196
  # OpenAI API key
197
197
  OPENAI_API_KEY=$OPENAI_KEY
198
198
  NODE_ENV=development
199
- PORT=8080
199
+ PORT=80
200
200
  EOF
201
201
 
202
202
  if [ "$KEY_PROVIDED" = true ]; then
@@ -210,7 +210,7 @@ fi
210
210
  # Admin .env.development
211
211
  if [ -d admin ]; then
212
212
  cat > admin/.env.development << 'EOF'
213
- REACT_APP_API_URL=http://localhost:8080
213
+ REACT_APP_API_URL=http://localhost:80
214
214
  PORT=3001
215
215
  SKIP_PREFLIGHT_CHECK=true
216
216
  GENERATE_SOURCEMAP=false
@@ -220,7 +220,7 @@ fi
220
220
  # User .env.development
221
221
  if [ -d user ]; then
222
222
  cat > user/.env.development << 'EOF'
223
- REACT_APP_API_URL=http://localhost:8080
223
+ REACT_APP_API_URL=http://localhost:80
224
224
  PORT=3002
225
225
  SKIP_PREFLIGHT_CHECK=true
226
226
  GENERATE_SOURCEMAP=false
@@ -239,25 +239,25 @@ echo " - Nginx specgen configurations"
239
239
  echo " - Systemd services"
240
240
  echo " - Docker containers"
241
241
  echo " - Old project files"
242
- echo " - Freed ports: 8080, 3000, 3001, 3002"
242
+ echo " - Freed ports: 80, 3000, 3001, 3002"
243
243
  echo ""
244
244
  echo "Next steps:"
245
245
  if [ "$KEY_PROVIDED" = false ]; then
246
246
  echo "1. Add your OpenAI API key to server/.env"
247
247
  echo "2. Run 'npm run dev' to start all services"
248
- echo "3. Or run 'npm run production' for production mode on port 8080"
248
+ echo "3. Or run 'npm run production' for production mode on port 80"
249
249
  else
250
250
  echo "1. Run 'npm run dev' to start all services"
251
- echo "2. Or run 'npm run production' for production mode on port 8080"
251
+ echo "2. Or run 'npm run production' for production mode on port 80"
252
252
  fi
253
253
  echo ""
254
254
  echo "Access URLs:"
255
- echo " ๐ŸŒ Production: http://localhost:8080 (main app)"
256
- echo " ๐Ÿ“ฑ Production User: http://localhost:8080/app"
257
- echo " โš™๏ธ Production Admin: http://localhost:8080/admin"
258
- echo " ๐Ÿ“š API Docs: http://localhost:8080/api-docs"
255
+ echo " ๐ŸŒ Production: http://localhost:80 (main app)"
256
+ echo " ๐Ÿ“ฑ Production User: http://localhost:80/app"
257
+ echo " โš™๏ธ Production Admin: http://localhost:80/admin"
258
+ echo " ๐Ÿ“š API Docs: http://localhost:80/api-docs"
259
259
  echo ""
260
260
  echo "Development URLs:"
261
261
  echo " ๐ŸŒ User Interface: http://localhost:3002"
262
262
  echo " โš™๏ธ Admin Interface: http://localhost:3001"
263
- echo " ๐Ÿ”ง API: http://localhost:8080"
263
+ echo " ๐Ÿ”ง API: http://localhost:80"