Skip to content

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.ts
  • environment.{environment}.ts
  • Build-time configuration is injected during CI/CD
  • No environment-specific logic should be hardcoded in components

(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