Technical solution implemented by Rubén Sánchez.
This project is built following Software Engineering principles, prioritizing Scalability, Performance (Core Web Vitals), and No external libraries beyond Angular ecosystem.
Requirements: Node.js v20+. (Angular CLI is included as a dev dependency)
npm installnpm startNavigate to http://localhost:4200.
npm testI have chosen a Vertical Slicing (Feature-First) architecture combined with Hexagonal Architecture principles to ensure a decoupled and maintainable codebase.
Pure Business Logic. Contains the Truth of the application.
- Models:
Pet. - Repository Interfaces:
PetRepository(The contract). - Strategies:
PetHealthStrategy(Logic for calculating health status).
Implementation Details. How data is retrieved.
- HttpRepository: Implementation of the Domain Repository using
HttpClient. - Mappers:
PetMappertransforms raw API DTOs into clean Domain Models.
Presentation Layer.
- Pages: Smart components (e.g.,
PetListComponent) that orchestrate data via Signals and handle routing. - Components: Dumb/Presentational components (e.g.,
PetCard,PetSearchInput) focusing on rendering and user interaction.
- Server-side sorting, pagination, and filtering driven by URL query params (deep-linkable and shareable).
- Navigation preserves list state (sort/order/page/filters) when opening a pet detail and coming back to home.
- Pet of the Day is deterministic per calendar day and cached during navigation so it remains stable all day.
- Reactive UI: Powered by Angular Signals (signal/computed/effect/toSignal).
- Clean Architecture: Strict separation of concerns using Hexagonal Principles (Domain, Infrastructure, UI).
- Modern Testing: Vitest for instant feedback and superior developer experience.
- Zero-Dependency i18n: Custom lightweight Internationalization service implemented from scratch.
- Optimized UX:
- Skeleton Loading states.
- Debounced Search & filtering.
- Framework: Angular 21 (Standalone Components, Signals, Control Flow).
- Language: TypeScript (Strict Mode).
- Styling: SCSS (Native CSS Grid/Flexbox).
- Testing: Vitest (Unit & Integration).
The project uses Vitest for unit and integration testing, focusing on:
- Mappers: Ensuring data integrity from API to Domain.
- Components/Domain: Verifying business logic like Health calculation and Pet of the Day flow.
- DOM mocking: Handling native elements like
<dialog>in a test environment.
To view the original requirements of this technical test, please refer to CHALLENGE.md.