3.7 KiB
3.7 KiB
name, description
| name | description |
|---|---|
| scaffold-project | Generate complete Angular 17+ project structure with Router-First architecture, lazy loading, and enterprise patterns |
Generate a production-ready Angular 17+ project structure following Router-First methodology.
What You'll Create
A complete enterprise Angular project with:
- ✅ Router-First architecture
- ✅ Lazy-loaded feature modules
- ✅ Core module (singletons)
- ✅ Shared module (reusables)
- ✅ TypeScript strict mode
- ✅ Standalone components
- ✅ Proper folder organization
Project Information Needed
Ask the user for:
- Project name - kebab-case (e.g.,
my-enterprise-app) - Key features - What features does the app need? (e.g., dashboard, users, reports)
- Team size - Small (2-5), Medium (5-20), Large (20+)
- Authentication needed? - Yes/No
- Additional requirements - Any special needs (GIS, real-time, offline)?
Generation Steps
- Create root structure with app.routes.ts, app.config.ts
- Set up core module with services, guards, interceptors
- Create shared module with common components
- Generate feature modules with lazy loading
- Configure TypeScript with strict mode
- Set up routing with guards and data
- Add layout components (header, sidebar, footer)
- Generate example components for each feature
Example Output Structure
src/app/
├── core/
│ ├── services/
│ │ ├── auth.service.ts
│ │ └── api.service.ts
│ ├── guards/
│ │ └── auth.guard.ts
│ ├── interceptors/
│ │ └── auth.interceptor.ts
│ └── models/
│ └── user.interface.ts
│
├── shared/
│ ├── components/
│ │ ├── loading-spinner/
│ │ └── error-message/
│ └── pipes/
│ └── time-ago.pipe.ts
│
├── features/
│ ├── dashboard/
│ │ ├── components/
│ │ ├── dashboard.routes.ts
│ │ └── dashboard.component.ts
│ └── users/
│ ├── components/
│ ├── users.routes.ts
│ └── users.component.ts
│
├── layout/
│ ├── header/
│ ├── sidebar/
│ └── main-layout.component.ts
│
├── app.routes.ts
├── app.config.ts
└── app.component.ts
Configuration Files to Generate
tsconfig.json (strict mode)
{
"compilerOptions": {
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"noUnusedLocals": true,
"noUnusedParameters": true
}
}
angular.json (performance budgets)
{
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
}
]
}
Best Practices to Include
- All components use
standalone: true - All routes use lazy loading except root
- Separate files for templates/styles (no inline)
- Guards use functional style (Angular 14+)
- Services use
inject()function - Components use signals for state
Output Format
Provide:
- Complete folder tree showing all files
- Key file contents (app.routes.ts, core services, example components)
- Installation commands for dependencies
- Next steps for development
- Architecture decision rationale - Why this structure?
Usage
# In Claude Code
/angular-architecture:scaffold-project
# Or natural language
"Use angular-architect to scaffold a new e-commerce project with 4 features"
Notes
- Adapt complexity based on team size
- Small teams: simpler structure
- Large teams: more abstraction and tooling
- Always document architectural decisions in README