ai-flow-dev 1.3.0 → 1.4.0
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/dist/cli.js +16 -7
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
- package/prompts/backend/flow-bootstrap-phase-8.md +198 -549
- package/prompts/backend/flow-bootstrap-phase-9.md +441 -58
- package/prompts/backend/flow-bootstrap.md +108 -107
- package/prompts/backend/flow-dev-feature.md +447 -68
- package/prompts/backend/flow-dev-fix.md +81 -8
- package/templates/{shared/AGENT.template.md → AGENT.template.md} +1 -1
- package/templates/mobile/AGENT.template.md +0 -251
|
@@ -103,69 +103,97 @@ Backup complete! Safe to initialize framework.
|
|
|
103
103
|
|
|
104
104
|
### 8.2.3: Execute Framework CLI
|
|
105
105
|
|
|
106
|
-
**
|
|
106
|
+
**IMPORTANT:** Use Bash tool to execute the framework's official CLI command. This ensures the project gets the latest stable versions and official project structure.
|
|
107
107
|
|
|
108
|
-
**
|
|
108
|
+
**Based on framework detected in Phase 3, execute ONE of these commands:**
|
|
109
|
+
|
|
110
|
+
**NestJS:**
|
|
109
111
|
|
|
110
112
|
```bash
|
|
111
|
-
# NestJS
|
|
112
113
|
npx @nestjs/cli new . --skip-git --package-manager npm
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Express:**
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# Initialize package.json
|
|
120
|
+
npm init -y
|
|
113
121
|
|
|
114
|
-
#
|
|
115
|
-
|
|
122
|
+
# Install core dependencies with latest versions
|
|
123
|
+
npm install express cors helmet dotenv
|
|
116
124
|
|
|
117
|
-
#
|
|
118
|
-
npm
|
|
125
|
+
# Install dev dependencies
|
|
126
|
+
npm install -D typescript @types/node @types/express ts-node nodemon
|
|
119
127
|
|
|
120
|
-
#
|
|
121
|
-
npx create-next-app@latest . --typescript --eslint --tailwind --app --src-dir --import-alias "@/*"
|
|
128
|
+
# Create src/app.ts from template (see section 8.2.6.4)
|
|
122
129
|
```
|
|
123
130
|
|
|
124
|
-
**
|
|
131
|
+
**Django:**
|
|
125
132
|
|
|
126
133
|
```bash
|
|
127
|
-
# Django
|
|
128
134
|
django-admin startproject config .
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**FastAPI:**
|
|
129
138
|
|
|
130
|
-
|
|
131
|
-
#
|
|
132
|
-
|
|
133
|
-
touch main.py requirements.txt
|
|
134
|
-
# Generate starter files
|
|
139
|
+
```bash
|
|
140
|
+
# Install FastAPI with latest stable
|
|
141
|
+
pip install "fastapi[standard]" uvicorn[standard]
|
|
135
142
|
|
|
136
|
-
#
|
|
137
|
-
flask init
|
|
143
|
+
# Create app/main.py from template (see section 8.2.6.4)
|
|
138
144
|
```
|
|
139
145
|
|
|
140
|
-
**
|
|
146
|
+
**Spring Boot:**
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
spring init --dependencies=web,data-jpa --build=maven --name=[ProjectName] .
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**Laravel:**
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
composer create-project laravel/laravel .
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**Go (Gin):**
|
|
141
159
|
|
|
142
160
|
```bash
|
|
143
|
-
# Go
|
|
144
161
|
go mod init [module-name]
|
|
162
|
+
go get -u github.com/gin-gonic/gin
|
|
163
|
+
```
|
|
145
164
|
|
|
146
|
-
|
|
147
|
-
dotnet new webapi -n [ProjectName]
|
|
165
|
+
**Ruby on Rails:**
|
|
148
166
|
|
|
149
|
-
|
|
150
|
-
rails new . --api --skip-git
|
|
167
|
+
```bash
|
|
168
|
+
rails new . --api --skip-git --database=postgresql
|
|
169
|
+
```
|
|
151
170
|
|
|
152
|
-
|
|
153
|
-
composer create-project laravel/laravel .
|
|
171
|
+
**.NET Core:**
|
|
154
172
|
|
|
155
|
-
|
|
156
|
-
|
|
173
|
+
```bash
|
|
174
|
+
dotnet new webapi -n [ProjectName] -o .
|
|
157
175
|
```
|
|
158
176
|
|
|
159
|
-
**Show progress:**
|
|
177
|
+
**Show progress as command executes:**
|
|
160
178
|
|
|
161
179
|
```
|
|
162
|
-
🚀
|
|
180
|
+
🚀 Executing: npx @nestjs/cli new . --skip-git
|
|
163
181
|
|
|
164
|
-
[
|
|
182
|
+
[Real CLI output from Bash tool]
|
|
165
183
|
|
|
166
184
|
✅ Framework initialized successfully!
|
|
167
185
|
```
|
|
168
186
|
|
|
187
|
+
**Result:** Framework CLI creates:
|
|
188
|
+
|
|
189
|
+
- ✅ package.json / requirements.txt / pom.xml (with latest versions)
|
|
190
|
+
- ✅ tsconfig.json / pyproject.toml (optimized configs)
|
|
191
|
+
- ✅ Basic src/ structure
|
|
192
|
+
- ✅ Test setup
|
|
193
|
+
- ✅ Linting/formatting configs
|
|
194
|
+
|
|
195
|
+
**Next:** Only add what framework doesn't include (see 8.2.6)
|
|
196
|
+
|
|
169
197
|
### 8.2.4: Restore AI Flow Documentation
|
|
170
198
|
|
|
171
199
|
```
|
|
@@ -212,613 +240,234 @@ You can initialize manually later with:
|
|
|
212
240
|
Proceeding to documentation generation...
|
|
213
241
|
```
|
|
214
242
|
|
|
215
|
-
### 8.2.6:
|
|
216
|
-
|
|
217
|
-
**Set up complete development environment based on framework from Phase 3:**
|
|
243
|
+
### 8.2.6: Minimal Post-Init Enhancements
|
|
218
244
|
|
|
219
|
-
|
|
220
|
-
🔧 Setting up complete development environment...
|
|
221
|
-
|
|
222
|
-
Framework detected: [FRAMEWORK_NAME]
|
|
223
|
-
Creating additional configurations according to documentation:
|
|
224
|
-
```
|
|
245
|
+
**IMPORTANT:** Only add what the framework CLI doesn't include. **DO NOT** create business logic, entity modules, or complete features.
|
|
225
246
|
|
|
226
|
-
**Based on the selected framework and ORM/database from previous phases:**
|
|
227
|
-
|
|
228
|
-
**Install latest stable NestJS dependencies:**
|
|
229
|
-
|
|
230
|
-
```bash
|
|
231
|
-
# Install NestJS CLI globally (latest stable)
|
|
232
|
-
npm install -g @nestjs/cli
|
|
233
|
-
|
|
234
|
-
# Initialize with latest stable dependencies
|
|
235
|
-
npm install @nestjs/common @nestjs/core @nestjs/platform-express
|
|
236
|
-
npm install @nestjs/config @nestjs/jwt @nestjs/passport @nestjs/swagger
|
|
237
|
-
npm install @prisma/client bcrypt class-transformer class-validator
|
|
238
|
-
npm install passport passport-jwt passport-local reflect-metadata rxjs swagger-ui-express
|
|
239
|
-
|
|
240
|
-
# Install development dependencies (latest stable)
|
|
241
|
-
npm install -D @nestjs/cli @nestjs/schematics @nestjs/testing
|
|
242
|
-
npm install -D @types/bcrypt @types/express @types/jest @types/node
|
|
243
|
-
npm install -D @types/passport-jwt @types/passport-local @types/supertest
|
|
244
|
-
npm install -D @typescript-eslint/eslint-plugin @typescript-eslint/parser
|
|
245
|
-
npm install -D eslint eslint-config-prettier eslint-plugin-prettier
|
|
246
|
-
npm install -D jest prettier prisma source-map-support supertest
|
|
247
|
-
npm install -D ts-jest ts-loader ts-node tsconfig-paths typescript
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
**Update package.json scripts:**
|
|
251
|
-
|
|
252
|
-
```json
|
|
253
|
-
{
|
|
254
|
-
"scripts": {
|
|
255
|
-
"build": "nest build",
|
|
256
|
-
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
257
|
-
"start": "nest start",
|
|
258
|
-
"start:dev": "nest start --watch",
|
|
259
|
-
"start:debug": "nest start --debug --watch",
|
|
260
|
-
"start:prod": "node dist/main",
|
|
261
|
-
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
|
262
|
-
"test": "jest",
|
|
263
|
-
"test:watch": "jest --watch",
|
|
264
|
-
"test:cov": "jest --coverage",
|
|
265
|
-
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
|
266
|
-
"test:e2e": "jest --config ./test/jest-e2e.json",
|
|
267
|
-
"db:generate": "prisma generate",
|
|
268
|
-
"db:push": "prisma db push",
|
|
269
|
-
"db:migrate": "prisma migrate dev",
|
|
270
|
-
"db:studio": "prisma studio"
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
247
|
```
|
|
248
|
+
📦 Adding minimal enhancements...
|
|
274
249
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
```json
|
|
278
|
-
{
|
|
279
|
-
"compilerOptions": {
|
|
280
|
-
"module": "commonjs",
|
|
281
|
-
"declaration": true,
|
|
282
|
-
"removeComments": true,
|
|
283
|
-
"emitDecoratorMetadata": true,
|
|
284
|
-
"experimentalDecorators": true,
|
|
285
|
-
"allowSyntheticDefaultImports": true,
|
|
286
|
-
"target": "ES2021",
|
|
287
|
-
"sourceMap": true,
|
|
288
|
-
"outDir": "./dist",
|
|
289
|
-
"baseUrl": "./",
|
|
290
|
-
"incremental": true,
|
|
291
|
-
"skipLibCheck": true,
|
|
292
|
-
"strictNullChecks": true,
|
|
293
|
-
"noImplicitAny": true,
|
|
294
|
-
"strictBindCallApply": true,
|
|
295
|
-
"forceConsistentCasingInFileNames": true,
|
|
296
|
-
"noFallthroughCasesInSwitch": true,
|
|
297
|
-
"paths": {
|
|
298
|
-
"@/*": ["src/*"],
|
|
299
|
-
"@/common/*": ["src/common/*"],
|
|
300
|
-
"@/config/*": ["src/config/*"]
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
250
|
+
Framework base created by CLI ✅
|
|
251
|
+
Now adding only essential files that framework doesn't include...
|
|
304
252
|
```
|
|
305
253
|
|
|
306
|
-
**
|
|
254
|
+
**Based on selected framework and database from previous phases:**
|
|
307
255
|
|
|
308
|
-
|
|
309
|
-
// prisma/schema.prisma
|
|
310
|
-
generator client {
|
|
311
|
-
provider = "prisma-client-js"
|
|
312
|
-
}
|
|
256
|
+
### 8.2.6.1: Environment Variables Template
|
|
313
257
|
|
|
314
|
-
|
|
315
|
-
provider = "postgresql"
|
|
316
|
-
url = env("DATABASE_URL")
|
|
317
|
-
}
|
|
258
|
+
**Copy `.env.example` template to project root:**
|
|
318
259
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
id Int @id @default(autoincrement())
|
|
322
|
-
email String @unique
|
|
323
|
-
name String?
|
|
324
|
-
createdAt DateTime @default(now())
|
|
325
|
-
updatedAt DateTime @updatedAt
|
|
326
|
-
|
|
327
|
-
@@map("users")
|
|
328
|
-
}
|
|
260
|
+
```bash
|
|
261
|
+
# Copy from .ai-flow/templates/.env.example.template to .env.example
|
|
329
262
|
```
|
|
330
263
|
|
|
331
|
-
**
|
|
264
|
+
**Template content (adapt based on framework and database):**
|
|
332
265
|
|
|
333
266
|
```env
|
|
334
267
|
# Database
|
|
335
|
-
DATABASE_URL="postgresql://postgres:password@localhost:5432/
|
|
268
|
+
DATABASE_URL="postgresql://postgres:password@localhost:5432/{{PROJECT_NAME}}_dev?schema=public"
|
|
336
269
|
|
|
337
|
-
# JWT
|
|
338
|
-
JWT_SECRET="your-
|
|
270
|
+
# JWT Authentication
|
|
271
|
+
JWT_SECRET="your-secret-key-here-change-in-production"
|
|
339
272
|
JWT_EXPIRES_IN="24h"
|
|
340
273
|
|
|
341
|
-
#
|
|
274
|
+
# Application
|
|
342
275
|
NODE_ENV="development"
|
|
343
276
|
PORT=3000
|
|
277
|
+
API_PREFIX="/api"
|
|
344
278
|
|
|
345
|
-
#
|
|
279
|
+
# CORS
|
|
346
280
|
CORS_ORIGIN="http://localhost:3000"
|
|
347
|
-
```
|
|
348
|
-
|
|
349
|
-
**Create docker-compose.yml for PostgreSQL:**
|
|
350
|
-
|
|
351
|
-
```yaml
|
|
352
|
-
version: "3.8"
|
|
353
|
-
services:
|
|
354
|
-
postgres:
|
|
355
|
-
image: postgres:15-alpine
|
|
356
|
-
restart: always
|
|
357
|
-
environment:
|
|
358
|
-
POSTGRES_DB: myapp_dev
|
|
359
|
-
POSTGRES_USER: postgres
|
|
360
|
-
POSTGRES_PASSWORD: password
|
|
361
|
-
ports:
|
|
362
|
-
- "5432:5432"
|
|
363
|
-
volumes:
|
|
364
|
-
- postgres_data:/var/lib/postgresql/data
|
|
365
|
-
|
|
366
|
-
volumes:
|
|
367
|
-
postgres_data:
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
**Create complete ESLint + Prettier configuration:**
|
|
371
|
-
|
|
372
|
-
```json
|
|
373
|
-
// .eslintrc.js
|
|
374
|
-
module.exports = {
|
|
375
|
-
parser: '@typescript-eslint/parser',
|
|
376
|
-
parserOptions: {
|
|
377
|
-
project: 'tsconfig.json',
|
|
378
|
-
tsconfigRootDir: __dirname,
|
|
379
|
-
sourceType: 'module',
|
|
380
|
-
},
|
|
381
|
-
plugins: ['@typescript-eslint/eslint-plugin'],
|
|
382
|
-
extends: [
|
|
383
|
-
'@nestjs',
|
|
384
|
-
'plugin:@typescript-eslint/recommended',
|
|
385
|
-
'plugin:prettier/recommended',
|
|
386
|
-
],
|
|
387
|
-
root: true,
|
|
388
|
-
env: {
|
|
389
|
-
node: true,
|
|
390
|
-
jest: true,
|
|
391
|
-
},
|
|
392
|
-
ignorePatterns: ['.eslintrc.js'],
|
|
393
|
-
rules: {
|
|
394
|
-
'@typescript-eslint/interface-name-prefix': 'off',
|
|
395
|
-
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
396
|
-
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
397
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
398
|
-
},
|
|
399
|
-
};
|
|
400
|
-
```
|
|
401
|
-
|
|
402
|
-
```json
|
|
403
|
-
// .prettierrc
|
|
404
|
-
{
|
|
405
|
-
"singleQuote": true,
|
|
406
|
-
"trailingComma": "all",
|
|
407
|
-
"tabWidth": 2,
|
|
408
|
-
"semi": true,
|
|
409
|
-
"printWidth": 80
|
|
410
|
-
}
|
|
411
|
-
```
|
|
412
281
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
import { NestFactory } from "@nestjs/core";
|
|
417
|
-
import { ValidationPipe } from "@nestjs/common";
|
|
418
|
-
import { SwaggerModule, DocumentBuilder } from "@nestjs/swagger";
|
|
419
|
-
import { AppModule } from "./app.module";
|
|
420
|
-
|
|
421
|
-
async function bootstrap() {
|
|
422
|
-
const app = await NestFactory.create(AppModule);
|
|
423
|
-
|
|
424
|
-
// Global validation pipe
|
|
425
|
-
app.useGlobalPipes(
|
|
426
|
-
new ValidationPipe({
|
|
427
|
-
whitelist: true,
|
|
428
|
-
forbidNonWhitelisted: true,
|
|
429
|
-
transform: true,
|
|
430
|
-
})
|
|
431
|
-
);
|
|
432
|
-
|
|
433
|
-
// CORS
|
|
434
|
-
app.enableCors({
|
|
435
|
-
origin: process.env.CORS_ORIGIN || "http://localhost:3000",
|
|
436
|
-
credentials: true,
|
|
437
|
-
});
|
|
438
|
-
|
|
439
|
-
// Swagger API Documentation
|
|
440
|
-
const config = new DocumentBuilder()
|
|
441
|
-
.setTitle("API Documentation")
|
|
442
|
-
.setDescription("The API description")
|
|
443
|
-
.setVersion("1.0")
|
|
444
|
-
.addBearerAuth()
|
|
445
|
-
.build();
|
|
446
|
-
const document = SwaggerModule.createDocument(app, config);
|
|
447
|
-
SwaggerModule.setup("api/docs", app, document);
|
|
448
|
-
|
|
449
|
-
const port = process.env.PORT || 3000;
|
|
450
|
-
await app.listen(port);
|
|
451
|
-
console.log(`🚀 Application is running on: http://localhost:${port}`);
|
|
452
|
-
console.log(`📚 Swagger documentation: http://localhost:${port}/api/docs`);
|
|
453
|
-
}
|
|
454
|
-
bootstrap();
|
|
455
|
-
```
|
|
456
|
-
|
|
457
|
-
**Create basic folder structure:**
|
|
282
|
+
# Redis (if using)
|
|
283
|
+
REDIS_HOST="localhost"
|
|
284
|
+
REDIS_PORT=6379
|
|
458
285
|
|
|
286
|
+
# Email (if using)
|
|
287
|
+
SMTP_HOST=""
|
|
288
|
+
SMTP_PORT=587
|
|
289
|
+
SMTP_USER=""
|
|
290
|
+
SMTP_PASS=""
|
|
459
291
|
```
|
|
460
|
-
src/
|
|
461
|
-
├── common/
|
|
462
|
-
│ ├── decorators/
|
|
463
|
-
│ ├── filters/
|
|
464
|
-
│ ├── guards/
|
|
465
|
-
│ ├── interceptors/
|
|
466
|
-
│ └── pipes/
|
|
467
|
-
├── config/
|
|
468
|
-
│ ├── database.config.ts
|
|
469
|
-
│ └── jwt.config.ts
|
|
470
|
-
└── health/
|
|
471
|
-
├── health.controller.ts
|
|
472
|
-
└── health.module.ts
|
|
473
|
-
```
|
|
474
|
-
|
|
475
|
-
**IMPORTANT: Do NOT create entity-specific modules** (User, Product, Order, etc.)
|
|
476
|
-
**Only create the basic NestJS structure with configurations**
|
|
477
292
|
|
|
478
|
-
|
|
479
|
-
✅ Complete NestJS development environment ready!
|
|
480
|
-
✅ PostgreSQL configured with Docker Compose
|
|
481
|
-
✅ Prisma ORM configured with basic User model
|
|
482
|
-
✅ ESLint + Prettier configured
|
|
483
|
-
✅ JWT authentication structure ready
|
|
484
|
-
✅ Swagger API documentation enabled
|
|
485
|
-
✅ All development scripts configured
|
|
293
|
+
**User must copy to `.env` manually:**
|
|
486
294
|
|
|
487
|
-
🎯 Project is ready for development - entity modules should be created during development phases
|
|
488
295
|
```
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
```bash
|
|
493
|
-
npm install
|
|
494
|
-
|
|
495
|
-
# Generate Prisma client
|
|
496
|
-
npx prisma generate
|
|
497
|
-
|
|
498
|
-
# Start database
|
|
499
|
-
docker-compose up -d
|
|
500
|
-
|
|
501
|
-
# Run migrations (creates User table)
|
|
502
|
-
npx prisma db push
|
|
503
|
-
```
|
|
504
|
-
|
|
505
|
-
```
|
|
506
|
-
🔄 Installing dependencies...
|
|
507
|
-
📦 Generating Prisma client...
|
|
508
|
-
🐘 Starting PostgreSQL container...
|
|
509
|
-
🗄️ Creating database tables...
|
|
510
|
-
|
|
511
|
-
✅ All configurations applied successfully!
|
|
512
|
-
|
|
513
|
-
Next steps for development:
|
|
514
|
-
1. Start development server: npm run start:dev
|
|
515
|
-
2. Open API docs: http://localhost:3000/api/docs
|
|
516
|
-
3. Access database: npx prisma studio
|
|
517
|
-
4. Create entity modules as needed during development
|
|
518
|
-
```
|
|
519
|
-
|
|
520
|
-
#### **FastAPI (Python) Complete Setup:**
|
|
521
|
-
|
|
522
|
-
**Install latest stable dependencies:**
|
|
523
|
-
|
|
524
|
-
```bash
|
|
525
|
-
# Install latest stable FastAPI and dependencies
|
|
526
|
-
pip install fastapi uvicorn[standard] sqlalchemy alembic psycopg2-binary
|
|
527
|
-
pip install python-jose[cryptography] passlib[bcrypt] python-multipart
|
|
528
|
-
pip install pydantic pydantic-settings
|
|
529
|
-
|
|
530
|
-
# Install development dependencies (latest stable)
|
|
531
|
-
pip install pytest pytest-asyncio black flake8 mypy
|
|
296
|
+
📝 Created .env.example template
|
|
297
|
+
⚠️ User must copy to .env and configure: cp .env.example .env
|
|
532
298
|
```
|
|
533
299
|
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
```bash
|
|
537
|
-
pip freeze > requirements.txt
|
|
538
|
-
```
|
|
300
|
+
### 8.2.6.2: Docker Compose (Optional)
|
|
539
301
|
|
|
540
|
-
**
|
|
302
|
+
**Only if user selected Docker in Phase 7.**
|
|
541
303
|
|
|
542
|
-
|
|
543
|
-
app/
|
|
544
|
-
├── __init__.py
|
|
545
|
-
├── main.py
|
|
546
|
-
├── core/
|
|
547
|
-
│ ├── __init__.py
|
|
548
|
-
│ ├── config.py
|
|
549
|
-
│ ├── security.py
|
|
550
|
-
│ └── database.py
|
|
551
|
-
├── api/
|
|
552
|
-
│ ├── __init__.py
|
|
553
|
-
│ └── deps.py
|
|
554
|
-
├── models/
|
|
555
|
-
│ ├── __init__.py
|
|
556
|
-
│ └── user.py
|
|
557
|
-
└── schemas/
|
|
558
|
-
├── __init__.py
|
|
559
|
-
└── user.py
|
|
560
|
-
```
|
|
304
|
+
**Copy appropriate docker-compose template based on database:**
|
|
561
305
|
|
|
562
|
-
**
|
|
306
|
+
**PostgreSQL:**
|
|
563
307
|
|
|
564
308
|
```yaml
|
|
309
|
+
# Copy from templates/docker-compose/postgres.template.yml
|
|
565
310
|
version: "3.8"
|
|
311
|
+
|
|
566
312
|
services:
|
|
567
313
|
postgres:
|
|
568
314
|
image: postgres:15-alpine
|
|
315
|
+
restart: unless-stopped
|
|
569
316
|
environment:
|
|
570
|
-
POSTGRES_DB: myapp_dev
|
|
571
|
-
POSTGRES_USER: postgres
|
|
572
|
-
POSTGRES_PASSWORD: password
|
|
317
|
+
POSTGRES_DB: ${DB_NAME:-myapp_dev}
|
|
318
|
+
POSTGRES_USER: ${DB_USER:-postgres}
|
|
319
|
+
POSTGRES_PASSWORD: ${DB_PASSWORD:-password}
|
|
573
320
|
ports:
|
|
574
|
-
- "5432:5432"
|
|
321
|
+
- "${DB_PORT:-5432}:5432"
|
|
575
322
|
volumes:
|
|
576
323
|
- postgres_data:/var/lib/postgresql/data
|
|
324
|
+
healthcheck:
|
|
325
|
+
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
326
|
+
interval: 10s
|
|
327
|
+
timeout: 5s
|
|
328
|
+
retries: 5
|
|
577
329
|
|
|
578
330
|
volumes:
|
|
579
331
|
postgres_data:
|
|
580
332
|
```
|
|
581
333
|
|
|
582
|
-
|
|
334
|
+
**MySQL:**
|
|
583
335
|
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
# Install production dependencies (latest stable)
|
|
588
|
-
npm install express cors helmet express-rate-limit jsonwebtoken bcrypt @prisma/client dotenv
|
|
589
|
-
|
|
590
|
-
# Install development dependencies (latest stable)
|
|
591
|
-
npm install -D @types/express @types/cors @types/bcrypt @types/jsonwebtoken
|
|
592
|
-
npm install -D typescript nodemon ts-node jest @types/jest prisma
|
|
593
|
-
|
|
594
|
-
# Update package.json scripts
|
|
595
|
-
```
|
|
336
|
+
```yaml
|
|
337
|
+
# Copy from templates/docker-compose/mysql.template.yml
|
|
338
|
+
version: "3.8"
|
|
596
339
|
|
|
597
|
-
|
|
340
|
+
services:
|
|
341
|
+
mysql:
|
|
342
|
+
image: mysql:8-oracle
|
|
343
|
+
restart: unless-stopped
|
|
344
|
+
environment:
|
|
345
|
+
MYSQL_DATABASE: ${DB_NAME:-myapp_dev}
|
|
346
|
+
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:-password}
|
|
347
|
+
ports:
|
|
348
|
+
- "${DB_PORT:-3306}:3306"
|
|
349
|
+
volumes:
|
|
350
|
+
- mysql_data:/var/lib/mysql
|
|
598
351
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
"scripts": {
|
|
602
|
-
"dev": "nodemon src/app.ts",
|
|
603
|
-
"build": "tsc",
|
|
604
|
-
"start": "node dist/app.js",
|
|
605
|
-
"lint": "eslint src/**/*.ts",
|
|
606
|
-
"test": "jest",
|
|
607
|
-
"db:generate": "prisma generate",
|
|
608
|
-
"db:migrate": "prisma migrate dev"
|
|
609
|
-
}
|
|
610
|
-
}
|
|
352
|
+
volumes:
|
|
353
|
+
mysql_data:
|
|
611
354
|
```
|
|
612
355
|
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
**Install latest stable dependencies:**
|
|
616
|
-
|
|
617
|
-
```bash
|
|
618
|
-
# Install Django and DRF (latest stable)
|
|
619
|
-
pip install Django djangorestframework django-cors-headers
|
|
620
|
-
pip install celery redis psycopg2-binary python-decouple
|
|
621
|
-
pip install djangorestframework-simplejwt django-filter
|
|
356
|
+
**MongoDB:**
|
|
622
357
|
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
358
|
+
```yaml
|
|
359
|
+
# Copy from templates/docker-compose/mongodb.template.yml
|
|
360
|
+
version: "3.8"
|
|
626
361
|
|
|
627
|
-
|
|
362
|
+
services:
|
|
363
|
+
mongodb:
|
|
364
|
+
image: mongo:7
|
|
365
|
+
restart: unless-stopped
|
|
366
|
+
environment:
|
|
367
|
+
MONGO_INITDB_DATABASE: ${DB_NAME:-myapp_dev}
|
|
368
|
+
MONGO_INITDB_ROOT_USERNAME: ${DB_USER:-root}
|
|
369
|
+
MONGO_INITDB_ROOT_PASSWORD: ${DB_PASSWORD:-password}
|
|
370
|
+
ports:
|
|
371
|
+
- "${DB_PORT:-27017}:27017"
|
|
372
|
+
volumes:
|
|
373
|
+
- mongodb_data:/data/db
|
|
628
374
|
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
├── __init__.py
|
|
632
|
-
├── settings/
|
|
633
|
-
│ ├── __init__.py
|
|
634
|
-
│ ├── base.py
|
|
635
|
-
│ ├── development.py
|
|
636
|
-
│ └── production.py
|
|
637
|
-
├── urls.py
|
|
638
|
-
└── wsgi.py
|
|
375
|
+
volumes:
|
|
376
|
+
mongodb_data:
|
|
639
377
|
```
|
|
640
378
|
|
|
641
|
-
|
|
379
|
+
### 8.2.6.3: ORM Setup (If Framework Doesn't Include)
|
|
642
380
|
|
|
643
|
-
**
|
|
381
|
+
**Only for frameworks that don't auto-configure ORM:**
|
|
644
382
|
|
|
645
|
-
|
|
646
|
-
# Use Spring Initializr or Spring Boot CLI for latest stable versions
|
|
647
|
-
spring init --dependencies=web,data-jpa,security,postgresql --build=maven .
|
|
648
|
-
|
|
649
|
-
# Or add dependencies manually (latest stable versions)
|
|
650
|
-
```
|
|
651
|
-
|
|
652
|
-
**Add JWT dependency to pom.xml:**
|
|
653
|
-
|
|
654
|
-
```xml
|
|
655
|
-
<dependencies>
|
|
656
|
-
<!-- Spring Boot starters (managed versions) -->
|
|
657
|
-
<dependency>
|
|
658
|
-
<groupId>org.springframework.boot</groupId>
|
|
659
|
-
<artifactId>spring-boot-starter-web</artifactId>
|
|
660
|
-
</dependency>
|
|
661
|
-
<dependency>
|
|
662
|
-
<groupId>org.springframework.boot</groupId>
|
|
663
|
-
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
|
664
|
-
</dependency>
|
|
665
|
-
<dependency>
|
|
666
|
-
<groupId>org.springframework.boot</groupId>
|
|
667
|
-
<artifactId>spring-boot-starter-security</artifactId>
|
|
668
|
-
</dependency>
|
|
669
|
-
<dependency>
|
|
670
|
-
<groupId>org.postgresql</groupId>
|
|
671
|
-
<artifactId>postgresql</artifactId>
|
|
672
|
-
</dependency>
|
|
673
|
-
<!-- Use latest stable JWT library -->
|
|
674
|
-
<dependency>
|
|
675
|
-
<groupId>io.jsonwebtoken</groupId>
|
|
676
|
-
<artifactId>jjwt-api</artifactId>
|
|
677
|
-
</dependency>
|
|
678
|
-
<dependency>
|
|
679
|
-
<groupId>io.jsonwebtoken</groupId>
|
|
680
|
-
<artifactId>jjwt-impl</artifactId>
|
|
681
|
-
<scope>runtime</scope>
|
|
682
|
-
</dependency>
|
|
683
|
-
<dependency>
|
|
684
|
-
<groupId>io.jsonwebtoken</groupId>
|
|
685
|
-
<artifactId>jjwt-jackson</artifactId>
|
|
686
|
-
<scope>runtime</scope>
|
|
687
|
-
</dependency>
|
|
688
|
-
</dependencies>
|
|
689
|
-
```
|
|
690
|
-
|
|
691
|
-
#### **Laravel (PHP) Complete Setup:**
|
|
692
|
-
|
|
693
|
-
**Install Laravel with latest stable version:**
|
|
383
|
+
**NestJS + Prisma:**
|
|
694
384
|
|
|
695
385
|
```bash
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
# Install additional packages (latest stable)
|
|
700
|
-
composer require laravel/sanctum
|
|
701
|
-
composer require --dev laravel/pint
|
|
386
|
+
npx prisma init
|
|
387
|
+
# Creates prisma/schema.prisma automatically with DATABASE_URL from .env
|
|
702
388
|
```
|
|
703
389
|
|
|
704
|
-
**
|
|
705
|
-
|
|
706
|
-
```env
|
|
707
|
-
DB_CONNECTION=pgsql
|
|
708
|
-
DB_HOST=127.0.0.1
|
|
709
|
-
DB_PORT=5432
|
|
710
|
-
DB_DATABASE=myapp_dev
|
|
711
|
-
DB_USERNAME=postgres
|
|
712
|
-
DB_PASSWORD=password
|
|
390
|
+
**Express + Prisma:**
|
|
713
391
|
|
|
714
|
-
|
|
715
|
-
|
|
392
|
+
```bash
|
|
393
|
+
npm install prisma @prisma/client
|
|
394
|
+
npx prisma init
|
|
716
395
|
```
|
|
717
396
|
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
**Initialize Go module and install dependencies:**
|
|
397
|
+
**FastAPI + SQLAlchemy:**
|
|
721
398
|
|
|
722
399
|
```bash
|
|
723
|
-
#
|
|
724
|
-
|
|
400
|
+
# SQLAlchemy setup (create app/core/database.py)
|
|
401
|
+
# Follow FastAPI documentation: https://fastapi.tiangolo.com/tutorial/sql-databases/
|
|
402
|
+
```
|
|
725
403
|
|
|
726
|
-
|
|
727
|
-
go get github.com/gin-gonic/gin
|
|
728
|
-
go get github.com/golang-jwt/jwt/v5
|
|
729
|
-
go get gorm.io/gorm
|
|
730
|
-
go get gorm.io/driver/postgres
|
|
731
|
-
go get github.com/golang-migrate/migrate/v4
|
|
732
|
-
go get github.com/go-playground/validator/v10
|
|
404
|
+
**Django:**
|
|
733
405
|
|
|
734
|
-
|
|
735
|
-
|
|
406
|
+
```bash
|
|
407
|
+
# ORM already configured by django-admin startproject
|
|
408
|
+
# Just configure DATABASE settings in config/settings/base.py
|
|
736
409
|
```
|
|
737
410
|
|
|
738
|
-
**
|
|
739
|
-
|
|
740
|
-
**Create basic structure:**
|
|
411
|
+
**Result:**
|
|
741
412
|
|
|
742
413
|
```
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
internal/
|
|
747
|
-
├── config/
|
|
748
|
-
├── handlers/
|
|
749
|
-
├── middleware/
|
|
750
|
-
├── models/
|
|
751
|
-
└── services/
|
|
752
|
-
pkg/
|
|
753
|
-
└── database/
|
|
414
|
+
✅ ORM initialized
|
|
415
|
+
✅ schema.prisma created (or equivalent)
|
|
416
|
+
✅ Migrations ready to run
|
|
754
417
|
```
|
|
755
418
|
|
|
756
|
-
|
|
419
|
+
### 8.2.6.4: Starter Files for Express/FastAPI (Optional)
|
|
757
420
|
|
|
758
|
-
**
|
|
421
|
+
**Only if user needs a basic starting point. Otherwise, skip and let them follow official docs.**
|
|
759
422
|
|
|
760
|
-
|
|
761
|
-
# Create new Rails API project
|
|
762
|
-
rails new myapp --api --skip-git --database=postgresql
|
|
763
|
-
|
|
764
|
-
# Navigate to project
|
|
765
|
-
cd myapp
|
|
423
|
+
**Express:**
|
|
766
424
|
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
bundle add bcrypt
|
|
770
|
-
bundle add rack-cors
|
|
771
|
-
bundle add rspec-rails --group development,test
|
|
772
|
-
bundle add factory_bot_rails --group development,test
|
|
773
|
-
bundle add byebug --group development,test
|
|
425
|
+
- Create `src/app.ts` with basic Express setup (middleware, health endpoint)
|
|
426
|
+
- Reference: https://expressjs.com/en/starter/hello-world.html
|
|
774
427
|
|
|
775
|
-
|
|
776
|
-
bundle install
|
|
777
|
-
```
|
|
428
|
+
**FastAPI:**
|
|
778
429
|
|
|
779
|
-
|
|
430
|
+
- Create `app/main.py` with basic FastAPI setup (CORS, health endpoint)
|
|
431
|
+
- Reference: https://fastapi.tiangolo.com/tutorial/first-steps/
|
|
780
432
|
|
|
781
|
-
|
|
433
|
+
**Docker Compose (if needed):**
|
|
782
434
|
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
dotnet new webapi -n MyApp
|
|
788
|
-
cd MyApp
|
|
435
|
+
- Reference official Docker Hub documentation:
|
|
436
|
+
- PostgreSQL: https://hub.docker.com/_/postgres
|
|
437
|
+
- MySQL: https://hub.docker.com/_/mysql
|
|
438
|
+
- MongoDB: https://hub.docker.com/_/mongo
|
|
789
439
|
|
|
790
|
-
|
|
791
|
-
dotnet add package Microsoft.EntityFrameworkCore.Design
|
|
792
|
-
dotnet add package Microsoft.EntityFrameworkCore.Tools
|
|
793
|
-
dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL
|
|
440
|
+
### 8.2.6.5: Final Summary
|
|
794
441
|
|
|
795
|
-
# Install latest authentication packages
|
|
796
|
-
dotnet add package Microsoft.AspNetCore.Authentication.JwtBearer
|
|
797
|
-
|
|
798
|
-
# Restore packages
|
|
799
|
-
dotnet restore
|
|
800
442
|
```
|
|
443
|
+
✅ Minimal enhancements complete!
|
|
801
444
|
|
|
802
|
-
|
|
445
|
+
Files created (2-3 max):
|
|
446
|
+
✅ .env.example (environment template)
|
|
447
|
+
✅ docker-compose.yml (if Docker selected)
|
|
448
|
+
✅ prisma/schema.prisma (if Prisma ORM)
|
|
803
449
|
|
|
804
|
-
-
|
|
805
|
-
|
|
806
|
-
- **Authentication structure ready but no specific endpoints**
|
|
807
|
-
- **Database configured with basic table (if ORM used)**
|
|
808
|
-
- **All development tools configured (linting, testing, etc.)**
|
|
450
|
+
🎯 Total: 2-3 files (vs 40-60 files in old approach)
|
|
451
|
+
📚 For Express/FastAPI starter code, refer to official documentation
|
|
809
452
|
|
|
453
|
+
Next steps:
|
|
454
|
+
1. Copy .env.example to .env and configure
|
|
455
|
+
2. Start database: docker-compose up -d (if applicable)
|
|
456
|
+
3. Run migrations: npm run db:migrate or equivalent
|
|
457
|
+
4. Start dev server: npm run start:dev or equivalent
|
|
458
|
+
5. Create features with /feature command
|
|
810
459
|
```
|
|
811
|
-
✅ Complete [FRAMEWORK] development environment ready!
|
|
812
|
-
✅ Database configured with Docker Compose
|
|
813
|
-
✅ ORM/Database layer configured
|
|
814
|
-
✅ Authentication structure ready
|
|
815
|
-
✅ API documentation configured (where applicable)
|
|
816
|
-
✅ Linting and formatting configured
|
|
817
|
-
✅ Testing framework configured
|
|
818
|
-
✅ All development scripts configured
|
|
819
460
|
|
|
820
|
-
|
|
821
|
-
|
|
461
|
+
**CRITICAL RULES:**
|
|
462
|
+
|
|
463
|
+
- ❌ **DO NOT** create entity modules (User, Product, Order, etc.)
|
|
464
|
+
- ❌ **DO NOT** create controllers/routes for business logic
|
|
465
|
+
- ❌ **DO NOT** create authentication endpoints
|
|
466
|
+
- ❌ **DO NOT** create complete folder structures
|
|
467
|
+
- ❌ **DO NOT** install 40+ packages manually
|
|
468
|
+
- ✅ **ONLY** create .env.example, docker-compose (optional), ORM init
|
|
469
|
+
- ✅ **LET** framework CLI handle structure, configs, dependencies
|
|
470
|
+
- ✅ **REFER** to official docs for starter code when needed
|
|
822
471
|
|
|
823
472
|
---
|
|
824
473
|
|
|
@@ -1119,7 +768,7 @@ The API will be available at `http://localhost:3000`
|
|
|
1119
768
|
|
|
1120
769
|
---
|
|
1121
770
|
|
|
1122
|
-
## 8.
|
|
771
|
+
## 8.7: Create Tool-Specific Configs
|
|
1123
772
|
|
|
1124
773
|
**Based on AI tool selection from Phase 3 (question 3.8):**
|
|
1125
774
|
|
|
@@ -1231,7 +880,7 @@ Generate all three files above.
|
|
|
1231
880
|
|
|
1232
881
|
---
|
|
1233
882
|
|
|
1234
|
-
## 8.
|
|
883
|
+
## 8.8: Final Validation & Success Message
|
|
1235
884
|
|
|
1236
885
|
```
|
|
1237
886
|
🔍 Validating all generated files...
|