Skip to content

Commit 1b16b54

Browse files
Improve npm script naming and separation of concerns
- **install-all**: Now only installs dependencies (no build) - **setup**: New script for complete setup (install + build) - **Updated documentation**: Clear script categories and descriptions - **Updated deployment configs**: Use npm run setup for cleaner builds Follows senior engineer best practices: - Clear naming conventions - Separation of install vs build operations - Flexibility for different developer workflows 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 2d6bd87 commit 1b16b54

4 files changed

Lines changed: 25 additions & 12 deletions

File tree

README.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,15 @@ After deploying, you'll need to provide your ATXP connection string through the
6868
cd agent-demo
6969
```
7070

71-
2. Install all dependencies:
71+
2. Install dependencies and build the project:
7272
```bash
73-
npm run install-all
73+
npm run setup
74+
```
75+
76+
Or, if you prefer to do it step by step:
77+
```bash
78+
npm run install-all # Install all dependencies
79+
npm run build # Build both frontend and backend
7480
```
7581

7682
### Development
@@ -214,16 +220,22 @@ curl -X POST http://localhost:3001/api/texts \
214220

215221
## Development Scripts
216222

217-
- `npm run dev` - Start both frontend and backend in development mode (with hot reloading)
218-
- `npm run start` - Start both frontend and backend in production mode (single browser opening)
219-
- `npm run server` - Start only the backend server (TypeScript with hot reload)
220-
- `npm run server:prod` - Start only the backend server in production mode
221-
- `npm run client` - Start only the frontend development server
222-
- `npm run client:prod` - Start only the frontend in production mode
223+
### Setup & Build
224+
- `npm run setup` - Complete setup: install all dependencies and build everything
225+
- `npm run install-all` - Install dependencies for all packages (root, backend, frontend)
223226
- `npm run build` - Build both frontend and backend for production
224227
- `npm run build:backend` - Build only the backend TypeScript code
225228
- `npm run build:frontend` - Build only the frontend for production
226-
- `npm run install-all` - Install dependencies for all packages and build backend
229+
230+
### Development
231+
- `npm run dev` - Start both frontend and backend in development mode (with hot reloading)
232+
- `npm run server` - Start only the backend server (TypeScript with hot reload)
233+
- `npm run client` - Start only the frontend development server
234+
235+
### Production
236+
- `npm start` - Start the production server (serves both API and frontend)
237+
- `npm run server:prod` - Start only the backend server in production mode
238+
- `npm run client:prod` - Info message (frontend served by backend in production)
227239

228240
## Technologies Used
229241

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"build": "npm run build:backend && npm run build:frontend",
1414
"build:backend": "cd backend && npm run build",
1515
"build:frontend": "cd frontend && npm run build",
16-
"install-all": "npm install && cd backend && npm install && npm run build && cd ../frontend && npm install"
16+
"install-all": "npm install && cd backend && npm install && cd ../frontend && npm install",
17+
"setup": "npm run install-all && npm run build"
1718
},
1819
"keywords": [
1920
"express",

render.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ services:
33
name: atxp-express-app
44
runtime: node
55
plan: free
6-
buildCommand: npm run install-all && npm run build
6+
buildCommand: npm run setup
77
startCommand: cd backend && npm start
88
envVars:
99
- key: NODE_ENV

vercel.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"dest": "/backend/server.ts"
1616
}
1717
],
18-
"installCommand": "npm run install-all && npm run build",
18+
"installCommand": "npm run setup",
1919
"env": {
2020
"NODE_ENV": "production"
2121
},

0 commit comments

Comments
 (0)