# mariam168/eskan- architecture

> Architecture diagram of the GitHub repository mariam168/eskan-, 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/mariam168/eskan-
- Repository: https://github.com/mariam168/eskan-

## Overview

##### Main Components
- Frontend Application – This is primarily within the src folder. It is a Vue application featuring:
- Layouts (e.g., DefaultLayout.vue)
- Views (e.g., HomeView, AboutView, AdminDashboardView, PropertyItemView, etc.)
- Components for different functionalities (e.g., Navbar, Footer, PropertyCard, SearchBar, and specialized components for admin and property creation).
- Store modules for state management segregated by domain (auth, notifications, owners, property, requests, users).
- Routing (handled in src/router)
- Localization (under src/locale)
- Backend Server – Represented by the server.js at the project root which likely acts as an API endpoint router. Additionally, the functions folder (e.g., deleteUser.js) suggests serverless functions for specific backend operations.
- External Services and Integrations – These include:
- Firebase (with configuration and related services in src/config/firebase.js and in the store/data-related operations).
- Cloudinary (via the uploadToCloudinary service in src/services)
- Utilities for geocoding, image validation, and base64-to-file conversion.

##### How to Represent Relationships and Data Flow
- Client-Side Communication:
- The frontend Vue application makes API calls (through the backend server or directly to Firebase when needed).
- Backend Interaction:
- Business logic (e.g., property management operations, user handling) currently performed on the server.
- External Service Integration:

##### Architectural Patterns and Design Principles to Highlight
- Separation of Concerns: Notice the clear division between the frontend (presentation layer), backend (API/services layer), and external integrations.
- Modularization:
- Within the frontend, you have modular components and store modules that separate business logic per domain (authentication, property management, administrative functions).
- In the backend, the use of serverless function style endpoints (e.g., functions/deleteUser.js) suggests a micro-level separation for specific tasks.
- Scalability and Extensibility:
- The architecture is designed so that the frontend can be extended with additional views/modules while the backend can grow with more functions/endpoints. External services make the system more maintainable by offloading storage and other services.

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["User"]:::user

    subgraph "Frontend Application"
        FE["Vue SPA (src)"]:::frontend
        App["App.vue"]:::frontendSmall
        Components["Components (UI Elements)"]:::frontendSmall
        Views["Views (Pages)"]:::frontendSmall
        Layouts["Layouts (DefaultLayout.vue)"]:::frontendSmall
        Router["Routing (index.js)"]:::frontendSmall
        Store["State Management (Vuex Modules)"]:::frontendSmall
        Locale["Localization (en/ar.json)"]:::frontendSmall
    end

    subgraph "Backend Services"
        Backend["Backend Server (server.js)"]:::backend
        Functions["Serverless Functions (deleteUser.js)"]:::backend
    end

    subgraph "External Integrations"
        Firebase["Firebase"]:::external
        Cloudinary["Cloudinary"]:::external
        subgraph "Utilities Services"
            GC["Geocoding Service"]:::externalSmall
            IV["Image Validation Service"]:::externalSmall
            BC["Base64 Conversion Service"]:::externalSmall
        end
    end

    %% Connections between User and Frontend
    User -->|"accesses"| FE

    %% Internal Frontend structure
    FE -->|"renders"| App
    FE -->|"includes"| Components
    FE -->|"provides"| Views
    FE -->|"applies"| Layouts
    FE -->|"configured by"| Router
    FE -->|"manages state"| Store
    FE -->|"localizes"| Locale

    %% Frontend interactions
    Views -->|"triggers"| Store
    Components -->|"updates"| Store
    FE ---|"auth operations"| Firebase
    Components ---|"image upload"| Cloudinary

    %% Frontend to Backend
    Store -->|"API calls"| Backend

    %% Backend details
    Backend -->|"invokes"| Functions
    Backend -->|"stores/auth data"| Firebase
    Backend -->|"uploads images"| Cloudinary
    Backend -->|"calls"| GC
    Backend -->|"calls"| IV
    Backend -->|"calls"| BC

    %% Click Events for Frontend
    click FE "https://github.com/mariam168/eskan-/tree/main/src"
    click App "https://github.com/mariam168/eskan-/blob/main/src/App.vue"
    click Components "https://github.com/mariam168/eskan-/tree/main/src/components"
    click Views "https://github.com/mariam168/eskan-/tree/main/src/views"
    click Layouts "https://github.com/mariam168/eskan-/blob/main/src/layouts/DefaultLayout.vue"
    click Router "https://github.com/mariam168/eskan-/blob/main/src/router/index.js"
    click Store "https://github.com/mariam168/eskan-/tree/main/src/store"
    click Locale "https://github.com/mariam168/eskan-/tree/main/src/locale"

    %% Click Events for Backend
    click Backend "https://github.com/mariam168/eskan-/blob/main/server.js"
    click Functions "https://github.com/mariam168/eskan-/blob/main/functions/deleteUser.js"

    %% Click Events for External Integrations
    click Firebase "https://github.com/mariam168/eskan-/blob/main/src/config/firebase.js"
    click Cloudinary "https://github.com/mariam168/eskan-/blob/main/src/services/uploadToCloudinary.js"
    click GC "https://github.com/mariam168/eskan-/blob/main/src/services/geocodingService.js"
    click IV "https://github.com/mariam168/eskan-/blob/main/src/services/imageValidationService.js"
    click BC "https://github.com/mariam168/eskan-/blob/main/src/services/base64ToFileService.js"

    %% Styles
    classDef frontend fill:#bbdefb,stroke:#0d47a1,stroke-width:2px;
    classDef frontendSmall fill:#e3f2fd,stroke:#0d47a1,stroke-width:1px;
    classDef backend fill:#c8e6c9,stroke:#1b5e20,stroke-width:2px;
    classDef external fill:#ffe0b2,stroke:#e65100,stroke-width:2px;
    classDef externalSmall fill:#fff3e0,stroke:#e65100,stroke-width:1px;
    classDef user fill:#f8bbd0,stroke:#880e4f,stroke-width:2px;
```
