# aura-nw/aurascan architecture

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

- Interactive diagram: https://gitdiagram.com/aura-nw/aurascan
- Repository: https://github.com/aura-nw/aurascan

## Overview

This project is a large, feature-rich Angular application named AuraScan. Its purpose is to allow users to track wallets, active users, and blockchain-related statistics. The codebase is organized as a full-fledged, client-side frontend using Angular CLI (version 16) that leverages modular design principles and uses deployment tooling (Docker, Nginx) and CI pipelines (GitHub workflows) to ensure quality and ease of delivery.

##### Main components of the system
- Frontend Application: The core is built using Angular. It includes layers like pages (for account details, blocks, contracts, proposals, etc.), shared components (cards, dialogs, paginators, notifications, etc.), and global modules (layouts, shared modules, material module).
- Modules & Layers: The project is split into various modules such as “pages”, “core”, “layouts”, “shared”, and “assets”. Each plays a distinct role in user interface, business logic, styling, and external configuration.
- Deployment & CI/CD: The repository includes Dockerfile(s), Nginx configuration, as well as dedicated CI folders and GitHub workflows that facilitate automated testing and build procedures.
- External Integrations & Libraries: There are utility modules (like those in “cosmoskit”, “ethers”, “signing”) which suggest integrations with blockchain networks. These facilitate wallet connection, crypto operations, or blockchain-specific interactions.

##### Architectural patterns and design principles
- Modular Design: The separation into pages, core services, layouts, and shared modules is indicative of a modular architecture.
- Layered Approach: The clear division between UI, business logic, and infrastructure makes it easier to understand dependencies and data flow.
- Dependency Injection: Angular’s DI is used extensively across services and components to manage dependencies and maintain separation of concerns.
- CI/CD and Containerization: Use of Docker and automated workflows signals a commitment to continuous integration and deployment.

##### Specific elements
- Labeled Components: All major modules (Frontend, Core, Shared, Deployments, External APIs) should be clearly labeled.
- The flow of data from UI components to core services.
- How core services interact with external APIs.
- The build and deployment pipeline from source code → CI/CD → Docker Image → Nginx serving the application.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Angular Frontend Subgraph
    subgraph "Angular Frontend"
        AF_Pages["Pages: Feature Areas"]:::frontend
        AF_Shared["Shared Components"]:::frontend
        AF_Layouts["Layouts"]:::frontend
    end

    %% Core Module Subgraph
    subgraph "Core Module"
        C_DS["Data Services"]:::core
        C_Helper["Helpers"]:::core
        C_Interceptor["Interceptors"]:::core
        C_Constants["Constants"]:::core
        C_Models["Models"]:::core
        C_Pipes["Pipes"]:::core
        C_UT_Ethers["Utilities: Ethers"]:::core
        C_UT_Cosmoskit["Utilities: CosmosKit"]:::core
        C_UT_Signing["Utilities: Signing"]:::core
    end

    %% Deployment & CI/CD Subgraph
    subgraph "Deployment & CI/CD"
        D_CI["CI Pipelines"]:::deployment
        D_CI_Scripts["CI Scripts"]:::deployment
        D_Docker["Docker (Dockerfile)"]:::deployment
        D_Nginx["Web Server (nginx.conf)"]:::deployment
    end

    %% Assets & Configurations Subgraph
    subgraph "Assets & Configurations"
        AC_Assets["Assets"]:::assets
        AC_Env["Environments"]:::assets
    end

    %% External Integrations
    Ext_Integration["External Integrations (Blockchain/Wallets)"]:::external

    %% Connections from Angular Frontend to Core Module
    AF_Pages -->|"calls"| C_DS

    %% Connections within Core Module
    C_DS -->|"uses"| C_Helper
    C_DS -->|"uses"| C_Interceptor
    C_DS -->|"references"| C_Constants
    C_DS -->|"references"| C_Models
    C_DS -->|"references"| C_Pipes
    C_DS -->|"integrates_with"| C_UT_Ethers
    C_DS -->|"integrates_with"| C_UT_Cosmoskit
    C_DS -->|"integrates_with"| C_UT_Signing
    C_DS -->|"calls"| Ext_Integration

    %% Deployment Pipeline Flow
    D_CI -->|"triggers build"| D_Docker
    D_Docker -->|"creates image"| D_Nginx
    D_Nginx -->|"serves"| AF_Pages
    D_CI_Scripts -->|"supports"| D_CI

    %% Assets providing resources to Frontend
    AC_Assets -->|"provides styling/icons"| AF_Shared

    %% Class Definitions for styling
    classDef frontend fill:#DDEBF7,stroke:#1F4E79,stroke-width:2px;
    classDef core fill:#FFEB9C,stroke:#C65911,stroke-width:2px;
    classDef deployment fill:#C6EFCE,stroke:#38761D,stroke-width:2px;
    classDef external fill:#F4CCCC,stroke:#CC0000,stroke-width:2px;
    classDef assets fill:#FFF2CC,stroke:#B45F06,stroke-width:2px;

    %% Click Events for Angular Frontend
    click AF_Pages "https://github.com/aura-nw/aurascan/tree/main/src/app/pages"
    click AF_Shared "https://github.com/aura-nw/aurascan/tree/main/src/app/shared"
    click AF_Layouts "https://github.com/aura-nw/aurascan/tree/main/src/app/layouts"

    %% Click Events for Core Module
    click C_DS "https://github.com/aura-nw/aurascan/tree/main/src/app/core/data-services"
    click C_Helper "https://github.com/aura-nw/aurascan/tree/main/src/app/core/helpers"
    click C_Interceptor "https://github.com/aura-nw/aurascan/tree/main/src/app/core/interceptors"
    click C_Constants "https://github.com/aura-nw/aurascan/tree/main/src/app/core/constants"
    click C_Models "https://github.com/aura-nw/aurascan/tree/main/src/app/core/models"
    click C_Pipes "https://github.com/aura-nw/aurascan/tree/main/src/app/core/pipes"
    click C_UT_Ethers "https://github.com/aura-nw/aurascan/tree/main/src/app/core/utils/ethers"
    click C_UT_Cosmoskit "https://github.com/aura-nw/aurascan/tree/main/src/app/core/utils/cosmoskit"
    click C_UT_Signing "https://github.com/aura-nw/aurascan/tree/main/src/app/core/utils/signing"

    %% Click Events for Deployment & CI/CD
    click D_CI "https://github.com/aura-nw/aurascan/tree/main/.github/workflows"
    click D_CI_Scripts "https://github.com/aura-nw/aurascan/tree/main/ci"
    click D_Docker "https://github.com/aura-nw/aurascan/tree/main/Dockerfile"
    click D_Nginx "https://github.com/aura-nw/aurascan/blob/main/nginx.conf"

    %% Click Events for Assets & Configurations
    click AC_Assets "https://github.com/aura-nw/aurascan/tree/main/src/assets"
    click AC_Env "https://github.com/aura-nw/aurascan/tree/main/src/environments"
```
