How c-edu-u/inmobiliaria-angular works
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.