How michaeljota/angular-microfrontend works
Project type and purpose
• This is a single-page application (SPA) built with Angular CLI (v15.2.2).
• Its purpose is to manage users: logging in/out, adding users, listing users, and displaying a dashboard.
File structure
• src/app/app.module.ts and app-routing.module.ts define the root module and top-level routes.
• src/app/features contains four lazily loaded feature modules:
• -user
• dashboard
• login
• user-list
• src/app/shared holds cross-cutting concerns:
• shared/auth (AuthService, guards)
• shared/users (UsersService)
• src/app/models contains data interfaces (User).
• Standard Angular config files at the root, no backend code here.
Key insights from README
• Angular CLI scaffolding, dev server, build, and test commands.
Main components & their interactions
a. Frontend SPA (Angular)
• Core Module (AppModule + AppComponent + AppRoutingModule)
• Feature Modules (lazily loaded by router): login, dashboard, add-user, user-list
• Shared Module (AuthService, UsersService, guards)
• Models (User)
• Assets (static files, styles)
b. External Backend API
• A REST service that AuthService and UsersService call over HTTP
c. Browser & User
• Browser makes HTTP requests and renders UI
Architectural patterns & principles
• Modularization: root, feature, and shared modules
• Lazy loading: each feature module is only loaded when its route is activated
• Dependency Injection: services are injected into components/guards
• Router-based navigation with guards enforcing authentication
• Separation of concerns: UI components vs. services vs. models
Summary of steps
6. Components to services (dependency injection).