Capstone Architecture
The capstone combines routing, forms, HTTP, and state management in one deployable production application.
Project Structure
src/app/
├── core/
│ ├── services/
│ │ ├── auth.service.ts
│ │ └── api.service.ts
│ ├── guards/
│ │ └── auth.guard.ts
│ ├── interceptors/
│ │ ├── auth.interceptor.ts
│ │ └── error.interceptor.ts
│ └── models/
│
├── shared/
│ ├── components/
│ │ ├── button/
│ │ ├── modal/
│ │ └── card/
│ ├── pipes/
│ └── directives/
│
├── features/
│ ├── auth/
│ │ ├── login/
│ │ ├── register/
│ │ └── auth.routes.ts
│ ├── dashboard/
│ │ ├── dashboard.component.ts
│ │ └── dashboard.routes.ts
│ ├── users/
│ │ ├── user-list/
│ │ ├── user-detail/
│ │ ├── user-form/
│ │ ├── user.service.ts
│ │ ├── user.facade.ts
│ │ └── users.routes.ts
│ └── admin/
│ ├── admin-dashboard/
│ └── admin.routes.ts
│
└── app.config.ts
Key Features
- Authentication — Login, register, JWT tokens, route guards
- CRUD Operations — Create, read, update, delete users
- State Management — NgRx or signals for shared state
- Reactive Forms — Complex forms with validation
- Routing — Lazy-loaded feature routes with guards
- HTTP — Typed API service with interceptors
- Error Handling — Global error interceptor with user feedback
- Performance — OnPush, lazy loading, trackBy, signals
CI/CD and Quality Gates
CI runs lint, unit tests, and Lighthouse budgets on every pull request before merge.
GitHub Actions Workflow
# .github/workflows/ci.yml
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- name: Lint
run: npm run lint
- name: Unit Tests
run: npm run test -- --watch=false --browsers=ChromeHeadless
- name: Build
run: npm run build
- name: Lighthouse CI
run: |
npm install -g @lhci/cli
lhci autorun
Quality Gates
| Gate | Tool | Threshold |
|---|---|---|
| Lint | ESLint | 0 errors |
| Unit tests | Jasmine | 100% pass |
| Build | Angular CLI | 0 errors |
| Bundle size | Budgets | < 1MB initial |
| Performance | Lighthouse | > 90 |
| Accessibility | Lighthouse | > 90 |
Feature Flags
// Using a feature flag service
@Injectable({ providedIn: 'root' })
export class FeatureFlagService {
private flags = signal<Record<string, boolean>>({
newDashboard: true,
betaFeature: false,
});
isEnabled(key: string): boolean {
return this.flags()[key] ?? false;
}
}
@if (featureFlags.isEnabled('newDashboard')) {
<app-new-dashboard />
} @else {
<app-old-dashboard />
}
Deployment Checklist
- All tests pass
- Lint passes with 0 errors
- Build succeeds
- Bundle budgets met
- Lighthouse score > 90
- Accessibility score > 90
- Feature flags configured
- Environment variables set
- Error monitoring configured (Sentry, etc.)
- Analytics configured
Quiz
1. What does the capstone project combine?
2. What quality gates should CI enforce?
3. What are feature flags used for?
Flashcards
Question
What does the capstone combine?
Click to reveal answer
Answer
Routing, forms, HTTP, state. One deployable app.
Question
CI quality gates?
Click to reveal answer
Answer
Lint, tests, build, budgets, Lighthouse.
Question
Feature flags for?
Click to reveal answer
Answer
Incremental shipping. Rollback without redeploys.
Revision Notes
Key Takeaways
- 1. Capstone combines all Angular patterns into one app
- 2. CI enforces lint, tests, build, budgets, Lighthouse
- 3. Feature flags enable incremental shipping
- 4. Deployment checklist ensures production readiness
Interview Tips
- • Explain the capstone architecture
- • Be ready to describe CI/CD quality gates
- • Mention feature flags for safe deployments
Cheat Sheet
Capstone Cheat Sheet
Architecture:
- core/ (services, guards, interceptors)
- shared/ (components, pipes)
- features/ (auth, dashboard, users, admin)
CI gates:
- Lint: 0 errors
- Tests: 100% pass
- Build: 0 errors
- Budgets: < 1MB
- Lighthouse: > 90
Feature flags:
isEnabled(key) { return this.flags()[key] ?? false; }