Galactic Archives Series

June 1, 2025

Galactic Archives Series

A comprehensive guide to building efficient data sources in Angular using the Star Wars API.

This series explores advanced patterns for handling paginated data in Angular applications. Using the Star Wars API (SWAPI) as our data source, we'll build a robust, reusable solution for displaying and navigating large datasets.

Live Demo: https://aaronmaturen.com/galactic-archives/

Source Code: github.com/aaronmaturen/galactic-archives

What You'll Learn

  • Creating custom data sources in Angular
  • Handling paginated APIs efficiently
  • Implementing virtual scrolling
  • Managing complex state with RxJS
  • Building reusable, testable components

Table of Contents

Foundation Phase

  1. Introduction - Introduces the DataSource pattern concept and outlines the plan to build a Star Wars data explorer application called "Galactic Archives"
  2. Basic Project Setup - Creates the Angular project with standalone components, sets up Angular Material and Tailwind CSS with tw- prefix
  3. Code Quality Setup - Implements ESLint, Prettier, and Husky pre-commit hooks to ensure consistent code style
  4. Testing Setup - Configures Jest for unit testing and Playwright for E2E testing with CI integration

Architecture Phase

  1. Feature-Based Architecture - Organizes the application using feature modules, smart/dumb component patterns, and lazy loading
  2. Star Wars API Service - Builds a robust HTTP client service with TypeScript interfaces for SWAPI endpoints
  3. API Mocking with MSW - Sets up Mock Service Worker to intercept and mock SWAPI requests for reliable testing

Core DataSource Implementation Phase

  1. DataSource Foundation - Creates a custom Angular DataSource implementation with reactive state management
  2. Implementing Pagination - Adds client and server-side pagination with infinite scrolling for large datasets
  3. Adding Sorting - Implements multi-column sorting with custom comparators for complex data types
  4. Implementing Filtering - Builds advanced search filters with dynamic query parameters for Star Wars data

UI Enhancement & Deployment Phase

  1. Star Wars Theming - Implements custom Star Wars UI elements, dark mode, and performance optimizations
  2. CI/CD with GitHub Actions - Sets up automated builds, testing, and deployment to GitHub Pages

Prerequisites

  • Basic knowledge of Angular and TypeScript
  • Familiarity with RxJS observables
  • Understanding of HTTP client operations

Project Evolution Overview

This document provides an analysis of the blog post series, demonstrating how each post builds incrementally on the previous one to create a complete Angular application implementing the DataSource pattern with the Star Wars API.

Join me on this journey through the galaxy of Angular data management, where we'll tackle common challenges and build solutions that you can apply to your own projects.