π https://alobuuls.github.io/angular-harry-potter-api/
Note
Angular 12 application that consumes the Harry Potter API to display character information through a modular architecture following Angular best practices.
The project demonstrates API consumption, route guards, HTTP interceptors, reactive forms, RxJS operators, custom pipes, centralized error handling, and scalable application structure.
Before running the project, make sure you have installed:
- π¦ Node.js:
v12.14.x β v14.x(recommended: v14.21.3 LTS) - π¦ npm:
v6+ π °οΈ Angular CLI:v12.x
Run the following commands in your terminal:
node -v
npm -v
ng versiongit clone git@github.com:alobuuls/angular-harry-potter-api.git
cd angular-harry-potter-apinpm installStart the development server:
ng serveThen open:
http://localhost:4200
The application follows a modular Angular architecture focused on scalability, maintainability, and separation of concerns.
Responsible for:
- Application-wide functionality
- Navigation menu
- Shared core features
Responsible for:
- Harry Potter character listing
- Search functionality
- API data presentation
Responsible for:
- Protected routes
- Route guard implementation
- Navigation control
Responsible for:
- Harry Potter API communication
- Data transformation
- Centralized error handling
Responsible for:
- Global HTTP request modification
- API request configuration
- Cross-cutting concerns
Responsible for:
- Custom pipes
- Shared resources
- Reusable functionality
Responsible for:
- Route protection
- Unsaved changes prevention
- Navigation validation
- π§ Harry Potter character listing
- π Character search
- π‘ REST API consumption
- β‘ Reactive programming with RxJS
- π‘οΈ Route Guards
- π« Unsaved Changes Guard
- π HTTP Interceptors
- π§© Custom Pipes
- π Reactive Forms
- β Centralized Error Handling
- π― Strong typing with TypeScript
- π¦ Modular Angular architecture
| Technology | Purpose |
|---|---|
| Angular 12 | Framework |
| TypeScript | Application Logic |
| RxJS | Reactive Programming |
| Angular Router | Navigation |
| Angular HttpClient | API Communication |
| Reactive Forms | Form Management |
| Route Guards | Route Protection |
| HTTP Interceptors | Request Handling |
| HTML5 | Structure |
| CSS3 | Styling |
angular-harry-potter-api/
βββ src/
β
βββ app/
β β
β βββ core/
β β βββ menu/
β β βββ core.module.ts
β β
β βββ pages/
β β βββ characters/
β β βββ protected/
β β
β βββ services/
β β βββ hp.service.ts
β β βββ error-handler.service.ts
β β
β βββ interceptors/
β β βββ api-hp.interceptor.ts
β β βββ global-headers.interceptor.ts
β β
β βββ guard/
β β βββ auth.guard.ts
β β βββ form-unsaved.guard.ts
β β
β βββ shared/
β β βββ pipes/
β β βββ shared.module.ts
β β
β βββ interfaces/
β β βββ hp.api.interface.ts
β β βββ stucture-data-api.interface.ts
β β
β βββ helpers/
β β βββ init-with-status.helper.ts
β β
β βββ app.module.ts
β βββ app.routes.ts
β βββ app.routing.module.ts
β
βββ environments/
β βββ environment.ts
β βββ environment.prod.ts
β
βββ angular.json
βββ package.json
βββ tsconfig.json
βββ README.md
- Modular Angular architecture
- Separation of concerns
- Strong typing with TypeScript interfaces
- Reactive programming with RxJS
- Route Guards implementation
- Unsaved Changes Guard pattern
- HTTP Interceptors
- Reusable custom pipes
- Centralized error handling
- Shared module architecture
- Service abstraction
- Scalable project structure
Practice and strengthen Angular development concepts through the implementation of a real-world API-driven application:
- REST API Consumption
- Angular Modules
- Route Guards
- HTTP Interceptors
- Reactive Forms
- RxJS Operators
- Custom Pipes
- Error Handling
- TypeScript Interfaces
- Front-End Architecture
This project is intended for educational and portfolio purposes.
Created by Alondra Francisco.