> Canonical URL: https://codingcat.dev/course/angularmaterial/lesson/angular-material-dynamic-navigation-using-firestore

# Angular Material Dynamic Navigation using Firestore | Angular Material | CodingCat.dev Course

[🧶 Angular Material](/course/angularmaterial)Section 1.5 · Lesson 5 of 8[![](/logos/tags/angular-symbol-light.svg)![](/logos/tags/angular-symbol-dark.svg)Angular](/topic/angular)[![](/logos/firebase/firebase-symbol.png)![](/logos/firebase/firebase-symbol.png)Firebase](/topic/firebase)[← Prev Lesson](/course/angularmaterial/lesson/angular-material-theming)[Next Lesson →](/course/angularmaterial/lesson/angular-material-forms-from-firestore)

# Angular Material Dynamic Navigation using Firestore

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/5072aa556fe642bd1e6b30afb26580f045d2a32d-1920x1080.png?w=1920&h=1080&q=82&fit=max&auto=format)[@CodingCatDev62.5K / 100K Subscribers Goal](https://www.youtube.com/@codingcatdev?sub_confirmation=1)[Subscribe on YouTube→](https://www.youtube.com/@codingcatdev?sub_confirmation=1)[Watch on YouTube App ↗](https://www.youtube.com/watch?v=sZoiLcq7N6Q&list=UUnKZ8gEb78zXKMi1ns-IQ2g)

[Demo](https://ajonp-lesson-11.firebaseapp.com/books/)The goal of this lesson is to take our [Angular Material Theming](https://ajonp.com/courses/angularmaterial/angular-material-theming) and add navigational elements. The two for this lesson will include [Angular Material Tree](https://material.angular.io/components/tree/overview) and [Angular Material Expansion Panel](https://material.angular.io/components/expansion/overview)If you are well versed in Firebase and are just wondering how to get this tree to work with Firestore, you might want to jump to Tree

## Lesson Steps

- Project Setup
- Firestore
- Router Updates
- Component Updates

# Project Setup

## Create Firebase Project

Angular Firebase has an amazing guide for this [Beginners Guide to Firebase](https://angularfirebase.com/lessons/the-ultimate-beginners-guide-to-firebase/), so you could check that out as well.

> You will need a Google Account

Please navigate to [Firebase Console](https://console.firebase.google.com/) here you can create a new project with any name that you would like. Once inside of your new project please create a firestore database, under the `Database` tab.When prompted select `locked mode`.

## GitHub Lesson 10 clone

For our starter template we will use our previes lesson repo, make sure you are in a directory you would like to place the repo locally and begin [work.In](http://work.in/) your terminal, clone the repo to a new folder

Copied! 🐾

```
git clone  lesson-11
```

Remove the old origin

Copied! 🐾

```
git remote rm origin
```

You can then add your own git repo if you would like, or just track changes locally. Add remote

Copied! 🐾

```
git remote add origin -yourgiturl-
```

## Add firebase

> If you have not yet downloaded firebase CLI please install npm install -g firebase-tools.

After install

Copied! 🐾

```
firebase login
```

Now we will initialize this project

Copied! 🐾

```
firebase init
```

Make sure to select Firestore, and accept all other defaults

You will then need to add firebase to your project, again please checkout the link from above how to do this, of follow the video.

# Firestore

## Firestore Service Creation

> If you don't have the Angular CLI npm install -g @angular/cli.

Using the Angular CLI we will start by creating a service.

Copied! 🐾

```
ng g service core/services/firestore
```

This service will allow us to connect to Firebase Firestore.

## Firestore Database Setup

We want to build this structure inside of Firestore

In Firestore we will setup this basic structure. Remember every collection must have a document. You can find more in the [Firestore Docs Overview](https://cloud.google.com/firestore/docs/overview)

## Add Angular Firebase Service

This service was somthing that was created by Jeff in [Advanced Firestore Usage Guide with Angular](https://angularfirebase.com/lessons/firestore-advanced-usage-angularfire/)

Copied! 🐾

```
ng g service core/services/angularfirebase
```

Code

Copied! 🐾

```
import { Injectable } from '@angular/core';
import {
    AngularFirestore,
    AngularFirestoreDocument,
    AngularFirestoreCollection,
    DocumentChangeAction,
    Action,
    DocumentSnapshotDoesNotExist,
    DocumentSnapshotExists
} from '@angular/fire/firestore';
import { Observable, from } from 'rxjs';
import { map, tap, take, mergeMap, expand, takeWhile, finalize } from 'rxjs/operators';
import * as firebase from 'firebase/app';
import { AngularFireStorage } from '@angular/fire/storage';

type CollectionPredicate = string | AngularFirestoreCollection;
type DocPredicate = string | AngularFirestoreDocument;

@Injectable({ providedIn: 'root' })

export class AngularfirebaseService {
    constructor(public aFirestore: AngularFirestore, public aFireStorage: AngularFireStorage) { }
    /// ************** /// Get a Reference /// **************
    col(ref: CollectionPredicate, queryFn?): AngularFirestoreCollection {
        return typeof ref === 'string' ? this.aFirestore.collection(ref, queryFn) : ref;
    }
    doc(ref: DocPredicate): AngularFirestoreDocument {
        return typeof ref === 'string' ? this.aFirestore.doc(ref) : ref;
    }
    /// ************** /// Get Data /// **************
    doc$(ref: DocPredicate): Observable {
        return this.doc(ref).snapshotChanges().pipe(
            map((doc: Action>) => {
                return doc.payload.data() as T;
            })
        );
    }
    col$(ref: CollectionPredicate, queryFn?): Observable {
        return this.col(ref, queryFn).snapshotChanges().pipe(
            map((docs: DocumentChangeAction[]) => {
                return docs.map((a: DocumentChangeAction) => a.payload.doc.data()) as T[];
            })
        );
    }
    /// with Ids
    colWithIds$(ref: CollectionPredicate, queryFn?): Observable {
        return this.col(ref, queryFn).snapshotChanges().pipe(
            map((actions: DocumentChangeAction[]) => {
                return actions.map((a: DocumentChangeAction) => {
                    const data: Object = a.payload.doc.data() as T;
                    const id = a.payload.doc.id; return { id, ...data };
                });
            })
        );
    }
    /// ************** /// Write Data /// **************
    /// Firebase Server Timestamp get
    timestamp() {
        return firebase.firestore.FieldValue.serverTimestamp();
    }
    set(ref: DocPredicate, data: any): Promise {
        const timestamp = this.timestamp;
        return this.doc(ref).set({ ...data, updatedAt: timestamp, createdAt: timestamp });
    }
    update(ref: DocPredicate, data: any): Promise {
        return this.doc(ref).update({ ...data, updatedAt: this.timestamp });
    }
    delete(ref: DocPredicate): Promise {
        return this.doc(ref).delete();
    }
    add(ref: CollectionPredicate, data): Promise {
        const timestamp = this.timestamp;
        return this.col(ref).add({ ...data, updatedAt: timestamp, createdAt: timestamp });
    }
    geopoint(lat: number, lng: number): firebase.firestore.GeoPoint {
        return new firebase.firestore.GeoPoint(lat, lng);
    }
    /// If doc exists update, otherwise set
    upsert(ref: DocPredicate, data: any): Promise {
        const doc = this.doc(ref).snapshotChanges().pipe(take(1)).toPromise();
        return doc.then((snap: Action>) => {
            return snap.payload.exists ? this.update(ref, data) : this.set(ref, data);
        });
    }
    /// ************** /// Inspect Data /// **************
    inspectDoc(ref: DocPredicate): void {
        const tick = new Date().getTime();
        this.doc(ref).snapshotChanges().pipe(
            take(1),
            tap((d: Action>) => {
                const tock = new Date().getTime() - tick; console.log(Loaded Document in ${ tock }ms, d);
            })).subscribe();
    } inspectCol(ref: CollectionPredicate): void { const tick = new Date().getTime(); this.col(ref).snapshotChanges().pipe(take(1), tap((c: DocumentChangeAction[]) => { const tock = new Date().getTime() - tick; console.log(Loaded Collection in ${ tock }ms, c); })).subscribe(); }
    /// **************
    /// Create and read doc references
    /// **************
    /// create a reference between two documents
    connect(host: DocPredicate, key: string, doc: DocPredicate) { return this.doc(host).update({ [key]: this.doc(doc).ref }); }
    /// returns a documents references mapped to AngularFirestoreDocument
    docWithRefs$(ref: DocPredicate) { return this.doc$(ref).pipe(map((doc: T) => { for (const k of Object.keys(doc)) { if (doc[k] instanceof firebase.firestore.DocumentReference) { doc[k] = this.doc(doc[k].path); } } return doc; })); }
    /// **************
    /// Atomic batch example
    /// **************
    /// Just an example, you will need to customize this method.
    atomic() {
        const batch = firebase.firestore().batch();
        /// add your operations here
        const
            itemDoc = firebase.firestore().doc('items/myCoolItem');
        const userDoc = firebase.firestore().doc('users/userId'); const currentTime = this.timestamp; batch.update(itemDoc, { timestamp: currentTime }); batch.update(userDoc, { timestamp: currentTime });
        /// commit operations
        return batch.commit();
    }
    /** * Delete a collection, in batches of batchSize. Note that this does
     * * not recursively delete subcollections of documents in the collection
     * * from:  */
    deleteCollection(path: string, batchSize: number): Observable {
        const source = this.deleteBatch(path, batchSize);
        // expand will call deleteBatch recursively until the collection is deleted
        return source.pipe(expand(val => this.deleteBatch(path, batchSize)), takeWhile(val => val > 0));
    }
    // Detetes documents as batched transaction private
    deleteBatch(path: string, batchSize: number): Observable {
        const colRef = this.aFirestore.collection(path, ref => ref.orderBy('__name__').limit(batchSize)); return colRef.snapshotChanges().pipe(take(1), mergeMap((snapshot: DocumentChangeAction[]) => {
            // Delete documents in a batch
            const batch = this.aFirestore.firestore.batch(); snapshot.forEach(doc => { batch.delete(doc.payload.doc.ref); }); return from(batch.commit()).pipe(map(() => snapshot.length));
        }));
    }
}
```

## Update Firstore Service

Copied! 🐾

```
import { Author } from './../models/author';
import { Injectable } from '@angular/core';
import { AngularFirestore } from '@angular/fire/firestore';
import { Observable } from 'rxjs';
import { Book } from '../models/book';
import { switchMap } from 'rxjs/operators';
import { AngularfirebaseService } from './angularfirebase.service';
import { Chapter } from '../models/chapter';
import { Section } from '../models/section';
import { Graphicnovel } from '../models/graphicnovel';

@Injectable({ providedIn: 'root' })

export class FirestoreService {
    constructor(private afb: AngularfirebaseService) { }
    // Books
    getBooks(): Observable {
        // Start Using AngularFirebase Service!!
        return this.afb.colWithIds$('books');
    }
    getBook(bookId: string): Observable {
        // Start Using AngularFirebase Service!!
        return this.afb.doc$(books / ${ bookId });
    }
    // Chapters
    getBookChapters(bookId: string): Observable { return this.afb.colWithIds$(books / ${ bookId } / chapters); } getBookChapter(bookId: string, chapterId: string): Observable {
        // Start Using AngularFirebase Service!!
        return this.afb.doc$(books / ${ bookId } / chapters / ${ chapterId });
    }
    // Sections
    getBookSections(bookId: string, chapterId: string): Observable {
        return this.fs.collection('books').doc(bookId).collection('chapters').doc(chapterId).collection('sections').valueChanges();
        return this.afb.colWithIds$(books / ${ bookId } / chapters / ${ chapterId } / sections);
    }
    getBookSection(bookId: string, chapterId: string, sectionId: string): Observable {
        // Start Using AngularFirebase Service!!
        return this.afb.doc$(books / ${ bookId } / chapters / ${ chapterId } / sections / ${ sectionId });
    }
    // Get Authors
    getAuthors(): Observable {
        // Start Using AngularFirebase Service!!
        return this.afb.colWithIds$('authors');
    }
    // Graphic Novels
    getGraphicNovels(): Observable {
        // Start Using AngularFirebase Service!!
        return this.afb.colWithIds$('graphicnovels');
    }
	}
```

# Router Updates

The following routes are setup in order of which they will lazy load and be traversed to display the books path.

## App Router

Need to update the main router to reference booksapp-routing.module.ts

Copied! 🐾

```
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

const routes: Routes = [
    {
        path: 'welcome',
        loadChildren: './modules/welcome/welcome.module#WelcomeModule'
    },
    {
        path: 'books',
        loadChildren: './modules/books/books.module#BooksModule'
    },
    { path: 'kitchensink', loadChildren: './modules/kitchensink/kitchensink.module#KitchensinkModule' },
    { path: '', redirectTo: '/books', pathMatch: 'full' }
];

@NgModule({
    imports: [RouterModule.forRoot(routes)], exports: [RouterModule]
})
export class AppRoutingModule { }
```

## Book Top Level Router

In our updated setup for our book router we need to lazy load the book list (for all of our books), as well as the book detail (for a single book).books-routing.modules.ts

Copied! 🐾

```
import { BooksComponent } from './books.component';
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

const routes: Routes = [
    {
        path: '',
        component: BooksComponent,
        children: [
            { path: '', loadChildren: './book-list/book-list.module#BookListModule' },
            { path: ':bookId', loadChildren: './book-detail/book-detail.module#BookDetailModule' }
        ]
    }];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class BooksRoutingModule { }
```

## Book Detail Router

Remember this is where we added the named outlet in the last lesson `book-drawer`. This component is where we will focus on loading our new tree.

Copied! 🐾

```
import { BookDrawerComponent } from './../book-drawer/book-drawer.component';
import { BookDetailComponent } from './book-detail.component';
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

const routes: Routes = [
    { path: '', component: BookDetailComponent },
    { path: '', component: BookDrawerComponent, outlet: 'book-drawer' }
];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})

export class BookDetailRoutingModule { }
```

# Component Updates

Now that we have all the plumbing set we can add a new component to our `book-drawer` component.

## Create book-list

We need to first be able to select a book before navigating to the book detail. For this we will create a book-list module.

Copied! 🐾

```
ng g m modules/books/book-list && ng g c modules/books/book-list
```

### Expansion Panel for book-list

Copied! 🐾

```

            Books

#### {{ book.title }}

            Graphic Novels

#### {{ gn.title }}

            Authors

#### {{ author.name }}

```

### Populating the expansion panel

Use the firestore service to populate the Observables for each book.

Copied! 🐾

```
@Component({
    selector: 'app-book-list',
    templateUrl: './book-list.component.html',
    styleUrls: ['./book-list.component.scss']
})

export class BookListComponent implements OnInit {
    bookList: Observable;
    graphicNovelList: Observable;
    authorList: Observable;

    constructor(private fs: FirestoreService, private router: Router) { }

    ngOnInit() {
        this.bookList = this.fs.getBooks();
        this.graphicNovelList = this.fs.getGraphicNovels();
        this.authorList = this.fs.getAuthors();
    }
}
```

## Create book-tree

Copied! 🐾

```
ng g m modules/books/book-tree && ng g c modules/books/book-tree
```

Copied! 🐾
      {{ node.item }}

" aria-label="Copy code" title="Copy code to clipboard">

```

      {{ node.item }}

             {{ treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right' }}

         {{ node.item }}

```

I will break down this entire comopnent in further detail below, for now here is the code.

Copied! 🐾

```
import { Book } from 'src/app/core/models/book';
import { Injectable, Component, OnInit, OnDestroy } from '@angular/core';
import { BehaviorSubject, Observable, merge, Subscription } from 'rxjs';
import { FlatTreeControl } from '@angular/cdk/tree';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { FirestoreService } from 'src/app/core/services/firestore.service';
import { CollectionViewer, SelectionChange } from '@angular/cdk/collections';
import { map, tap, take } from 'rxjs/operators';
import { Chapter } from 'src/app/core/models/chapter';
import { Section } from 'src/app/core/models/section';
/** Flat node with expandable and level information */

export class DynamicFlatNode {
    constructor(
        public item: string,
        public level = 1,
        public expandable = false,
        public isLoading = false,
        public book?: Book,
        public chapter?: Chapter,
        public section?: Section
    ) { }
}

@Injectable() export class DynamicDataSource {
    dataChange = new BehaviorSubject([]); bookTree = {};
    subscriptions: Subscription[] = [];
    get data(): DynamicFlatNode[] {
        return this.dataChange.value;
    }
    set data(value: DynamicFlatNode[]) {
        this.treeControl.dataNodes = value;
        this.dataChange.next(value);
    }

    constructor(
        private treeControl: FlatTreeControl,
        private route: ActivatedRoute,
        private fs: FirestoreService,
        private router: Router) {

        /** Initial data from database */
        this.subscriptions.push(
            this.route.queryParams.subscribe(params => { console.log(params); })
        );
        this.subscriptions.push(
            this.route.paramMap.subscribe(paramMap => {
                const bookId = paramMap.get('bookId');
                this.fs.getBookChapters(bookId).subscribe(chapters => {
                    const nodes: DynamicFlatNode[] = [];
                    chapters.sort((a, b) => (a.sort  nodes.push(
                        new DynamicFlatNode(chapter.title, 0, true, false, { id: bookId }, chapter)
                    ));
                    this.data = nodes;
                });
            })
        );
    }
    connect(collectionViewer: CollectionViewer): Observable {
        this.treeControl.expansionModel.onChange.subscribe(change => {
            if ((change as SelectionChange).added || (change as SelectionChange).removed) {
                this.handleTreeControl(change as SelectionChange);
            }
        });
        return merge(collectionViewer.viewChange, this.dataChange).pipe(map(() => this.data));
    }
    /** Handle expand/collapse behaviors */
    handleTreeControl(change: SelectionChange) {
        if (change.added) { change.added.forEach(node => this.toggleNode(node, true)); }
        if (change.removed) {
            change.removed.slice().reverse().forEach(node =>
                this.toggleNode(node, false)
            );
        }
    }
    /** * Toggle the node, remove from display list */
    toggleNode(node: DynamicFlatNode, expand: boolean) {
        const index = this.data.indexOf(node);
        node.isLoading = true;
        if (expand) {
            this.subscriptions.push(
                this.fs.getBookSections(node.book.id, node.chapter.id).subscribe(async sections => {
                    console.log(sections);
                    const nodes: DynamicFlatNode[] = [];
                    sections.sort((a, b) => (a.sort  nodes.push(new DynamicFlatNode(section.title, 1, false, false, node.book, node.chapter, section)));
                    this.data.splice(index + 1, 0, ...nodes);
                    this.dataChange.next(this.data);

                    // Update query params on current chapter
                    await this.router.navigate([], { relativeTo: this.route, queryParams: { chapterId: node.chapter.id }, queryParamsHandling: 'merge' });

                    // Remove any left over section params
                    await this.router.navigate([], { relativeTo: this.route, queryParams: { sectionId: '' }, queryParamsHandling: 'merge' });
                    node.isLoading = false;
                }));
        }
        else {
            let count = 0; for (let i = index + 1; i  node.level; i++ , count++) { } this.data.splice(index + 1, count);
            // notify the change
            this.dataChange.next(this.data); node.isLoading = false;
        }
    }
}

@Component({
    selector: 'app-book-tree',
    templateUrl: './book-tree.component.html',
    styleUrls: ['./book-tree.component.scss']
})

export class BookTreeComponent implements OnInit, OnDestroy {
    treeControl: FlatTreeControl;
    dataSource: DynamicDataSource;

    constructor(
        private route: ActivatedRoute,
        private fs: FirestoreService,
        private router: Router) {
        this.treeControl = new FlatTreeControl(
            this.getLevel, this.isExpandable
        );
        this.dataSource = new DynamicDataSource(
            this.treeControl,
            this.route,
            this.fs,
            this.router
        );
    }

    ngOnInit() { }
    ngOnDestroy() {
        this.dataSource.subscriptions.forEach(s => { s.unsubscribe(); });
    }
    section(node: DynamicFlatNode) {
        // Update query params on current chapter
        this.router.navigate([], { relativeTo: this.route, queryParams: { sectionId: node.section.id }, queryParamsHandling: 'merge' });
    }
    getLevel = (node: DynamicFlatNode) => node.level;
    isExpandable = (node: DynamicFlatNode) => node.expandable;
    hasChild = (_: number, _nodeData: DynamicFlatNode) => _nodeData.expandable;
}
```

### Reference book-tree inside book-drawer

We can now update `book-drawer`.book-drawer.component.html

Copied! 🐾

```

```

Please make sure to also import `BookTreeModule` in `book-drawer.module.ts`.

Copied! 🐾

```
... imports: [CommonModule, BookTreeModule], ...
```

# Tree

[Angular Material Tree](https://material.angular.io/components/tree/overview)

## Breaking down the dynamic Tree

There are two key directives that drive the dynamic tree `dataSource` and `treeControl`.

- dataSource: Provides a stream containing the latest data array to render. Influenced by the tree's stream of view window (what dataNodes are currently on screen). Data source can be an observable of data array, or a data array to render.
- treeControl: Controls layout and functionality of the visual tree.

book-tree.comopnent.html

Copied! 🐾

```

```

### dataSource

In our example we assign dataSource to a new object from class `DynamicDataSource`. This class is passed off the necessary dependency injected classes that we will need from our `BookTreeComponent`.

Copied! 🐾

```
this.dataSource = new DynamicDataSource( this.treeControl, this.route, this.fs, this.router );
```

### DynamicDataSource

The `DynamicDataSource's` main job is to get initial data for the setup of the tree, control the flow of any additional data, and react when the tree is toggled.The data type that we are using in our tree is defined by class `DynamicFlatNode`, this class holds the data that we use throughout our tree as an array. Maybe better put our Tree is made up of an Array of `DynamicFlatNode`.

Copied! 🐾

```
export class DynamicFlatNode {
    constructor(
        public item: string,
        public level = 1,
        public expandable = false,
        public isLoading = false,
        public book?: Book,
        public chapter?: Chapter,
        public section?: Section
    ) {}
}
```

You can see in the first line of `DynamicDataSource` that we create a new BehaviorSubject for the array. This makes essentially an empty array for the tree's `dataSource`.

Copied! 🐾

```
export class DynamicDataSource { dataChange = new BehaviorSubject([]);
```

For our example we set the initial data for this by subscribing to our `bookId` and getting the corresponding book's chapters. You will notice that we create a `DynamicFlatNode` Object and add that to the array `nodes`. We then assign `DynamicDataSource`'s `data` property the array that we have created.

Copied! 🐾

```
/** Initial data from database */
this.subscriptions.push(
    this.route.paramMap.subscribe(paramMap => {
        const bookId = paramMap.get('bookId');
        this.fs.getBookChapters(bookId).subscribe(chapters => {
            const nodes: DynamicFlatNode[] = [];
            chapters.sort((a, b) => (a.sort  nodes.push(
                new DynamicFlatNode(
                    chapter.title,
                    // chapter
                    title 0,
                    // Tree Level
                    true,
                    // Expandable
                    false,
                    // Is Loading
                    { id: bookId },
                    // Object representing book
                    chapter
                    // Object for our current Chapter from firestore
                )));
            this.data = nodes;
        });
    }));
```

✏️ Visual Architecture Diagram

## how this course connects together.

Follow AJ from first principles to production-ready architecture.

Let’s build it!✏️ Visual Diagram: Angular Material: Angular Material Dynamic Navig…✓ Good PatternVISUAL DIAGRAM[Diagram Walkthrough]Step-by-step diagram breakdown for Angular Material: Angular Material Dynamic Navigation using Firestore: start with Section 1, implement Angular Material, and ship to production.AAA Contrast Verified

## related deep dives.

[View All&rarr;](/blog)[![The Firebase plugin is now available in Codex: Web Architecture & Implementation Guide](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/4e2c8e99f437cb576972d406ec32394a82a19480-1200x630.svg?w=1200&q=82&fit=max&auto=format)](/post/firebase-2026-09-firebase-plugin-for-codex)September 29, 2026[![](/logos/firebase/firebase-symbol.png)![](/logos/firebase/firebase-symbol.png)Firebase](/topic/firebase)[![](/logos/tags/google-cloud-symbol-light.svg)![](/logos/tags/google-cloud-symbol-dark.svg)Google Cloud](/topic/google-cloud)

### [The Firebase plugin is now available in Codex: Web Architecture & Implementation Guide](/post/firebase-2026-09-firebase-plugin-for-codex)

Alex Patterson's hands-on web engineering breakdown of "The Firebase plugin is now available in Codex" (2026-09-28). Learn how to wire up Firebase, Google Cloud, Web Dev, AI in production web apps.

[![Alex Patterson](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/a606dfaa381aab08ddbe16a33fe1d3e1fb37c927-400x400.jpg?w=96&h=96&q=82&fit=max&auto=format)Alex Patterson](/author/alex-patterson)[![PHP2Shell (CVE-2026-109618): How AI Found a Decade-Old Bug in 70% of the Web](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/e83065d0a4e2f841ce64d3f4aea8ddbbf07e5cb9-1376x768.jpg?w=1376&q=82&fit=max&auto=format)](/post/php2shell-cve-2026-109618-ai-php-security-scramble)October 22, 2026[![](/logos/tags/aws-symbol-light.svg)![](/logos/tags/aws-symbol-dark.svg)AWS](/topic/aws)[![](/logos/tags/php-symbol-light.svg)![](/logos/tags/php-symbol-dark.svg)PHP](/topic/php)

### [PHP2Shell (CVE-2026-109618): How AI Found a Decade-Old Bug in 70% of the Web](/post/php2shell-cve-2026-109618-ai-php-security-scramble)

Two critical pre-authentication RCE flaws in PHP (CVE-2026-109618 and CVE-2026-109619), uncovered by AI models from OpenAI and Google Gemini, sparked a global patching scramble across 70% of the web. Here is how PHP2Shell works and how to patch your servers.

[![Alex Patterson](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/a606dfaa381aab08ddbe16a33fe1d3e1fb37c927-400x400.jpg?w=96&h=96&q=82&fit=max&auto=format)Alex Patterson](/author/alex-patterson)[Course Outline](/course/angularmaterial)

## Angular Material

5/81

### Section 1

- [1.1Firebase Project Hosting](/course/angularmaterial/lesson/firebase-project-hosting)
- [1.2Angular Material Router Outlet](/course/angularmaterial/lesson/angular-material-router-outlet)
- [1.3Firebase Authentication and Authorization](/course/angularmaterial/lesson/firebase-authentication-and-authorization)
- [1.4Angular Material Theming](/course/angularmaterial/lesson/angular-material-theming)
- [1.5Angular Material Dynamic Navigation using Firestore▶](/course/angularmaterial/lesson/angular-material-dynamic-navigation-using-firestore)
- [1.6Angular Material Forms from Firestore](/course/angularmaterial/lesson/angular-material-forms-from-firestore)
- [1.7Angular Material Reactive Forms Update Firestore](/course/angularmaterial/lesson/angular-material-reactive-forms-update-firestore)
- [1.8Angular Material Router Awareness](/course/angularmaterial/lesson/angular-material-router-awareness)

@CodingCatDev on YouTube62.5K / 100K

Subscribe for new course lessons and architecture deep dives every week.

[Subscribe for New Lessons →](https://www.youtube.com/@codingcatdev?sub_confirmation=1)