@gv-sh/specgen-app 0.13.3 → 0.14.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/README.md +1 -1
- package/package.json +1 -1
- package/scripts/deploy-ec2.sh +19 -6
package/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# SpecGen App - Complete Platform
|
2
2
|
|
3
|
-
[](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 80 deployment with low memory usage.**
|
6
6
|
|
package/package.json
CHANGED
package/scripts/deploy-ec2.sh
CHANGED
@@ -46,24 +46,31 @@ echo "📦 Setting up dependencies..."
|
|
46
46
|
run_on_ec2 "
|
47
47
|
cd '$APP_DIR'
|
48
48
|
npm run setup
|
49
|
-
|
50
|
-
# Install cross-env in user directory
|
51
|
-
cd user && npm install cross-env --save-dev && cd ..
|
52
49
|
"
|
53
50
|
|
54
51
|
echo "🏗️ Building applications..."
|
55
52
|
run_on_ec2 "
|
56
53
|
cd '$APP_DIR'
|
57
54
|
|
55
|
+
# Install devDependencies for user interface (needed for UI components)
|
56
|
+
echo 'Installing user interface build dependencies...'
|
57
|
+
cd user && npm install --include=dev && cd ..
|
58
|
+
|
58
59
|
# Build admin interface with correct public URL
|
59
60
|
echo 'Building admin interface...'
|
60
61
|
cd admin && PUBLIC_URL=/admin npm run build && cd ..
|
61
62
|
|
62
63
|
# Build user interface with production API URL
|
63
64
|
echo 'Building user interface...'
|
64
|
-
cd user && cross-env REACT_APP_API_URL=/api npm run build && cd ..
|
65
|
+
cd user && npx cross-env REACT_APP_API_URL=/api npm run build && cd ..
|
66
|
+
|
67
|
+
# Copy builds to server directory where Express expects them
|
68
|
+
echo 'Copying builds to server directory...'
|
69
|
+
mkdir -p server/admin server/user
|
70
|
+
cp -r admin/build server/admin/
|
71
|
+
cp -r user/build server/user/
|
65
72
|
|
66
|
-
echo '✅ Builds completed'
|
73
|
+
echo '✅ Builds completed and copied to server'
|
67
74
|
"
|
68
75
|
|
69
76
|
echo "🔧 Configuring environment..."
|
@@ -103,7 +110,13 @@ EOF
|
|
103
110
|
echo "🚀 Starting application..."
|
104
111
|
run_on_ec2 "
|
105
112
|
cd '$APP_DIR/server'
|
106
|
-
|
113
|
+
|
114
|
+
# Check if ecosystem.config.js exists in deploy directory, if not use index.js
|
115
|
+
if [ -f deploy/ecosystem.config.js ]; then
|
116
|
+
npx pm2 start deploy/ecosystem.config.js
|
117
|
+
else
|
118
|
+
npx pm2 start index.js --name specgen
|
119
|
+
fi
|
107
120
|
"
|
108
121
|
|
109
122
|
echo "⏳ Waiting for startup..."
|