# ashish1323/log-analyser architecture

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

- Interactive diagram: https://gitdiagram.com/ashish1323/log-analyser
- Repository: https://github.com/ashish1323/log-analyser

## Overview

Project Type: This is a web-based log analysis tool that processes and displays log file data.

##### Main Components

a. Frontend Layer:
- Web Interface (EJS Templates)
- Static Assets (public/assets)
- File Upload Component

b. Backend Layer:
- Express.js Server (index.js)
- Log Processing Modules
- File Management System

c. Processing Modules:
- Download Module
- Most Calls Analysis Module
- Regex Pattern Matching Module

##### Component Relationships

**[Client Browser] ←→ [Web Server Layer]**
- ↓
- [File Upload Handler] → [File Storage]
- ↓
- [Log Processing Pipeline]
- ↙     ↓     ↘
**[Download] [Regex] [Most Calls]**
- ↓     ↓     ↓
- [Results Aggregator]
- ↓
- [Template Renderer]
- ↓
- [Client Display]

##### Specific Implementation Details

a. Frontend Components:
- Views/home.ejs as the entry point
- Views/displayLog.ejs as the results view
- Public/assets for static resource serving

b. Backend Components:
- Index.js as the main server
- Modules/ directory with its three primary processors
- File upload handling mechanism

##### Key Technical Elements to Emphasize
- Node.js runtime environment
- Express.js web framework
- EJS template engine
- File system interactions
- Log processing modules

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
    end

    subgraph "Web Server Layer"
        Server["Express Server"]:::server
        Static["Static Assets"]:::static
        Templates["Web Templates"]:::templates
    end

    subgraph "File Management"
        Upload["File Upload Handler"]:::handler
        Storage["File Storage"]:::storage
    end

    subgraph "Processing Pipeline"
        Pipeline["Log Processing Pipeline"]:::pipeline
        Download["Download Module"]:::module
        Regex["Regex Pattern Module"]:::module
        MostCalls["Most Calls Module"]:::module
        Results["Results Aggregator"]:::results
    end

    subgraph "View Layer"
        Home["Home View"]:::view
        Display["Results Display"]:::view
    end

    Browser <--> Server
    Server --> Static
    Server --> Templates
    Server --> Upload
    Upload --> Storage
    Storage --> Pipeline
    Pipeline --> Download
    Pipeline --> Regex
    Pipeline --> MostCalls
    Download --> Results
    Regex --> Results
    MostCalls --> Results
    Results --> Display
    Templates --> Home
    Templates --> Display

    %% Click Events
    click Server "https://github.com/Ashish1323/log-analyser/blob/main/index.js"
    click Static "https://github.com/Ashish1323/log-analyser/tree/main/public/assets/"
    click Home "https://github.com/Ashish1323/log-analyser/blob/main/views/home.ejs"
    click Display "https://github.com/Ashish1323/log-analyser/blob/main/views/displayLog.ejs"
    click Storage "https://github.com/Ashish1323/log-analyser/tree/main/public/csv/"
    click Download "https://github.com/Ashish1323/log-analyser/blob/main/modules/download.js"
    click Regex "https://github.com/Ashish1323/log-analyser/blob/main/modules/regex.js"
    click MostCalls "https://github.com/Ashish1323/log-analyser/blob/main/modules/mostcalls.js"
    click Pipeline "https://github.com/Ashish1323/log-analyser/tree/main/modules/"

    %% Styles
    classDef server fill:#ff6b6b
    classDef static fill:#4ecdc4
    classDef templates fill:#45b7d1
    classDef handler fill:#96ceb4
    classDef storage fill:#ffeead
    classDef pipeline fill:#d4a5a5
    classDef module fill:#9de0ad
    classDef results fill:#ff9999
    classDef view fill:#87ceeb

    %% Legend
    subgraph Legend
        L1["Server Components"]:::server
        L2["Static Resources"]:::static
        L3["Template Components"]:::templates
        L4["Processing Modules"]:::module
        L5["Storage Components"]:::storage
        L6["View Components"]:::view
    end
```
