# vedastro/vedastro architecture

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

- Interactive diagram: https://gitdiagram.com/vedastro/vedastro
- Repository: https://github.com/vedastro/vedastro

## Overview

##### Major Components
- Core Calculation Engine/Library:
– This is found mainly under the “Library” folder (plus “LibraryTests”, “MatchMLPipeline”, and modules like “MigrateGeoLocationData”). It includes modules for astrological calculations, event prediction (see the detailed explanation in the README), numerology and chart evaluation.
- API Layer:
– Located in the “API” folder (with its own project, Dockerfile, and program) plus “APITester” for validating endpoints. This layer exposes the astrological computations as RESTful services, including support for AI Astrologer and data retrieval. It is built with .NET (C#) and containerized (Docker) and deployed on Azure.
- Website and Mobile UI:
– In the “Website” and “Website_Mobile” folders, you have Blazor-based user interfaces that call the API. The website is a static web app using Blazor WebAssembly, with additional frontend assets (HTML, CSS, JS, images, and SEO configurations) provided to ensure a “drunk proof” user experience.
- Desktop and Console Applications:
– There are Desktop applications (in the “Desktop” folder with multiple platform-specific versions like MAUI app and a macOS launcher) and a “Console” app. These tools are likely used for purposes such as API launching, debugging, and offline calculations.
- Additional Modules:
– “LLMCoder” and “DocToEmbeddings” indicate extensions for language/AI functionality.
– “WebScraper” collects external astrological or related data.
– “StaticTableGenerator” and “Publisher” provide additional data generation/processing and deployment features.
– The “Others” directory contains archived and demo code, scripts (for container and build management) and assorted documentation files (including design artworks and examples).

##### Relationships and Interactions
- The User (via a browser or mobile device) interacts with the Website/Mobile UI components.
- The Website UI, mostly built with Blazor WebAssembly, sends API requests to the API backend (which runs as Azure Functions behind a CDN and uses Docker containers).
- The API layer internally calls methods in the Core Calculation Engine/Library to process astrological queries (for horoscope generation, event prediction, numerology, etc.).
- Desktop applications and the APITester serve as auxiliary utilities for testing, launching, and debugging rather than as primary production systems.
- Data comes in from multiple sources: static XML files (such as EventDataList.xml) for event prediction, CSV files for datasets (in directories like “HuggingFace”), and possibly dynamic input (via user submission) that gets processed by the calculation library.
- The system also uses a pipeline for Machine Learning (see “MatchMLPipeline”) that likely ties in with the astrological predictions and data generation.
- The use of Azure (via containerized images, DNS/CDN for custom domains, and Azure Table storage or other database services) is an important part of the deployment design.

##### Architectural Patterns and Design Principles
- Modular and Multi-Tier Separation: The project is divided logically between presentation (Website, Mobile, Desktop), business logic (Library/Calculation Engine), and service/API layers.
- Containerization and Cloud Deployment: The API is containerized and deployed via Docker and Azure Functions while leveraging Azure CDN and custom domain routing.
- Extensibility: The design “Build On Top” philosophy means that the Library’s prediction logic is exported as a NuGet package (.NET) and even published on PyPI for Python users, enabling integration with different ecosystems.
- Testing and Experimentation: Separate APITester, Console apps, and dedicated test projects (LibraryTests) indicate a focus on continuous integration testing.
- Multi-Platform UI: With separate projects for Desktop (across Windows, macOS, Linux, MAUI) and for Website/Mobile, the design embraces cross-platform user experience and “drunk proof” simple UI design principles.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Top Level: User
    U("User"):::frontend

    %% User Interface Layer
    subgraph "User Interface Layer"
        WebUI("Website UI<br/>(Blazor, HTML/CSS/JS)"):::frontend
        MobileUI("Mobile UI<br/>(Blazor, HTML/CSS/JS)"):::frontend
        DesktopApps("Desktop Apps"):::frontend
        ConsoleApps("Console Apps"):::frontend
    end

    %% Service Layer
    subgraph "Service Layer"
        API("API Layer<br/>(.NET, Azure Functions,<br/>Docker, REST API)"):::backend
        APITester("APITester"):::aux
    end

    %% Business Logic Layer
    subgraph "Business Logic Layer"
        Core("Core Calculation Engine<br/>(Astrology Calculations,<br/>Event Prediction, Numerology, ML Pipeline)"):::logic
    end

    %% Additional Modules
    subgraph "Additional Modules"
        LLMCoder("LLMCoder"):::aux
        DocToEmbeddings("DocToEmbeddings"):::aux
        StaticTableGenerator("StaticTableGenerator"):::aux
        WebScraper("WebScraper"):::aux
        Publisher("Publisher"):::aux
        Others("Others"):::aux
    end

    %% Data Sources
    DataSources["Data Sources<br/>(XML, CSV, Azure Storage)"]:::data

    %% User interactions
    U -->|"accesses"| WebUI
    U -->|"accesses"| MobileUI
    U -->|"uses"| DesktopApps
    U -->|"uses"| ConsoleApps

    %% UI to API interactions
    WebUI -->|"REST API"| API
    MobileUI -->|"REST API"| API
    DesktopApps -->|"API calls"| API
    ConsoleApps -->|"API calls"| API
    APITester -->|"tests"| API

    %% API interactions with Core and Data Sources
    API -->|"calls"| Core
    API -->|"reads/writes"| DataSources

    %% Core interactions with Data Sources and Additional Modules
    Core -->|"fetches config/data"| DataSources
    Core -->|"integrates"| LLMCoder
    Core -->|"integrates"| DocToEmbeddings
    Core -->|"utilizes"| StaticTableGenerator
    Core -->|"utilizes"| WebScraper
    Core -->|"notifies"| Publisher

    %% Click events for Component Mapping
    click Core "https://github.com/vedastro/vedastro/tree/master/Library"
    click Core "https://github.com/vedastro/vedastro/tree/master/LibraryTests"
    click Core "https://github.com/vedastro/vedastro/tree/master/MatchMLPipeline"
    click Core "https://github.com/vedastro/vedastro/tree/master/MigrateGeoLocationData"
    click API "https://github.com/vedastro/vedastro/tree/master/API"
    click APITester "https://github.com/vedastro/vedastro/tree/master/APITester"
    click WebUI "https://github.com/vedastro/vedastro/tree/master/Website"
    click MobileUI "https://github.com/vedastro/vedastro/tree/master/Website_Mobile"
    click DesktopApps "https://github.com/vedastro/vedastro/tree/master/Desktop"
    click ConsoleApps "https://github.com/vedastro/vedastro/tree/master/Console"
    click LLMCoder "https://github.com/vedastro/vedastro/tree/master/LLMCoder"
    click DocToEmbeddings "https://github.com/vedastro/vedastro/tree/master/DocToEmbeddings"
    click StaticTableGenerator "https://github.com/vedastro/vedastro/tree/master/StaticTableGenerator"
    click WebScraper "https://github.com/vedastro/vedastro/tree/master/WebScraper"
    click Publisher "https://github.com/vedastro/vedastro/tree/master/Publisher"
    click Others "https://github.com/vedastro/vedastro/tree/master/Others"

    %% Style definitions
    classDef frontend fill:#ffcccc,stroke:#cc0000,stroke-width:2px;
    classDef backend fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef logic fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef aux fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef data fill:#e2e3e5,stroke:#6c757d,stroke-width:2px;
```
