# croco-br/natal-chart architecture

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

- Interactive diagram: https://gitdiagram.com/croco-br/natal-chart
- Repository: https://github.com/croco-br/natal-chart

## Overview

##### Main Components Identification
The system appears to be a web application with the following key components:

a) Frontend Layer:
- Static assets (Font Awesome, JS)
- HTML templates
- Client-side functionality (index.js)

b) Backend Layer:
- FastAPI application
- Astrological calculation modules
- Geocoding service
- Cache system

c) External Dependencies:
- Kerykeion library for astrological calculations
- Bulma for CSS styling

**Client Layer -> API Layer -> Business Logic Layer -> External Services**

##### Component Relationships

Following interactions:
- Client -> FastAPI: HTTP requests
- FastAPI -> Business Logic: Internal calls
- Business Logic -> Cache: Data persistence
- Business Logic -> Kerykeion: Library integration
- Geocoder -> External Services: Location services

##### Technical Stack Callouts

- Python/FastAPI
- Bulma CSS Framework
- Kerykeion Library
- SQLite Cache
- Font Awesome
- JavaScript

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        UI["Web Interface"]:::frontend
        JS["Client Logic"]:::frontend
        FA["Font Awesome"]:::frontend
        UI --> JS
        UI --> FA
    end

    subgraph API
        FastAPI["FastAPI Server"]:::api
        Extensions["Extensions"]:::api
        FastAPI --> Extensions
    end

    subgraph "Business Logic"
        Engine["Core Engine"]:::logic
        
        subgraph "Calculation Modules"
            Agatha["Agathadaimon Calculator"]:::logic
            Angels["Angels Calculator"]:::logic
            Hermetic["Hermetic Calculator"]:::logic
            Sephiroth["Sephiroth Calculator"]:::logic
        end
        
        Geocoder["Geocoding Service"]:::logic
        Engine --> Agatha
        Engine --> Angels
        Engine --> Hermetic
        Engine --> Sephiroth
        Engine --> Geocoder
    end

    subgraph Storage
        Cache[(SQLite Cache)]:::storage
    end

    subgraph "External Services"
        Kerykeion["Kerykeion Library"]:::external
    end

    %% Relationships
    UI --> FastAPI
    FastAPI --> Engine
    Geocoder --> Cache
    Engine --> Kerykeion

    %% Click Events
    click UI "https://github.com/croco-br/natal-chart/blob/main/app/templates/index.html"
    click JS "https://github.com/croco-br/natal-chart/blob/main/app/static/js/index.js"
    click FA "https://github.com/croco-br/natal-chart/tree/main/app/static/font-awesome-4.7.0/"
    click FastAPI "https://github.com/croco-br/natal-chart/blob/main/app/main.py"
    click Extensions "https://github.com/croco-br/natal-chart/blob/main/app/extensions.py"
    click Engine "https://github.com/croco-br/natal-chart/blob/main/app/engine.py"
    click Agatha "https://github.com/croco-br/natal-chart/blob/main/app/agathadaimon.py"
    click Angels "https://github.com/croco-br/natal-chart/blob/main/app/angels.py"
    click Hermetic "https://github.com/croco-br/natal-chart/blob/main/app/hermetic.py"
    click Sephiroth "https://github.com/croco-br/natal-chart/blob/main/app/sephiroth.py"
    click Geocoder "https://github.com/croco-br/natal-chart/blob/main/app/geocoder.py"
    click Cache "https://github.com/croco-br/natal-chart/blob/main/cache/kerykeion_geonames_cache.sqlite"

    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef api fill:#2ecc71,stroke:#27ae60,color:white
    classDef logic fill:#e67e22,stroke:#d35400,color:white
    classDef storage fill:#f1c40f,stroke:#f39c12,color:white
    classDef external fill:#9b59b6,stroke:#8e44ad,color:white

    %% Legend
    subgraph Legend
        L1["Frontend Components"]:::frontend
        L2["API Layer"]:::api
        L3["Business Logic"]:::logic
        L4["Data Storage"]:::storage
        L5["External Services"]:::external
    end
```
