This project visualizes data from SWAPI (https://swapi.dev) as a modern, reactive web app.
It provides list and detail views for Films, People, and Vehicles, including master–detail relations (e.g., Film → Characters/Planets/Vehicles).
Tech highlights: Angular 20 (standalone components), Signals-only state, zoneless change detection, new template control flow (
@for,@if), RxJS only for I/O, slim in-memory caches, responsive UI.
- 3 root resources: Films, People, Vehicles as dedicated lists with detail pages.
- Master–detail: Film details load and show related Characters, Planets, and Vehicles via SWAPI URLs.
- Efficient fetching: de-duplicated requests; list cache and detail cache (in-memory) to avoid redundant loads.
- Signals everywhere: loading/error/data as signals; components use
computed()instead of manual subscriptions. - Roman pipe: episode numbers are rendered as Roman numerals (e.g., “Episode IV”).
- Responsive layout: adaptive navigation (hamburger/context menu), clean typography, large touch targets.
- “Hyperspace” home: subtle CSS star-burst animation that respects
prefers-reduced-motion.
- Framework: Angular 20, standalone components, zoneless (
provideZonelessChangeDetection). - State: Signals for data/loading/error. No NgRx dependency.
- I/O: RxJS for HTTP calls; services encapsulate fetching and caching.
- Templates: modern control flow
@for/@if. - Caching:
- List cache per resource (e.g., all films loaded once → reused).
- Detail cache per URL/ID (simple, no TTL for this challenge scope).
Component (List/Detail)
│ reads signals
▼
Service (Films/People/Vehicles)
│ fetches via HttpClient, updates signals & caches
▼
SWAPI (https://swapi.dev/api/…)
(excerpt – can vary slightly)
src/
├─ app/
│ ├─ components/
│ │ ├─ films/ # FilmList, FilmDetails, RomanPipe
│ │ ├─ people/ # PeopleList, People details
│ │ ├─ vehicles/ # VehicleList, Vehicle details
│ │ └─ shared/ # UI atoms (Loading, Error, Chips, Buttons, Card, …)
│ ├─ cores/
│ │ ├─ models/ # Film, People, Planet, Vehicle, enums
│ │ └─ services/ # FilmService, PeopleService, PlanetService, VehicleService, HelperService
│ ├─ app.routes.ts
│ ├─ app.config.ts
│ └─ ...
└─ assets/
└─ images/ # Logos, icons
- Node.js ≥ 20 (LTS recommended)
- npm (or pnpm/yarn)
- Optional: Angular CLI (
npm i -g @angular/cli)
# 1) Clone
git clone https://github.com/payam2104/starwars.git
cd starwars
# 2) Install dependencies
npm install
# or: pnpm install / yarn installThis project was generated (and/or is compatible) with Angular CLI 20.1.x.
Start a local dev server:
ng serve
or
npm startOpen your browser at http://localhost:4200/. The app auto-reloads on source changes.