# aneeshmg/baray architecture

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

- Interactive diagram: https://gitdiagram.com/aneeshmg/baray
- Repository: https://github.com/aneeshmg/baray

## Overview

Baray is a minimalistic Node.js logger. An application imports the package, creates a logger, and submits messages through log/info/warn/error; entries are formatted with app name, type, and timestamp, then printed and, for info/warn/error, appended to date-based files. The map covers the sampled runtime; the README documents the same API and options.

Main entry points: [`lib/Baray.js`](https://github.com/aneeshmg/baray/blob/master/lib/Baray.js) (Baray logger), [`index.js`](https://github.com/aneeshmg/baray/blob/master/index.js) (Package entry), [`lib/utils.js`](https://github.com/aneeshmg/baray/blob/master/lib/utils.js) (File and color utilities), [`lib/types.js`](https://github.com/aneeshmg/baray/blob/master/lib/types.js) (Log types)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_application(("Application"))
node_entry["Package entry<br/>[index.js]"]
node_logger["Baray logger<br/>[Baray.js]"]
node_record["Log entry<br/>[Baray.js]"]
node_types["Log types<br/>[types.js]"]
node_utils["File and color utilities<br/>[utils.js]"]
node_console["Console output"]
node_filesystem[("Filesystem")]

node_application -->|"imports"| node_entry
node_entry -->|"exports"| node_logger
node_application -->|"calls log methods"| node_logger
node_logger -->|"reads constants"| node_types
node_logger -->|"creates entries"| node_record
node_logger -->|"gets file streams"| node_utils
node_logger -->|"prints output"| node_console
node_logger -->|"creates log directory"| node_filesystem
node_utils -->|"opens append streams"| node_filesystem

click node_entry "https://github.com/aneeshmg/baray/blob/master/index.js"
click node_logger "https://github.com/aneeshmg/baray/blob/master/lib/Baray.js"
click node_record "https://github.com/aneeshmg/baray/blob/master/lib/Baray.js"
click node_types "https://github.com/aneeshmg/baray/blob/master/lib/types.js"
click node_utils "https://github.com/aneeshmg/baray/blob/master/lib/utils.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_application,node_console toneIndigo
class node_entry,node_logger,node_record,node_types,node_utils toneTeal
class node_filesystem toneAmber
```

## Components

### Other components

- **Application**
- [Package entry](https://github.com/aneeshmg/baray/blob/master/index.js): `index.js`
- [Baray logger](https://github.com/aneeshmg/baray/blob/master/lib/Baray.js): `lib/Baray.js`
- [Log entry](https://github.com/aneeshmg/baray/blob/master/lib/Baray.js): `lib/Baray.js`
- [Log types](https://github.com/aneeshmg/baray/blob/master/lib/types.js): `lib/types.js`
- [File and color utilities](https://github.com/aneeshmg/baray/blob/master/lib/utils.js): `lib/utils.js`
- **Console output**
- **Filesystem**

## Connections

- Application → Package entry: imports
- Package entry → Baray logger: exports
- Application → Baray logger: calls log methods
- Baray logger → Log types: reads constants
- Baray logger → Log entry: creates entries
- Baray logger → File and color utilities: gets file streams
- Baray logger → Console output: prints output
- Baray logger → Filesystem: creates log directory
- File and color utilities → Filesystem: opens append streams
