# libikk/elementstone architecture

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

- Interactive diagram: https://gitdiagram.com/libikk/elementstone
- Repository: https://github.com/libikk/elementstone

## Overview

##### Main Components Identification

The system consists of two main parts:
- Frontend Application (fe-app directory)
- Backend API Server (src directory)

##### Component Relationships

- Frontend → Backend: HTTP requests to /birds endpoint
- Backend → Data Layer: JSON file reading
- Backend → Frontend: Bird data response
- User → Frontend: User interactions

##### Specific Implementation Details

Technical aspects:
**Frontend (TypeScript + React):**
- Component Hierarchy
- * Layout (Parent)
- Header (Sticky)
- BirdsList
- * Bird (Individual bird component)
- Footer (Sticky)
- SCSS Styling System

**Backend (TypeScript + Node.js):**
- Express Routes
- * /birds (GET - Returns sorted bird data)
- * /root (Base endpoint)
- Static File Serving

Use the following visual elements:
- Rectangles: Main components
- Rounded rectangles: Sub-components
- Double lines: Data flow
- Frontend: Blue shades
- Backend: Green shades
- Data: Orange/Yellow
- External interfaces: Gray

##### Additional Notes

Architectural highlights:
- TypeScript usage across both frontend and backend
- Separation of concerns between frontend and backend
- Static file serving for images and data
- RESTful API design
- Component-based frontend architecture

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        App["React Frontend App"]:::frontend
        Layout["Layout Component"]:::frontend
        Header["Header Component"]:::frontend
        BirdsList["BirdsList Component"]:::frontend
        Bird["Bird Component"]:::frontend
        Footer["Footer Component"]:::frontend
        Styling["SCSS Styling"]:::frontend
        
        App --> Layout
        Layout --> Header
        Layout --> BirdsList
        Layout --> Footer
        BirdsList --> Bird
    end

    subgraph Backend
        Server["Express Server"]:::backend
        BirdsRoute["Birds Route Controller"]:::backend
        RootRoute["Root Route Controller"]:::backend
        ServerEntry["Server Entry Point"]:::backend
        
        ServerEntry --> Server
        Server --> BirdsRoute
        Server --> RootRoute
    end

    subgraph "Data Storage"
        JsonData["Static JSON Data"]:::data
        Images["Static Images"]:::data
    end

    BirdsList -. "HTTP GET /birds" .-> BirdsRoute
    BirdsRoute --> JsonData
    Bird -. "HTTP GET" .-> Images
    
    classDef frontend fill:#dae8fc,stroke:#6c8ebf
    classDef backend fill:#d5e8d4,stroke:#82b366
    classDef data fill:#fff2cc,stroke:#d6b656

    click App "https://github.com/Libikk/elementstone/blob/master/fe-app/src/App.tsx"
    click Layout "https://github.com/Libikk/elementstone/blob/master/fe-app/src/components/Layout.tsx"
    click Header "https://github.com/Libikk/elementstone/blob/master/fe-app/src/components/Header.tsx"
    click BirdsList "https://github.com/Libikk/elementstone/blob/master/fe-app/src/components/BirdsList.tsx"
    click Bird "https://github.com/Libikk/elementstone/blob/master/fe-app/src/components/Bird.tsx"
    click Footer "https://github.com/Libikk/elementstone/blob/master/fe-app/src/components/Footer.tsx"
    click Styling "https://github.com/Libikk/elementstone/blob/master/fe-app/src/App.scss"
    click Server "https://github.com/Libikk/elementstone/blob/master/src/app.ts"
    click BirdsRoute "https://github.com/Libikk/elementstone/blob/master/src/routes/birds/index.ts"
    click RootRoute "https://github.com/Libikk/elementstone/blob/master/src/routes/root/index.ts"
    click ServerEntry "https://github.com/Libikk/elementstone/blob/master/src/bin/www.ts"
    click JsonData "https://github.com/Libikk/elementstone/blob/master/public/data.json"
    click Images "https://github.com/Libikk/elementstone/tree/master/public/images"
```
