@gv-sh/specgen-app 0.3.0 → 0.3.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 +137 -6
- package/package.json +1 -1
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.
|
6
6
|
|
@@ -36,15 +36,129 @@ A unified deployment package for the SpecGen speculative fiction generator platf
|
|
36
36
|
- Admin Interface: http://localhost:3001
|
37
37
|
- API: http://localhost:3000
|
38
38
|
|
39
|
-
##
|
39
|
+
## Deployment Options
|
40
40
|
|
41
|
-
###
|
41
|
+
### Option 1: Quick NPM Deployment to Remote Server
|
42
|
+
|
43
|
+
If you have SSH access to a server (like an EC2 instance), this is the fastest way to deploy:
|
44
|
+
|
45
|
+
1. **Save your SSH key** to a file (e.g., `key.pem`) and set permissions:
|
46
|
+
```bash
|
47
|
+
chmod 400 key.pem
|
48
|
+
```
|
49
|
+
|
50
|
+
2. **SSH into your server**:
|
51
|
+
```bash
|
52
|
+
ssh -i "key.pem" ubuntu@your-server-ip
|
53
|
+
```
|
54
|
+
|
55
|
+
3. **Install Node.js 18 or higher**:
|
56
|
+
```bash
|
57
|
+
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
|
58
|
+
sudo apt-get install -y nodejs
|
59
|
+
```
|
60
|
+
|
61
|
+
4. **Install and run SpecGen**:
|
62
|
+
```bash
|
63
|
+
# Install globally
|
64
|
+
sudo npm install -g @gv-sh/specgen-app
|
65
|
+
|
66
|
+
# Create and enter project directory
|
67
|
+
mkdir specgen
|
68
|
+
cd specgen
|
69
|
+
|
70
|
+
# Run the setup
|
71
|
+
npx @gv-sh/specgen-app setup
|
72
|
+
|
73
|
+
# Start in production mode
|
74
|
+
npx @gv-sh/specgen-app production
|
75
|
+
```
|
76
|
+
|
77
|
+
5. **Keep the service running with PM2** (recommended):
|
78
|
+
```bash
|
79
|
+
sudo npm install -g pm2
|
80
|
+
pm2 start "npx @gv-sh/specgen-app production" --name "specgen"
|
81
|
+
pm2 startup
|
82
|
+
pm2 save
|
83
|
+
```
|
84
|
+
|
85
|
+
6. **Access your application**:
|
86
|
+
- User Interface: http://your-server-ip:3000
|
87
|
+
- Admin Interface: http://your-server-ip:3000/admin
|
88
|
+
|
89
|
+
### Option 2: NPM Package Deployment (Detailed)
|
90
|
+
|
91
|
+
#### Local Machine Deployment
|
92
|
+
|
93
|
+
1. **Install globally** (recommended for deployment):
|
94
|
+
```bash
|
95
|
+
npm install -g @gv-sh/specgen-app
|
96
|
+
```
|
97
|
+
|
98
|
+
2. **Create a project directory**:
|
99
|
+
```bash
|
100
|
+
mkdir specgen-project
|
101
|
+
cd specgen-project
|
102
|
+
```
|
103
|
+
|
104
|
+
3. **Initialize and setup**:
|
105
|
+
```bash
|
106
|
+
npx @gv-sh/specgen-app setup
|
107
|
+
```
|
108
|
+
During setup, you'll be prompted to enter your OpenAI API key.
|
109
|
+
|
110
|
+
4. **Start the application**:
|
111
|
+
- Development mode: `npx @gv-sh/specgen-app dev`
|
112
|
+
- Production mode: `npx @gv-sh/specgen-app production`
|
113
|
+
|
114
|
+
#### Remote Server Deployment
|
115
|
+
|
116
|
+
1. **SSH into your server**:
|
117
|
+
```bash
|
118
|
+
ssh -i "your-key.pem" username@your-server
|
119
|
+
```
|
120
|
+
|
121
|
+
2. **Install Node.js** (if not already installed):
|
122
|
+
```bash
|
123
|
+
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
|
124
|
+
sudo apt-get install -y nodejs
|
125
|
+
```
|
126
|
+
|
127
|
+
3. **Create a project directory**:
|
128
|
+
```bash
|
129
|
+
mkdir specgen
|
130
|
+
cd specgen
|
131
|
+
```
|
132
|
+
|
133
|
+
4. **Install SpecGen**:
|
134
|
+
```bash
|
135
|
+
npm install @gv-sh/specgen-app
|
136
|
+
```
|
137
|
+
|
138
|
+
5. **Setup the application**:
|
139
|
+
```bash
|
140
|
+
npx @gv-sh/specgen-app setup
|
141
|
+
```
|
142
|
+
|
143
|
+
6. **Start in production mode**:
|
144
|
+
```bash
|
145
|
+
npx @gv-sh/specgen-app production
|
146
|
+
```
|
147
|
+
|
148
|
+
### Option 3: Manual Deployment
|
149
|
+
|
150
|
+
Alternatively, you can deploy manually using the repository:
|
151
|
+
|
152
|
+
#### Build and Run Locally
|
42
153
|
```bash
|
154
|
+
git clone https://github.com/gv-sh/specgen-app.git
|
155
|
+
cd specgen-app
|
156
|
+
npm run setup
|
43
157
|
npm run build
|
44
|
-
npm
|
158
|
+
npm run production
|
45
159
|
```
|
46
160
|
|
47
|
-
|
161
|
+
#### AWS Deployment Script
|
48
162
|
|
49
163
|
1. Launch Ubuntu 22.04 instance with SSH access
|
50
164
|
2. Run deployment script:
|
@@ -58,6 +172,19 @@ sudo ./deploy.sh
|
|
58
172
|
|
59
173
|
## Management Commands
|
60
174
|
|
175
|
+
When using NPM global installation:
|
176
|
+
```bash
|
177
|
+
# Check status
|
178
|
+
npx @gv-sh/specgen-app status
|
179
|
+
|
180
|
+
# Stop services
|
181
|
+
npx @gv-sh/specgen-app stop
|
182
|
+
|
183
|
+
# Update to latest version
|
184
|
+
npm update -g @gv-sh/specgen-app
|
185
|
+
```
|
186
|
+
|
187
|
+
When using the repository:
|
61
188
|
```bash
|
62
189
|
# Stop services
|
63
190
|
npm run deploy:stop
|
@@ -80,6 +207,10 @@ npm run deploy:backup
|
|
80
207
|
If you encounter issues:
|
81
208
|
|
82
209
|
```bash
|
210
|
+
# For global NPM installation
|
211
|
+
npx @gv-sh/specgen-app troubleshoot
|
212
|
+
|
213
|
+
# For repository installation
|
83
214
|
npm run troubleshoot
|
84
215
|
```
|
85
216
|
|
@@ -87,4 +218,4 @@ This will check your setup and identify common problems.
|
|
87
218
|
|
88
219
|
## Environment Variables
|
89
220
|
|
90
|
-
The setup script creates necessary environment files automatically. You only need to add your OpenAI API key to `server/.env`.
|
221
|
+
The setup script creates necessary environment files automatically. You only need to add your OpenAI API key during setup or later to `server/.env`.
|