@gv-sh/specgen-app 0.14.0 → 0.15.1
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 +4 -4
- package/scripts/deploy-ec2.sh +28 -12
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
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@gv-sh/specgen-app",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.15.1",
|
4
4
|
"description": "Complete SpecGen application with server, admin, and user interfaces",
|
5
5
|
"main": "index.js",
|
6
6
|
"bin": {
|
@@ -16,9 +16,9 @@
|
|
16
16
|
"postinstall": "chmod +x bin/cli.js"
|
17
17
|
},
|
18
18
|
"dependencies": {
|
19
|
-
"@gv-sh/specgen-server": "0.10.
|
20
|
-
"@gv-sh/specgen-admin": "0.10.
|
21
|
-
"@gv-sh/specgen-user": "0.
|
19
|
+
"@gv-sh/specgen-server": "0.10.3",
|
20
|
+
"@gv-sh/specgen-admin": "0.10.3",
|
21
|
+
"@gv-sh/specgen-user": "0.14.1"
|
22
22
|
},
|
23
23
|
"devDependencies": {
|
24
24
|
"concurrently": "^8.2.2"
|
package/scripts/deploy-ec2.sh
CHANGED
@@ -11,6 +11,18 @@ EC2_KEY="debanshu.pem"
|
|
11
11
|
REPO_URL="https://github.com/gv-sh/specgen-app.git"
|
12
12
|
APP_DIR="/home/ubuntu/specgen-app"
|
13
13
|
|
14
|
+
# Prompt for public IP address
|
15
|
+
echo "📡 Enter the public IP address or domain for your EC2 instance:"
|
16
|
+
echo " (e.g., 52.66.251.12 or your-domain.com)"
|
17
|
+
read -p "Public IP/Domain: " PUBLIC_IP
|
18
|
+
|
19
|
+
if [ -z "$PUBLIC_IP" ]; then
|
20
|
+
echo "❌ Public IP/Domain is required for proper frontend configuration!"
|
21
|
+
exit 1
|
22
|
+
fi
|
23
|
+
|
24
|
+
echo "✅ Using public address: $PUBLIC_IP"
|
25
|
+
|
14
26
|
echo "🚀 SpecGen EC2 Remote Deployment Starting..."
|
15
27
|
echo "📡 Target: $EC2_HOST"
|
16
28
|
|
@@ -52,17 +64,21 @@ echo "🏗️ Building applications..."
|
|
52
64
|
run_on_ec2 "
|
53
65
|
cd '$APP_DIR'
|
54
66
|
|
55
|
-
#
|
56
|
-
echo 'Installing user interface build dependencies...'
|
57
|
-
cd user && npm install --include=dev && cd ..
|
58
|
-
|
59
|
-
# Build admin interface with correct public URL
|
67
|
+
# Build admin interface with correct public URL (admin appends /api to base URL)
|
60
68
|
echo 'Building admin interface...'
|
61
|
-
cd admin && PUBLIC_URL=/admin npm run build && cd ..
|
69
|
+
cd admin && PUBLIC_URL=/admin REACT_APP_API_URL='http://$PUBLIC_IP' npm run build && cd ..
|
62
70
|
|
63
|
-
# Build user interface with production API URL
|
71
|
+
# Build user interface with production API URL (user interface appends /api to base URL)
|
64
72
|
echo 'Building user interface...'
|
65
|
-
cd user
|
73
|
+
cd user
|
74
|
+
# Install devDependencies including cross-env
|
75
|
+
npm install --include=dev
|
76
|
+
# Temporarily modify package.json to use correct base URL for production
|
77
|
+
sed -i 's|\"build\": \"cross-env REACT_APP_API_URL=/api react-scripts build\"|\"build\": \"cross-env REACT_APP_API_URL=http://$PUBLIC_IP react-scripts build\"|' package.json
|
78
|
+
npm run build
|
79
|
+
# Restore original package.json
|
80
|
+
git checkout package.json 2>/dev/null || true
|
81
|
+
cd ..
|
66
82
|
|
67
83
|
# Copy builds to server directory where Express expects them
|
68
84
|
echo 'Copying builds to server directory...'
|
@@ -129,10 +145,10 @@ if [ "$HEALTH_CHECK" = "healthy" ]; then
|
|
129
145
|
echo "✅ Deployment successful!"
|
130
146
|
echo ""
|
131
147
|
echo "🌐 Access your application:"
|
132
|
-
echo " User Interface: http
|
133
|
-
echo " Admin Panel: http
|
134
|
-
echo " API Documentation: http
|
135
|
-
echo " Health Check: http
|
148
|
+
echo " User Interface: http://$PUBLIC_IP/"
|
149
|
+
echo " Admin Panel: http://$PUBLIC_IP/admin"
|
150
|
+
echo " API Documentation: http://$PUBLIC_IP/api-docs"
|
151
|
+
echo " Health Check: http://$PUBLIC_IP/api/health"
|
136
152
|
echo ""
|
137
153
|
echo "📊 Server status:"
|
138
154
|
run_on_ec2 "cd '$APP_DIR/server' && npx pm2 status"
|