|
| 1 | +# Architecture |
| 2 | + |
| 3 | +`start-it-cli` is organized around a typed generation pipeline. |
| 4 | + |
| 5 | +## Main Flow |
| 6 | + |
| 7 | +1. `src/cli.ts` |
| 8 | +2. `src/workflow.ts` |
| 9 | +3. `src/generator.ts` |
| 10 | +4. stack-specific generator |
| 11 | +5. AI-control artifact injection |
| 12 | + |
| 13 | +## Pipeline Stages |
| 14 | + |
| 15 | +### 1. CLI Input |
| 16 | + |
| 17 | +`src/cli.ts` handles: |
| 18 | + |
| 19 | +- interactive prompts |
| 20 | +- command-line flags |
| 21 | +- partial prompt fallback |
| 22 | +- normalization into `ProjectConfig` |
| 23 | + |
| 24 | +`ProjectConfig` is the contract between the CLI and generation logic. |
| 25 | + |
| 26 | +### 2. Workflow Registry |
| 27 | + |
| 28 | +`src/workflow.ts` defines: |
| 29 | + |
| 30 | +- available app types |
| 31 | +- available stacks per app type |
| 32 | +- framework inference per stack |
| 33 | + |
| 34 | +## Generation Paths |
| 35 | + |
| 36 | +### Backend |
| 37 | + |
| 38 | +Backend generation is mostly builder-based. |
| 39 | + |
| 40 | +- `src/templates/node.ts` |
| 41 | +- `src/templates/nest.ts` |
| 42 | +- `src/templates/fastapi.ts` |
| 43 | + |
| 44 | +Those return `TemplateConfig` objects that are written to disk by `src/generator.ts`. |
| 45 | + |
| 46 | +### Frontend |
| 47 | + |
| 48 | +Frontend generation uses a baseline-plus-customization model. |
| 49 | + |
| 50 | +- `src/frontend/scaffold.ts` |
| 51 | + |
| 52 | +Behavior: |
| 53 | + |
| 54 | +- prefer provider-native baseline when possible |
| 55 | +- fall back to local baseline when necessary |
| 56 | +- apply deterministic customizations afterward |
| 57 | + |
| 58 | +### AI / ML |
| 59 | + |
| 60 | +AI/ML generation is deterministic and direct-to-filesystem. |
| 61 | + |
| 62 | +- `src/aiml/scaffold.ts` |
| 63 | + |
| 64 | +### DSA |
| 65 | + |
| 66 | +DSA generation is deterministic and workspace-oriented. |
| 67 | + |
| 68 | +- `src/dsa/scaffold.ts` |
| 69 | + |
| 70 | +## AI Guidance Layer |
| 71 | + |
| 72 | +Every generated project gets: |
| 73 | + |
| 74 | +- `.cursorrules` |
| 75 | +- `.agentignore` |
| 76 | +- `docs/AGENTS.md` |
| 77 | +- `docs/instructions.md` |
| 78 | + |
| 79 | +Composition lives in: |
| 80 | + |
| 81 | +- `src/agent/composer.ts` |
| 82 | + |
| 83 | +The guidance system is layered: |
| 84 | + |
| 85 | +- shared blocks |
| 86 | +- profile blocks |
| 87 | +- app-type blocks |
| 88 | +- stack blocks |
| 89 | +- option blocks |
| 90 | +- operational composition |
| 91 | + |
| 92 | +## Legacy AI Path |
| 93 | + |
| 94 | +There is still a secondary AI path in: |
| 95 | + |
| 96 | +- `src/ai/generator.ts` |
| 97 | +- `src/ai/provider.ts` |
| 98 | + |
| 99 | +This path can use an inference provider or a rule-based fallback. It is not the main generation flow anymore. |
0 commit comments