# c-edu-u/inmobiliaria-angular architecture

> Architecture diagram of the GitHub repository c-edu-u/inmobiliaria-angular, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/c-edu-u/inmobiliaria-angular
- Repository: https://github.com/c-edu-u/inmobiliaria-angular

## Overview

##### Project Type and Purpose
- This is a single-page application built with Angular CLI (v19.2.15), extended for Server-Side Rendering (SSR) via Angular Universal.
- The purpose is to serve real-estate listings (“Inmobiliaria”) with fast initial loads and SEO-friendly pages, using both a Node/Express server (server.ts) and standard Angular client bundles.

##### File Structure
- Top-level config and build files (angular.json, tsconfig*.json, package.json) indicate an Angular CLI project.
- src/main.ts and src/index.html serve the client bundle.
- src/main.server.ts and src/server.ts implement the SSR entrypoint (Express server).
- src/app contains:
- app.routes.ts / app.routes.server.ts (client vs. SSR routing)
- app.config.ts / app.config.server.ts (environment and DI configurations)
- pages/ and components/ folders for UI modules (landing, login, admin, detalle-propiedad, editar-propiedad, navbar).
- public/ holds static assets for deployment.

##### Key Insights from README
- Standard Angular CLI commands (ng serve, ng build, ng test, etc.).
- No dedicated backend code beyond SSR — likely consumes external APIs for property data.

##### Main Components
A. Client Browser
- Requests URL (e.g., /landing, /detalle-propiedad/:id).
- Receives pre-rendered HTML (SSR) plus client bundle.
B. Node/Express SSR Server
- Entry: src/server.ts
- Uses Angular Universal to render pages (main.server.ts → app.server.module).
- Serves static assets from /public and the compiled client bundles.
C. Angular Application
- Modules:
- Root Module (AppModule)
- Server Module (AppServerModule)
- Feature Modules (Pages & Components)
- Routing Layers:
- app.routes.server.ts (SSR)
- app.routes.ts (Client)
- Configuration Layers:
- app.config.server.ts (server-only services, DI providers)
- app.config.ts (browser DI providers)
D. External Services (if any)
E. Build & Deployment Pipeline
- Angular CLI (ng build → /dist)
- SSR bundle compilation (tsc + webpack).
- Deployment runtime: Node.js hosting SSR server.

##### Relationships & Interactions
- User → HTTP GET → SSR Server → Angular Universal renders HTML → Browser.
- After initial load, client bundle hydrates and client-side router takes over.
- Client App ↔ External API(s) via HTTP services (e.g., Angular HttpClient).
- Static asset requests (CSS, images) served directly from public/ or /dist assets.

##### Architectural Patterns & Design Principles
- Separation of Concerns: distinct client vs. server modules (app.config, app.routes variants).
- Universal Rendering: dual-entry strategy for SEO and performance.
- Modular UI: feature-based folder structure (pages, components).

##### Final Checklist
- Notes on build output (dist folder) and deployment runtime.
- Visual separation of pre-render (SSR) phase vs. client-side hydration and routing.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Browser Layer
    subgraph "Browser" 
        direction TB
        Client["Browser"]:::browser
    end

    %% Server Layer
    subgraph "Server" 
        direction TB
        SSRServer["Express SSR Server"]:::server
        Universal["Angular Universal Engine"]:::server
    end

    %% Angular Application
    subgraph "Angular Application" 
        direction TB
        subgraph "Server-side (SSR)"
            direction TB
            MainServer["main.server.ts"]:::angular
            AppServerModule["AppServerModule"]:::angular
            RoutesServer["app.routes.server.ts"]:::angular
            ConfigServer["app.config.server.ts"]:::angular
        end
        subgraph "Client-side (Browser)"
            direction TB
            IndexHTML["index.html"]:::angular
            MainTs["main.ts"]:::angular
            AppModule["AppModule"]:::angular
            RoutesClient["app.routes.ts"]:::angular
            ConfigClient["app.config.ts"]:::angular
        end
        subgraph "Feature Modules"
            direction TB
            Navbar["NavbarComponent"]:::angular
            Landing["LandingComponent"]:::angular
            Login["LoginComponent"]:::angular
            Admin["AdminComponent"]:::angular
            Detalle["DetallePropiedadComponent"]:::angular
            Editar["EditarPropiedadComponent"]:::angular
        end
    end

    %% External and Assets
    ExternalAPI["External Property API"]:::external
    StaticStore["Static Asset Store (public/)"]:::asset

    %% Build & CLI
    BuildTools["Angular CLI & Build Tools"]:::build

    %% Relationships
    Client -->|HTTP GET / URL| SSRServer
    SSRServer --> Universal
    Universal -->|SSR render HTML| Client
    Client -->|hydrate with bundle| AppModule
    Client -->|GET assets/css/js| StaticStore
    AppModule --> Navbar
    AppModule --> Landing
    AppModule --> Login
    AppModule --> Admin
    AppModule --> Detalle
    AppModule --> Editar
    AppModule --> ExternalAPI
    Client -->|serve index.html| SSRServer
    BuildTools -.->|build SSR bundle| MainServer
    BuildTools -.->|build client bundle| IndexHTML
    BuildTools -.->|configuration| ConfigClient
    BuildTools -.->|configuration| ConfigServer

    %% Click Events
    click MainTs "https://github.com/c-edu-u/inmobiliaria-angular/blob/main/src/main.ts"
    click IndexHTML "https://github.com/c-edu-u/inmobiliaria-angular/blob/main/src/index.html"
    click SSRServer "https://github.com/c-edu-u/inmobiliaria-angular/blob/main/src/server.ts"
    click MainServer "https://github.com/c-edu-u/inmobiliaria-angular/blob/main/src/main.server.ts"
    click RoutesClient "https://github.com/c-edu-u/inmobiliaria-angular/blob/main/src/app/app.routes.ts"
    click RoutesServer "https://github.com/c-edu-u/inmobiliaria-angular/blob/main/src/app/app.routes.server.ts"
    click ConfigClient "https://github.com/c-edu-u/inmobiliaria-angular/blob/main/src/app/app.config.ts"
    click ConfigServer "https://github.com/c-edu-u/inmobiliaria-angular/blob/main/src/app/app.config.server.ts"
    click Navbar "https://github.com/c-edu-u/inmobiliaria-angular/blob/main/src/app/components/navbar/navbar.component.ts"
    click Landing "https://github.com/c-edu-u/inmobiliaria-angular/blob/main/src/app/pages/landing/landing.component.ts"
    click Login "https://github.com/c-edu-u/inmobiliaria-angular/blob/main/src/app/pages/login/login.component.ts"
    click Admin "https://github.com/c-edu-u/inmobiliaria-angular/blob/main/src/app/pages/admin/admin.component.ts"
    click Detalle "https://github.com/c-edu-u/inmobiliaria-angular/blob/main/src/app/pages/detalle-propiedad/detalle-propiedad.component.ts"
    click Editar "https://github.com/c-edu-u/inmobiliaria-angular/blob/main/src/app/pages/editar-propiedad/editar-propiedad.component.ts"
    click StaticStore "https://github.com/c-edu-u/inmobiliaria-angular/tree/main/public/"
    click BuildTools "https://github.com/c-edu-u/inmobiliaria-angular/blob/main/angular.json"

    %% Styles
    classDef browser fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef server fill:#90EE90,stroke:#333,stroke-width:1px
    classDef angular fill:#F0E68C,stroke:#333,stroke-width:1px
    classDef external fill:#FFB6C1,stroke:#333,stroke-width:1px
    classDef asset fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef build fill:#E6E6FA,stroke:#333,stroke-width:1px
```
