# isparxinfotech/datakawach architecture

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

- Interactive diagram: https://gitdiagram.com/isparxinfotech/datakawach
- Repository: https://github.com/isparxinfotech/datakawach

## Overview

##### Project type and purpose
- This is a single-page application (SPA) built with Angular (angular.json, src/app, tsconfig files).
- It provides user‐account management and file‐upload functionality to multiple cloud providers (S3, GCP, OneDrive), plus chat, metrics, and administrative dashboards.

##### File structure
- Top-level config: angular.json, tsconfig*.json, tailwind.config.js, package.json.
- Core UI layer: src/app/core/components (home, navbar, footer, account sub-components).
- Feature modules: account module houses login/register, dashboards, chat, upload flows.
- Services layer: src/app/services includes AuthService, ChatService, S3Service, GCPService, OneDriveService, AlertService, MetricsService, SuperAdminService.
- Environments: src/environments hold per-environment API endpoints and feature flags.

##### README
- (Empty aside from project name). Rely instead on file tree to infer external dependencies: AWS S3, GCP, OneDrive, plus an external authentication/REST API.

##### Main components and interactions
a. Frontend SPA
- Angular Components & Modules (UI layer)
- Angular Router (app-routing.module.ts)
- Shared UI (navbar, footer, alert)
b. Services Layer
- AuthService + AuthGuard → handles login flow, scoped to routes
- ChatService → WebSocket or REST chat API
- Cloud Storage Services (S3Service, GCPService, OneDriveService) → direct client‐SDK calls or proxied via API
- SuperAdminService + MetricsService → administrative endpoints
- AlertService → global notification bus
c. External Services
- Authentication Server (REST endpoints for login, register, personal info, session)
- AWS S3 buckets
- Google Cloud Storage buckets / Google Drive API
- Microsoft OneDrive API
- Chat backend (e.g. WebSocket or REST)
- Metrics/analytics backend
d. Data stores
- External databases and object stores (cloud providers)

##### Architectural patterns and design principles
- Component-driven UI (separate modules for account, navbar, footer).
- Dependency injection for services.
- Route-guarded navigation (AuthGuard).
- Service-oriented integration: each external integration has its own service.
- Model–view–service separation: models describe data; services handle data access; components handle presentation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend UI Layer
    subgraph "Frontend UI"
        Home["HomeComponent"]:::ui
        Navbar["NavbarComponent"]:::ui
        Footer["FooterComponent"]:::ui
        Router["AppRouter (app-routing.module.ts)"]:::ui
        Login["LoginComponent"]:::ui
        RegisterUser["RegisterUserComponent"]:::ui
        UserDashboard["UserDashboardComponent"]:::ui
        CorporateDashboard["CorporateDashboardComponent"]:::ui
        AdminDashboard["AdminDashboardComponent"]:::ui
        GoogleDashboard["GoogleDashboardComponent"]:::ui
        ChatComp["ChatComponent"]:::ui
        Upload["UploadComponent"]:::ui
        UploadCloud["UploadToCloudComponent"]:::ui
    end

    %% Services Layer
    subgraph "Services Layer"
        AuthService["AuthService"]:::service
        AuthGuard["AuthGuard"]:::service
        ChatService["ChatService"]:::service
        S3Service["S3Service"]:::service
        GCPService["GCPService"]:::service
        OneDriveService["OneDriveService"]:::service
        MetricsService["MetricsService"]:::service
        SuperAdminService["SuperAdminService"]:::service
        AlertService["AlertService"]:::service
    end

    %% Models and Config
    subgraph "Models & Configuration"
        DataModels["Models Directory"]:::model
        EnvDev["environment.development.ts"]:::config
        EnvProd["environment.ts"]:::config
        Tailwind["tailwind.config.js"]:::config
        AngularConfig["angular.json"]:::config
    end

    %% External Systems
    subgraph "External Systems"
        AuthAPI["Authentication API"]:::external
        ChatAPI["Chat Backend (WebSocket/REST)"]:::external
        MetricsAPI["Metrics/Analytics API"]:::external
        S3Bucket["AWS S3 Bucket"]:::external
        GCSBucket["Google Cloud Storage"]:::external
        OneDriveAPI["OneDrive API"]:::external
    end

    %% UI to Router & Services
    Home -->|navigates| Router
    Navbar -->|renders| Router
    Footer -->|renders| Router
    Router -->|guards| AuthGuard
    AuthGuard -->|uses| AuthService

    Login -->|calls| AuthService
    RegisterUser -->|calls| AuthService
    UserDashboard -->|calls| S3Service
    CorporateDashboard -->|calls| S3Service
    AdminDashboard -->|calls| SuperAdminService
    GoogleDashboard -->|calls| GCPService
    ChatComp -->|calls| ChatService
    Upload -->|calls| S3Service
    UploadCloud -->|calls| OneDriveService

    %% Services to External Systems
    AuthService -->|REST| AuthAPI
    ChatService -->|WebSocket/REST| ChatAPI
    MetricsService -->|REST| MetricsAPI
    SuperAdminService -->|REST| AuthAPI
    S3Service -->|SDK Calls| S3Bucket
    GCPService -->|SDK Calls| GCSBucket
    OneDriveService -->|SDK Calls| OneDriveAPI

    %% Services to Alert
    AuthService -->|alerts| AlertService
    ChatService -->|alerts| AlertService
    S3Service -->|alerts| AlertService
    GCPService -->|alerts| AlertService
    OneDriveService -->|alerts| AlertService
    MetricsService -->|alerts| AlertService
    SuperAdminService -->|alerts| AlertService
    AlertService -->|notifies| Home
    AlertService -->|notifies| Navbar
    AlertService -->|notifies| Footer
    AlertService -->|notifies| Login
    AlertService -->|notifies| RegisterUser
    AlertService -->|notifies| UserDashboard
    AlertService -->|notifies| CorporateDashboard
    AlertService -->|notifies| AdminDashboard
    AlertService -->|notifies| GoogleDashboard
    AlertService -->|notifies| ChatComp
    AlertService -->|notifies| Upload
    AlertService -->|notifies| UploadCloud

    %% Config and Models usage
    DataModels -->|defines| AuthService
    DataModels -->|defines| ChatService
    DataModels -->|defines| S3Service
    DataModels -->|defines| GCPService
    DataModels -->|defines| OneDriveService
    DataModels -->|defines| MetricsService
    DataModels -->|defines| SuperAdminService
    DataModels -->|defines| AlertService

    EnvDev -->|configures| AuthService
    EnvDev -->|configures| ChatService
    EnvDev -->|configures| S3Service
    EnvDev -->|configures| GCPService
    EnvDev -->|configures| OneDriveService
    EnvDev -->|configures| MetricsService
    EnvDev -->|configures| SuperAdminService

    EnvProd -->|configures| AuthService
    EnvProd -->|configures| ChatService
    EnvProd -->|configures| S3Service
    EnvProd -->|configures| GCPService
    EnvProd -->|configures| OneDriveService
    EnvProd -->|configures| MetricsService
    EnvProd -->|configures| SuperAdminService

    Tailwind -->|styles| Home
    Tailwind -->|styles| Navbar
    Tailwind -->|styles| Footer

    AngularConfig -->|bootstraps| Home
    AngularConfig -->|bootstraps| Router

    %% Click Events
    click Home "https://github.com/isparxinfotech/datakawach/blob/main/src/app/core/components/home/home.component.ts"
    click Navbar "https://github.com/isparxinfotech/datakawach/blob/main/src/app/core/components/navbar/navbar.component.ts"
    click Footer "https://github.com/isparxinfotech/datakawach/blob/main/src/app/core/components/footer/footer.component.ts"
    click Login "https://github.com/isparxinfotech/datakawach/blob/main/src/app/core/components/account/login/login.component.ts"
    click RegisterUser "https://github.com/isparxinfotech/datakawach/blob/main/src/app/core/components/account/register-user/register-user.component.ts"
    click UserDashboard "https://github.com/isparxinfotech/datakawach/blob/main/src/app/core/components/account/user-dashboard/user-dashboard.component.ts"
    click CorporateDashboard "https://github.com/isparxinfotech/datakawach/blob/main/src/app/core/components/account/corporate-dashboard/corporate-dashboard.component.ts"
    click AdminDashboard "https://github.com/isparxinfotech/datakawach/blob/main/src/app/core/components/account/admin-dashboard/admin-dashboard.component.ts"
    click GoogleDashboard "https://github.com/isparxinfotech/datakawach/blob/main/src/app/core/components/account/google-dashboard/google-dashboard.component.ts"
    click ChatComp "https://github.com/isparxinfotech/datakawach/blob/main/src/app/core/components/account/chat/chat.component.ts"
    click Upload "https://github.com/isparxinfotech/datakawach/blob/main/src/app/core/components/account/upload/upload.component.ts"
    click UploadCloud "https://github.com/isparxinfotech/datakawach/blob/main/src/app/core/components/account/upload-to-cloud/upload-to-cloud.component.ts"
    click AuthService "https://github.com/isparxinfotech/datakawach/blob/main/src/app/services/auth.service.ts"
    click AuthGuard "https://github.com/isparxinfotech/datakawach/blob/main/src/app/services/auth.gaurd.ts"
    click ChatService "https://github.com/isparxinfotech/datakawach/blob/main/src/app/services/chat.service.ts"
    click S3Service "https://github.com/isparxinfotech/datakawach/blob/main/src/app/services/S3Service.ts"
    click GCPService "https://github.com/isparxinfotech/datakawach/blob/main/src/app/services/gcp.service.ts"
    click OneDriveService "https://github.com/isparxinfotech/datakawach/blob/main/src/app/services/OneDriveService.ts"
    click MetricsService "https://github.com/isparxinfotech/datakawach/blob/main/src/app/services/metrics.service.ts"
    click SuperAdminService "https://github.com/isparxinfotech/datakawach/blob/main/src/app/services/super-admin.service.ts"
    click AlertService "https://github.com/isparxinfotech/datakawach/blob/main/src/app/services/AlertService.ts"
    click DataModels "https://github.com/isparxinfotech/datakawach/tree/main/src/app/models"
    click EnvDev "https://github.com/isparxinfotech/datakawach/blob/main/src/environments/environment.development.ts"
    click EnvProd "https://github.com/isparxinfotech/datakawach/blob/main/src/environments/environment.ts"
    click Tailwind "https://github.com/isparxinfotech/datakawach/blob/main/tailwind.config.js"
    click AngularConfig "https://github.com/isparxinfotech/datakawach/blob/main/angular.json"

    %% Styles
    classDef ui fill:#cce5ff,stroke:#004085,color:#004085
    classDef service fill:#d4edda,stroke:#155724,color:#155724
    classDef external fill:#fff3cd,stroke:#856404,color:#856404
    classDef config fill:#f0f0f0,stroke:#333,color:#333
    classDef model fill:#e2e3e5,stroke:#6c757d,color:#6c757d
```
