How absterrg0/angular-project works
Project type and purpose
• This is a single-page web application (SPA) built with Angular (v18) that lets end-users browse and search movie/TV show trailers.
• There is no custom backend in the repo; all data comes from the external TMDB REST API.
Main components of the system
a. Hosting / Delivery Layer
• Static file host (e.g. Firebase Hosting, Netlify or any CDN) serves the compiled Angular bundle (index.html, CSS, JS, assets).
b. Client‐side Application
• AppModule
• Imports RouterModule, HttpClientModule, and declares all feature and shared components.
• Routing Layer (app-routing.module.ts)
• Defines routes → Home, Movies, TV, Genre, Person, Search, etc.
• Feature Components (src/app/components/...)
• HomeComponent, MoviesComponent, TvComponent, GenreComponent, MoviesInfoComponent, TvInfoComponent, PersonComponent, SearchComponent, MovieCategoryComponent, TvCategoryComponent
• Shared/Global Components (src/app/components/global/...)
• Carousel, Episodes, Footer, Hero, Images, Listing, Media, Modal, Navbar, Slider, Videos + a set of presentation pipes under pipe/
• API Service (src/app/api/api.service.ts)
• Centralized Angular service injecting HttpClient to call TMDB endpoints (search, discover, details, trailers).
• Assets & Styling (src/assets/css, src/assets/images)
• Global SCSS, base styles, component‐level CSS.
c. External Service
• TMDB REST API (third-party).
Relationships and data flow
• User’s browser requests index.html + JS/CSS assets from the Static Host.
• Angular bootstraps AppModule → Router determines which feature component to render.
• A component (e.g. MoviesComponent) injects ApiService → issues HTTP GET to TMDB API → receives JSON payload → component binds data into templates.
• User interactions (search, pagination) trigger new service calls or route navigation.
Architectural patterns & design principles
• Component‐based architecture (UI broken into reusable, decoupled pieces).
• Service abstraction (all HTTP logic centralized in ApiService).
• Single Responsibility (each component is focused on one view / feature).
• Routing separation (feature components driven by RouterModule).
• Presentation vs. Container pattern (global components are dumb/presentational; pages orchestrate data fetching).
Capturing essential elements
• Don’t over‐modularize: group related components under “Feature Modules” or “Shared Module.”
• Single service entry point for data.
• Boundary between your code and the external API.
• Notes on technologies: Angular CLI, TypeScript, HttpClientModule, SCSS, RouterModule.