How ariludev/serviciosweb works
1. System purpose and runtime shape
Restaurantito is a JHipster 9.1-generated full-stack application: an Angular single-page application (SPA) is served alongside a Java/Spring Boot backend. The implemented business surface is currently identity, account lifecycle, user administration, authority management, and operational administration; no restaurant-domain entities appear in the tree.
Backend entry points are src/main/java/com/edosushi/RestaurantitoApp.java (executable Spring Boot app) and src/main/java/com/edosushi/ApplicationWebXml.java (WAR deployment). Frontend boots from src/main/webapp/main.ts through src/main/webapp/bootstrap.ts.
2. Angular SPA composition
Angular routing and dependency configuration form the client composition root:
• src/main/webapp/app/app.config.ts
• src/main/webapp/app/app.routes.ts
• src/main/webapp/app/app.ts
The SPA is structured around account flows, login, home/layout, admin operational pages, and generated user/authority management pages. Feature routes render within the main layout. Spanish UI translations are present under src/main/webapp/i18n/es/; backend messages also support default and Spanish bundles.
3. Client authentication and HTTP boundary
The client authentication layer holds account state, acquires JWTs, and protects routes:
• src/main/webapp/app/core/auth/account.service.ts
• src/main/webapp/app/core/auth/auth-jwt.service.ts
• src/main/webapp/app/core/auth/user-route-access.service.ts
Global HTTP interceptors attach auth, react to expiry, normalize errors, and issue notifications:
• src/main/webapp/app/core/interceptor/auth.interceptor.ts
• src/main/webapp/app/core/interceptor/auth-expired.interceptor.ts
• src/main/webapp/app/core/interceptor/error-handler.interceptor.ts
Primary client flow: route guard → feature service HTTP call → interceptor adds JWT → Spring REST endpoint → response updates UI/account state. The backend’s SPA filter handles browser-side route fallback.
4. REST, account, and administration layer
Spring MVC resources expose the API boundary for authentication, self-service account operations, public users, authorities, and administrator user management:
• src/main/java/com/edosushi/web/rest/AuthenticateController.java
• src/main/java/com/edosushi/web/rest/AccountResource.java
• src/main/java/com/edosushi/web/rest/UserResource.java
Request view models isolate login/managed-user payloads, while centralized exception translation maps failures to HTTP problem responses:
• src/main/java/com/edosushi/web/rest/vm/LoginVM.java
• src/main/java/com/edosushi/web/rest/errors/ExceptionTranslator.java
• src/main/java/com/edosushi/web/filter/SpaWebFilter.java
5. Security and user-domain core
Security is Spring Security with JWT configuration, domain-backed user lookup, authorities, and audit identity:
• src/main/java/com/edosushi/config/SecurityConfiguration.java
• src/main/java/com/edosushi/config/SecurityJwtConfiguration.java
• src/main/java/com/edosushi/security/DomainUserDetailsService.java
The core persisted model is User plus Authority, with a shared audit base. UserService implements registration, activation, password reset/change, and admin user operations; mail delivery supports lifecycle emails:
• src/main/java/com/edosushi/domain/User.java
• src/main/java/com/edosushi/service/UserService.java
• src/main/java/com/edosushi/service/MailService.java
6. Persistence, configuration, and lifecycle
Spring Data repositories persist users and roles. Database schema and seed users/authorities are managed through Liquibase:
• src/main/java/com/edosushi/repository/UserRepository.java
• src/main/resources/config/liquibase/master.xml
• src/main/resources/config/liquibase/changelog/00000000000000_initial_schema.xml
Profile-specific application behavior resides in:
• src/main/resources/config/application.yml
• src/main/resources/config/application-dev.yml
• src/main/resources/config/application-prod.yml
Configuration covers database connectivity, caching, async execution, JSON/Hibernate behavior, logging, static resources, TLS, and security. Mail templates are a backend-to-email-provider boundary under src/main/resources/templates/mail/.
7. Build, deployment, and observability
Maven packages the Java service and integrates the Angular build; Angular CLI/esbuild builds the browser bundle. Production can be executable JAR or WAR (pom.xml, angular.json).
Docker Compose provides PostgreSQL and complete app/service orchestration:
• src/main/docker/postgresql.yml
• src/main/docker/services.yml
• src/main/docker/app.yml
Operational monitoring is provisioned with Prometheus and Grafana, while JHipster Control Center and SonarQube are optional external services:
• src/main/docker/monitoring.yml
• src/main/docker/prometheus/prometheus.yml
• src/main/docker/jhipster-control-center.yml
Main entry points: AccountResource.java Auth, account & user API · RestaurantitoApp.java Spring Boot application · UserRepository.java Users & authorities persistence · app.routes.ts Account, login & admin pages
Components 21
Angular SPA
- SPA bootstrap
src/main/webapp/main.ts - App routes & providers
src/main/webapp/app/app.config.ts - Account, login & admin pages
src/main/webapp/app/app.routes.ts - Client auth state
src/main/webapp/app/core/auth/account.service.ts - Route access guard
src/main/webapp/app/core/auth/user-route-access.service.ts - JWT & error interceptors · Adds tokens and handles expired or failed API calls.
src/main/webapp/app/core/interceptor/auth.interceptor.ts
Spring API
- Spring Boot application
src/main/java/com/edosushi/RestaurantitoApp.java - SPA route fallback
src/main/java/com/edosushi/web/filter/SpaWebFilter.java - Auth, account & user API
src/main/java/com/edosushi/web/rest/AccountResource.java - Problem response translation
src/main/java/com/edosushi/web/rest/errors/ExceptionTranslator.java
Security & Domain
- JWT security configuration
src/main/java/com/edosushi/config/SecurityJwtConfiguration.java - Domain user lookup
src/main/java/com/edosushi/security/DomainUserDetailsService.java - User lifecycle service · Registration, activation, password lifecycle, and admin user operations.
src/main/java/com/edosushi/service/UserService.java - Lifecycle mail delivery
src/main/java/com/edosushi/service/MailService.java - User & authority model
src/main/java/com/edosushi/domain/User.java
Data & Operations
- Users & authorities persistence
src/main/java/com/edosushi/repository/UserRepository.java - Schema & seed data
src/main/resources/config/liquibase/master.xml - PostgreSQL
src/main/docker/postgresql.yml - Profile configuration
src/main/resources/config/application.yml - Maven + Angular build · Packages the backend and browser bundle as JAR or WAR.
pom.xml - Prometheus & Grafana
src/main/docker/monitoring.yml
Connections 24
- SPA bootstrap → App routes & providers: boots
- App routes & providers → Account, login & admin pages: configures
- Account, login & admin pages → Route access guard: protects routes with
- Route access guard → Client auth state: checks
- Account, login & admin pages → JWT & error interceptors: API calls pass through
- Client auth state → JWT & error interceptors: supplies JWT
- JWT & error interceptors → Auth, account & user API: HTTP / REST
- Spring Boot application → Auth, account & user API: hosts
- Spring Boot application → SPA route fallback: installs
- SPA route fallback → SPA bootstrap: serves SPA fallback
- Auth, account & user API → JWT security configuration: secured by
- Auth, account & user API → User lifecycle service: account and admin operations
- Auth, account & user API → Problem response translation: failures mapped by
- JWT security configuration → Domain user lookup: authenticates via
- Domain user lookup → Users & authorities persistence: loads users from
- User lifecycle service → Users & authorities persistence: persists through
- Users & authorities persistence → User & authority model: maps
- Users & authorities persistence → PostgreSQL: reads and writes
- User lifecycle service → Lifecycle mail delivery: sends lifecycle mail
- Schema & seed data → PostgreSQL: migrates and seeds
- Profile configuration → Spring Boot application: configures
- Maven + Angular build → Spring Boot application: packages
- Maven + Angular build → SPA bootstrap: bundles
- Prometheus & Grafana → Spring Boot application: monitors