Aibar SRL App follows a layered Angular architecture with three clear zones —Documentation Index
Fetch the complete documentation index at: https://mintlify.com/lucavallini/aibar-frontend/llms.txt
Use this file to discover all available pages before exploring further.
core, features, and shared — all wired together by a centralized router configuration and a functional HTTP interceptor. Every component in the application is an Angular standalone component; there are no NgModule declarations. Reactive state is managed through Angular’s signal() primitive, and all cross-cutting concerns such as authentication and HTTP token injection are handled once at the application level rather than inside individual features.
Directory Structure
The entire application lives undersrc/app/. The three top-level subdirectories each have a distinct responsibility:
Layer Responsibilities
Core Layer
Contains everything that must exist as a single instance for the lifetime of the application: injectable services (
AuthService, ViajesService, etc.), typed domain models, the two route guards (authGuard, adminGuard), and the authInterceptor. Nothing in core/ depends on a specific feature.Features Layer
Each subdirectory under
features/ maps to one business domain and one application route. Feature components are standalone, import only what they need from @angular/common, @angular/forms, and shared/, and inject their domain service directly. There is no cross-feature dependency.Shared Layer
Houses components that are used by two or more features:
ConfirmarComponent (delete confirmation dialog), HeaderComponent (top bar with user info and logout), PaginacionComponent (page controls), and SidebarComponent (navigation links). The Layout component in shared/layout/ wraps all authenticated routes and renders the header and sidebar around the active feature.Routing & Guards
app.routes.ts defines all routes in one file. authGuard protects the entire authenticated shell; adminGuard further restricts the /auditoria and /usuarios routes to the administrador role. Unauthorized navigation is intercepted before any component renders.Routing Configuration
All routes are defined insrc/app/app.routes.ts. The structure uses a single parent route with the Layout shell component and authGuard, with feature routes as children:
/loginis fully public — no guard.- All other routes are children of the
Layoutshell, which is protected byauthGuard. Any unauthenticated navigation attempt redirects to/login. /viajes,/choferes,/camiones,/multas, and/combustibleare accessible to any authenticated user regardless of role./auditoriaand/usuarioshaveadminGuardapplied and are only accessible to users whose JWT payload contains"rol": "administrador". Employees who navigate to these paths are redirected to/viajes.- The root path
/redirects to/viajesviaredirectTo: 'viajes'.
HTTP Interceptor
TheauthInterceptor in src/app/core/interceptors/auth.interceptor.ts is a functional HttpInterceptorFn that runs on every outgoing HTTP request:
sessionStorage under the key aibar_token, the interceptor clones the outgoing request and adds an Authorization: Bearer <token> header before forwarding it. Requests made before login (i.e., the login POST itself) are forwarded unmodified.
Application Bootstrap and Providers
The application is bootstrapped insrc/main.ts using Angular’s standalone bootstrapApplication API:
src/app/app.config.ts:
provideRouter(routes) registers the full route table. provideHttpClient(withInterceptors([authInterceptor])) sets up Angular’s HTTP client and attaches the authInterceptor to the interceptor chain. There is no root NgModule — the entire configuration is expressed as a plain object.
Reactive State with Angular Signals
All feature components manage local state using Angular’ssignal() primitive rather than RxJS subjects or imperative property assignments. Services such as AuthService expose signals directly:
.set() or .update(). This makes change detection boundaries explicit and avoids the overhead of zone-based dirty checking for local component state.