# nestjs **Repository Path**: zhou-chong6/nestjs ## Basic Information - **Project Name**: nestjs - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-07-07 - **Last Updated**: 2026-03-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # NestJS Production Guide ## Build Install dependencies in the project root, then build: ```bash cd /Users/zhou/Desktop/my-project/gitee/全站/nestjs yarn install --frozen-lockfile yarn build ``` Build output entry: ```bash dist/src/main.js ``` ## Environment Create a production env file from the example: ```bash cp .env.production.example .env.production ``` At minimum, update: - `APP_SECRET` - `API_DB_HOST` - `API_DB_PORT` - `API_DB_USERNAME` - `API_DB_PASSWORD` - `API_DB_NAME` ## Start Direct start: ```bash NODE_ENV=production node dist/src/main.js ``` Or use the script: ```bash yarn start:prod ``` ## PM2 Start with PM2: ```bash pm2 start ecosystem.config.js --env production ``` Common commands: ```bash pm2 status pm2 logs cami-nest pm2 restart cami-nest pm2 stop cami-nest pm2 delete cami-nest pm2 save ``` Enable boot start: ```bash pm2 startup pm2 save ``` ## Update Deploy Standard update flow: ```bash cd /Users/zhou/Desktop/my-project/gitee/全站/nestjs git pull yarn install --frozen-lockfile yarn build pm2 restart cami-nest ``` ## Notes - Run from the project root, not from `dist`. - `package.json` and `node_modules` stay in the root directory. - If `API_DB_SYNC=false`, database schema changes must be applied manually before restart.