# cliffamadeus/project-kalasan architecture

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

- Interactive diagram: https://gitdiagram.com/cliffamadeus/project-kalasan
- Repository: https://github.com/cliffamadeus/project-kalasan

## Overview

##### Main Components Identification

The system appears to be a web application with the following key components:

a) Frontend Layer:
- Static Assets (CSS, Images)
- Client-side JavaScript Controllers
- HTML Views
- Visualization Components

b) Backend Layer:
- Node.js Server (server.js)
- Data Storage (JSON)

**┌─ Client Layer ─────────────────┐**
- ┌─ Views ──┐  ┌─ Controllers ─┐│
- Home    │  │- Map Dash     ││
- Map     │  │- Recent       ││
- ┘  │- Search       ││
- Map Script    ││
- ┘││
- ┘
- ↕ HTTP/HTTPS
**┌─ Server Layer ────────────────┐**
- ┌─ Node.js Server ───────────┐│
- (server.js)            ││
- ┘│
- ┌─ Data Storage ────────────┐ │
- (trees.json)          │ │
- ┘ │
- ┘

##### Component Details

- Blue rectangles: Client-side components
- Green rectangles: Server-side components
- Yellow rectangles: Data storage
- Purple diamonds: External services (if any, like map providers)

##### Specific Elements

a) Client Layer:
- Relationship between views and controllers
- Map-related components
- Router.js as a central navigation controller

b) Server Layer:
- Node.js server handling requests
- JSON data storage for tree information
- API endpoints for data retrieval

##### Data Flow Representation

- Client-server communication
- Data flow between controllers and views
- JSON data access patterns
- Data visualization flow

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        subgraph Views
            Home["Home View"]
            Map["Map View"]
        end

        subgraph Controllers
            MapDash["Map Dashboard"]
            Recent["Recent Records"]
            Search["Search Controller"]
            MapScript["Map Script"]
        end

        subgraph Static
            CSS["Styles"]
            Images["Image Assets"]
        end

        Router["Client Router"]
    end

    subgraph Server
        NodeServer["Node.js Server"]
        DataStore["Tree Data Storage"]
    end

    %% Relationships
    Router --> Home
    Router --> Map
    Map --> MapDash
    Map --> Recent
    Map --> Search
    Map --> MapScript
    MapDash --> NodeServer
    Recent --> NodeServer
    Search --> NodeServer
    NodeServer --> DataStore

    %% Styling
    classDef frontend fill:#a8d5ff
    classDef server fill:#98ff98
    classDef storage fill:#ffeb99
    classDef static fill:#ffb366

    class Home,Map,MapDash,Recent,Search,MapScript,Router frontend
    class NodeServer server
    class DataStore storage
    class CSS,Images static

    %% Click events
    click Home "https://github.com/cliffamadeus/project-kalasan/blob/main/views/home.html"
    click Map "https://github.com/cliffamadeus/project-kalasan/blob/main/views/map.html"
    click MapDash "https://github.com/cliffamadeus/project-kalasan/blob/main/js/map-controllers/map-dash.js"
    click Recent "https://github.com/cliffamadeus/project-kalasan/blob/main/js/map-controllers/map-recent-records.js"
    click Search "https://github.com/cliffamadeus/project-kalasan/blob/main/js/map-controllers/map-search.js"
    click MapScript "https://github.com/cliffamadeus/project-kalasan/blob/main/js/map-controllers/map-script.js"
    click CSS "https://github.com/cliffamadeus/project-kalasan/blob/main/css/style.css"
    click Images "https://github.com/cliffamadeus/project-kalasan/tree/main/img"
    click Router "https://github.com/cliffamadeus/project-kalasan/blob/main/js/router.js"
    click NodeServer "https://github.com/cliffamadeus/project-kalasan/blob/main/server.js"
    click DataStore "https://github.com/cliffamadeus/project-kalasan/blob/main/json/trees.json"

    %% Legend
    subgraph Legend
        Frontend["Frontend Components"]:::frontend
        ServerComp["Server Components"]:::server
        StorageComp["Storage Components"]:::storage
        StaticComp["Static Assets"]:::static
    end
```
