# deepu12-rgb/homeverse architecture

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

- Interactive diagram: https://gitdiagram.com/deepu12-rgb/homeverse
- Repository: https://github.com/deepu12-rgb/homeverse

## Overview

##### Project Type and Purpose
- Homeverse is a responsive real estate website built with HTML, CSS, and JavaScript on the frontend and Node.js on the backend.
- Its purpose is to provide property listings, interactive maps (via the Google Maps API), advanced property search, wishlist functionality, mortgage calculations, and even a 3D property view—all wrapped in a modern and user-friendly interface.

##### Analyzing the File Structure and Key Components
- The file tree clearly separates the project into two main domains:
- “frontend”: Contains the static assets (HTML pages, CSS stylesheets, JavaScript files), images, 3D models, and videos. There are multiple HTML pages and associated asset folders that enable responsive design and advanced functionality (e.g., property search, map integration, mortgage calculator).
- “backend”: Contains route handlers, middleware, models, and configuration (including database connection details). There are multiple routes for handling authentication, properties, user enquiries, carts, and more. It follows a modular approach (e.g., MVC-like division with models, routes, middleware) and includes tests for various database and server configurations.
- Additional CI/CD support is provided by the .github/workflows directory (deploy.yml) which hints at an automated deployment process.

a. Frontend Layer (Client-Side)
- Components: HTML pages (index.html, login.html, property-details.html, etc.), CSS stylesheets, JavaScript files (interactivity, API service scripts)
- Functionality: User interface, client-side logic, interaction with external services (e.g., Google Maps API), and integrations for 3D model views.

b. Backend Layer (Server-Side)
- Components: Web server (server.js/ src/server.js), routes (auth.js, cart.js, properties.js, etc.), middleware (auth.js), models (Property.js, User.js, etc.), and configuration files (db.js for MongoDB connection).
- Functionality: API endpoints for data operations (CRUD for properties, handling enquiries and user management), business logic, authentication, and data processing.
- Distinct layers/patterns such as the use of middleware for authentication or MVC-like separation (models, routes/controllers).

c. Database and External Services
- Database: Though not explicitly included as a "database" folder, the presence of DB configuration files (db.js) and MongoDB-related test files indicates the use of a MongoDB database.
- External Services:
- Google Maps API for interactive maps.
- Third-party assets and possibly AI (Sarasvati for user support as per the README) integration.
- CI/CD integration via GitHub Actions (deploy.yml) to manage deployment processes.

d. CI/CD and Deployment
- Components: GitHub workflows for deployment.
- Functionality: Automates building, testing, and deploying the application.

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["Browser/Client"]:::frontend

    subgraph "Frontend Layer"
        FE1["HTML Pages & Static Assets"]:::frontend
        FE2["CSS & JavaScript Assets"]:::frontend
        FE3["Interactive Maps (Google Maps API)"]:::frontend
        FE4["3D Property View"]:::frontend
    end

    subgraph "Backend Layer"
        BE1["API Server"]:::backend
        BE2["Routes (auth,cart,enquiries,properties,users)"]:::backend
        BE3["Middleware (Authentication)"]:::backend
        BE4["Models (Property,User,Cart,Enquiry)"]:::backend
        BE5["DB Config (MongoDB Connection)"]:::backend
    end

    Database["MongoDB Data Store"]:::db
    External["External Services (GoogleMapsAPI,AI_Assistant)"]:::external
    CID["CI/CD Pipeline (GitHubActions)"]:::cicd

    %% Connections
    User -->|"loads"| FE1
    FE1 -->|"HTTP_request"| BE1
    BE1 -->|"uses"| BE2
    BE1 -->|"applies"| BE3
    BE1 -->|"calls"| BE4
    BE1 -->|"configured_by"| BE5
    BE5 -->|"connects_to"| Database
    BE1 -->|"external_call"| External
    CID -->|"deploys"| FE1
    CID -->|"deploys"| BE1

    %% Click Events
    click FE1 "https://github.com/deepu12-rgb/homeverse/blob/main/frontend/index.html"
    click FE2 "https://github.com/deepu12-rgb/homeverse/tree/main/frontend/assets/css/"
    click FE3 "https://github.com/deepu12-rgb/homeverse/blob/main/frontend/assets/js/map-integration.js"
    click FE4 "https://github.com/deepu12-rgb/homeverse/tree/main/frontend/assets/models/"
    click BE1 "https://github.com/deepu12-rgb/homeverse/blob/main/backend/server.js"
    click BE2 "https://github.com/deepu12-rgb/homeverse/tree/main/backend/routes/"
    click BE3 "https://github.com/deepu12-rgb/homeverse/blob/main/backend/middleware/auth.js"
    click BE4 "https://github.com/deepu12-rgb/homeverse/tree/main/backend/models/"
    click BE5 "https://github.com/deepu12-rgb/homeverse/blob/main/backend/config/db.js"
    click CID "https://github.com/deepu12-rgb/homeverse/blob/main/.github/workflows/deploy.yml"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef backend fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef db fill:#e2e3e5,stroke:#41464b,stroke-width:2px,stroke-dasharray:5,5;
    classDef external fill:#f8d7da,stroke:#721c24,stroke-width:2px;
    classDef cicd fill:#fff3cd,stroke:#856404,stroke-width:2px;
```
