Angular Frontend Application¶
This project implements a Frontend Web Application using Angular, following a feature-based and modular architecture, aligned with enterprise standards and cloud-native best practices.
The application is designed to consume backend APIs securely, manage client-side state, and provide a scalable and maintainable user interface.
π Authentication Entry Point¶
This frontend application does not provide its own authentication flow.
The only authentication entry point for users is:
https://plataformas.logyca.com/
Authentication is fully handled by Azure AD B2C through the central platforms portal.
Users access this application by:
1. Authenticating in plataformas.logyca.com
2. Selecting the application via a card in the portal
3. Being redirected to this frontend with a valid authentication context
Direct access to this frontend without a valid session is not supported.
π§ Responsibilities of This Frontend¶
- Render the user interface and manage user interactions
- Consume backend APIs securely
- Handle client-side routing and navigation
- Manage application state and UI logic
- Validate the presence of a valid authentication session
- Rely exclusively on the central authentication portal
- Redirect unauthenticated users to
https://plataformas.logyca.com/ - Refresh authentication tokens before expiration
- Handle session expiration gracefully
π« Non-Responsibilities¶
- Business logic execution
- Direct database access
- Certificate or TLS management
- Backend authentication logic
- Infrastructure provisioning
The frontend must remain stateless, delegating all business and security decisions to backend services.
π Security Considerations¶
- Authentication is centralized in Azure AD B2C
- This frontend must not implement a login page
- This frontend must not initiate authentication flows
- Access tokens are issued by Azure AD B2C with a 1-hour expiration
- The frontend must refresh tokens automatically before expiration
- When the session expires or token refresh fails:
- The user must be redirected to: https://plataformas.logyca.com/
- Tokens must never be persisted insecurely or exposed
- All API calls must include a valid, non-expired access token
π Authentication Lifecycle / Session Expiration and Redirection Flow¶
- The frontend assumes a valid authentication context upon entry
- Token expiration is evaluated on each protected API call
- If the access token expires and refresh fails:
- The local session is cleared
- The user is redirected to
https://plataformas.logyca.com/ - The frontend must never attempt silent or interactive login on its own
π± Configuration & Environment Strategy¶
- Environment-specific configuration is handled via:
environment.tsenvironment.{environment}.ts- Build-time configuration is injected during CI/CD
- No environment-specific logic should be hardcoded in components
π Recommended Folder Structure¶
(Angular Frontend Application)
This structure promotes separation of concerns, feature encapsulation, and long-term maintainability.
frontend-angular/
β
ββ .vscode/ # Editor configuration
ββ arm/ # Infrastructure templates (ARM/Bicep)
ββ docs/ # Frontend documentation
β
ββ src/
β ββ app/ # Application modules and features
β β ββ example-component/ # Example feature component
β β ββ home/ # Home feature
β β ββ log-in/ # Authentication views
β β ββ navbar/ # Navigation components
β β ββ interceptors/ # HTTP interceptors (auth, logging)
β β ββ modules/ # Feature and shared modules
β β ββ shared/ # Shared components, pipes, directives
β β β
β β ββ app-routing.module.ts # Application routing
β β ββ app.component.ts # Root component
β β ββ app.component.html
β β ββ app.component.scss
β β ββ app.component.spec.ts
β β ββ app.module.ts # Root module
β β
β ββ assets/ # Static assets
β β ββ azure-storage/ # Azure-related static assets
β β ββ images/ # Images and icons
β β
β ββ environments/ # Environment configuration
β β ββ environment.ts # Base environment
β β ββ environment.development.ts # Development
β β ββ environment.release.ts # Release
β β ββ environment.prod.ts # Production
β β
β ββ globalStyles/ # Global SCSS styles
β β ββ mixins.scss
β β ββ utilities.scss
β β ββ variables.scss
β β
β ββ custom-theme.scss # Application theme
β ββ styles.scss # Global styles entry point
β ββ index.html # Application HTML shell
β ββ main.ts # Application bootstrap
β ββ polyfills.ts # Browser polyfills
β ββ test.ts # Test bootstrap
β
ββ .browserslistrc # Browser support configuration
ββ .editorconfig # Code style rules
ββ .gitignore
β
ββ angular.json # Angular workspace configuration
ββ karma.conf.js # Unit testing configuration
ββ package.json # NPM dependencies and scripts
ββ package-lock.json
β
ββ tsconfig.json # TypeScript base config
ββ tsconfig.app.json # App-specific TS config
ββ tsconfig.spec.json # Test-specific TS config
β
ββ Dockerfile # Container image definition
β
ββ pipelines-develop.yml # CI/CD pipeline (development)
ββ pipelines-master.yml # CI/CD pipeline (main/master)
β
ββ README.md # Frontend overview and usage