You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+62-3Lines changed: 62 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ A template for creating consistent help content:
36
36
37
37
### Setting Up a New Application
38
38
39
-
1.**Fork the repository**
39
+
1.**Clone the repository**
40
40
2.**Customize the HTML template** by replacing placeholders:
41
41
-`<!-- APP_TITLE -->` - Your application title
42
42
-`<!-- APP_NAME -->` - Your application name (appears in header)
@@ -108,10 +108,41 @@ This template includes a local development server (`server.js`) that provides:
108
108
### Starting the Server
109
109
110
110
```bash
111
-
node server.js
111
+
# Local development
112
+
npm run start:dev # Vite + API for local development
113
+
# Production
114
+
npm run build # Create production build in dist/
115
+
npm run start:prod # Serve built assets from dist/
112
116
```
113
117
114
-
The server will start on `http://localhost:3000` by default.
118
+
119
+
### Environment Variables
120
+
121
+
The server supports the following environment variables:
122
+
123
+
-**`PORT`** - Server port number
124
+
- Development: Can be set to any port (e.g., `PORT=3001`), defaulting to `3000`
125
+
- Production: Ignored (always `3000` when `IS_PRODUCTION=true`)
126
+
127
+
-**`IS_PRODUCTION`** - Enables production mode
128
+
- Set to `'true'` to enable production mode
129
+
- When enabled:
130
+
- Server serves static files from `dist/` directory
131
+
- Port is forced to `3000`
132
+
- Requires `dist/` directory to exist (throws error if missing)
133
+
134
+
135
+
### Vite Build System
136
+
137
+
This project uses [Vite](https://vitejs.dev/) as the build tool for fast development and optimized production builds.
138
+
139
+
#### Build Process
140
+
141
+
Running `npm run build` executes `vite build`, which:
142
+
- Reads source files from the `client/` directory (configured in `vite.config.js`)
143
+
- Processes and bundles JavaScript, CSS, and other assets
144
+
- Outputs optimized production files to the `dist/` directory
145
+
- Generates hashed filenames for cache busting
115
146
116
147
### WebSocket Messaging API
117
148
@@ -138,3 +169,31 @@ curl -X POST http://localhost:3000/message \
138
169
-H "Content-Type: application/json" \
139
170
-d '{"message": "Hello from the server!"}'
140
171
```
172
+
173
+
## CI/CD and Automated Releases
174
+
175
+
This template includes a GitHub Actions workflow (`.github/workflows/build-release.yml`) that automatically builds and releases your application when you push to the `main` branch.
176
+
177
+
### How It Works
178
+
179
+
When you push to `main`, the workflow will:
180
+
181
+
1.**Build the project** - Runs `npm run build` to create production assets in `dist/`
182
+
2.**Create a release tarball** - Packages `dist/`, `package.json`, `server.js`, and production `node_modules/` into `release.tar.gz`
183
+
3.**Create a GitHub Release** - Automatically creates a new release tagged as `v{run_number}` with the tarball attached
184
+
185
+
### Release Contents
186
+
187
+
The release tarball (`release.tar.gz`) contains everything needed to deploy the application:
188
+
-`dist/` - Built production assets
189
+
-`package.json` - Project dependencies and scripts
190
+
-`server.js` - Production server
191
+
-`node_modules/` - Production dependencies only
192
+
193
+
### Using Releases
194
+
195
+
To deploy a release:
196
+
197
+
1. Download `release.tar.gz` from the latest GitHub Release (e.g. with `wget`)
0 commit comments