# adri4nza/moviesapp architecture

> Architecture diagram of the GitHub repository adri4nza/moviesapp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adri4nza/moviesapp
- Repository: https://github.com/adri4nza/moviesapp

## Overview

- Client / Frontend (Angular Application):
- App Shell: Represents the main Angular module (src/app) that brings together all the functionalities.
- Feature Modules: Highlight separate modules/components for:
▪ Auth Module: Contains pages (e.g., login-page), services (auth.service, user.service), and types.
▪ Content Module: Encompasses pages related to movie content (home, movie detail, movies, series, favorites, and watchlist), along with dedicated components like movie-card and serie-card, services (movies.service, series.service, watchlist.service), and types definitions.
▪ Layout Module: Hosts reusable components like the navbar and layout management.
- Shared or Core Components: Any cross-cutting configurations (app.config.ts, app.routes.ts) and routing setup (individual route files for pages).

- Backend / Server:
- Node Server: The server.ts file likely sets up a lightweight Node server (possibly for Angular Universal SSR or an API layer to serve static files from public/) to bootstrap the application.

##### Relationships and interactions
- That the Angular frontend is the primary consumer of user interactions, routing between authentication and content-centric pages.
- If applicable, illustrate interactions between the Angular app and the backend Node server (e.g., for server-side rendering or serving assets).

##### Architectural patterns and design principles
- Component-Based Architecture: Showcase how the various Angular components are structured hierarchically.
- Modularization: Stress the separation of concerns across feature modules (auth, content, layout). Each module encapsulates its own services, types, and pages.

##### Technical details
- Relevant technologies: Angular CLI, Angular framework itself (components, services, routing), TypeScript, and possibly Node.js for server.ts.
- Configuration files used (angular.json, tsconfig.json) in an auxiliary block if needed to suggest build and development workflows.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client / Frontend
    subgraph "Client / Frontend"
        %% App Shell
        subgraph "App Shell"
            AS("Main Angular Module"):::frontend
        end

        %% Auth Module
        subgraph "Auth Module"
            A("Auth Module"):::module
            AP("Login Page"):::page
            ASv("Auth Service"):::service
            USv("User Service"):::service
            AT("User Types"):::config
        end

        %% Content Module
        subgraph "Content Module"
            C("Content Module"):::module
            HP("Home Page"):::page
            MP("Movies Page"):::page
            SDP("Movie Detail Page"):::page
            SP("Series Page"):::page
            FP("Favorites Page"):::page
            WP("Watchlist Page"):::page
            MC("Movie Card"):::component
            SC("Serie Card"):::component
            MS("Movies Service"):::service
            SS("Series Service"):::service
            WS("Watchlist Service"):::service
            CT("Content Types"):::config
        end

        %% Layout Module
        subgraph "Layout Module"
            L("Layout Module"):::module
            N("Navbar Component"):::component
        end

        %% Shared / Core Configurations
        subgraph "Shared / Core"
            AR("App Routes"):::config
            AC("App Config"):::config
            ASC("Server Config"):::config
        end

        %% Interactions within Frontend
        AS --> AR
        AS --> AC
        AS --> ASC

        AR -->|"navigates to"| A
        AR -->|"navigates to"| HP
        AR -->|"navigates to"| MP
        AR -->|"navigates to"| SDP
        AR -->|"navigates to"| SP
        AR -->|"navigates to"| FP
        AR -->|"navigates to"| WP

        A -->|"renders"| AP
        A -->|"injects"| ASv
        A -->|"injects"| USv

        C -->|"renders"| HP
        C -->|"renders"| MP
        C -->|"renders"| SDP
        C -->|"renders"| SP
        C -->|"renders"| FP
        C -->|"renders"| WP
        C -->|"contains"| MC
        C -->|"contains"| SC
        C -->|"uses"| MS
        C -->|"uses"| SS
        C -->|"uses"| WS

        L -->|"includes"| N
    end

    %% Backend / Server
    subgraph "Backend / Server"
        B("Node Server (server.ts)"):::backend
        P("Static Assets (public/)"):::static
        SSR("SSR Entry (src/main.server.ts)"):::backend
    end

    %% Interaction between Frontend and Backend
    AS -.->|"SSR/Asset Serving"| B
    ASC -.->|"Server Config"| B

    %% Click Events for Components
    click AS "https://github.com/adri4nza/moviesapp/tree/main/src/app"
    click A "https://github.com/adri4nza/moviesapp/tree/main/src/app/auth"
    click AP "https://github.com/adri4nza/moviesapp/tree/main/src/app/auth/pages/login-page"
    click ASv "https://github.com/adri4nza/moviesapp/blob/main/src/app/auth/services/auth.service.ts"
    click USv "https://github.com/adri4nza/moviesapp/blob/main/src/app/auth/services/user.service.ts"
    click AT "https://github.com/adri4nza/moviesapp/blob/main/src/app/auth/types/user.model.ts"
    click C "https://github.com/adri4nza/moviesapp/tree/main/src/app/content"
    click HP "https://github.com/adri4nza/moviesapp/tree/main/src/app/content/pages/home-page"
    click SDP "https://github.com/adri4nza/moviesapp/tree/main/src/app/content/pages/movie-detail-page"
    click MP "https://github.com/adri4nza/moviesapp/tree/main/src/app/content/pages/movies-page"
    click SP "https://github.com/adri4nza/moviesapp/tree/main/src/app/content/pages/series-page"
    click FP "https://github.com/adri4nza/moviesapp/tree/main/src/app/content/pages/favorites-page"
    click WP "https://github.com/adri4nza/moviesapp/tree/main/src/app/content/pages/watchlist-page"
    click MC "https://github.com/adri4nza/moviesapp/tree/main/src/app/content/components/movie-card"
    click SC "https://github.com/adri4nza/moviesapp/tree/main/src/app/content/components/serie-card"
    click MS "https://github.com/adri4nza/moviesapp/blob/main/src/app/content/services/movies.service.ts"
    click SS "https://github.com/adri4nza/moviesapp/blob/main/src/app/content/services/series.service.ts"
    click WS "https://github.com/adri4nza/moviesapp/blob/main/src/app/content/services/watchlist.service.ts"
    click CT "https://github.com/adri4nza/moviesapp/blob/main/src/app/content/types/movie.ts"
    click N "https://github.com/adri4nza/moviesapp/tree/main/src/app/layout/components/navbar"
    click AR "https://github.com/adri4nza/moviesapp/blob/main/src/app/app.routes.ts"
    click AC "https://github.com/adri4nza/moviesapp/blob/main/src/app/app.config.ts"
    click ASC "https://github.com/adri4nza/moviesapp/blob/main/src/app/app.config.server.ts"
    click SSR "https://github.com/adri4nza/moviesapp/blob/main/src/main.server.ts"
    click B "https://github.com/adri4nza/moviesapp/blob/main/server.ts"
    click P "https://github.com/adri4nza/moviesapp/tree/main/public"

    %% Style Definitions
    classDef module fill:#f9f,stroke:#333,stroke-width:2px;
    classDef frontend fill:#bbf,stroke:#333,stroke-width:2px;
    classDef page fill:#ffc,stroke:#333,stroke-width:2px;
    classDef service fill:#cfc,stroke:#333,stroke-width:2px;
    classDef component fill:#fcf,stroke:#333,stroke-width:2px;
    classDef config fill:#cff,stroke:#333,stroke-width:2px;
    classDef backend fill:#fdd,stroke:#333,stroke-width:2px;
    classDef static fill:#dfd,stroke:#333,stroke-width:2px;
```
