# lompendans/eznas architecture

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

- Interactive diagram: https://gitdiagram.com/lompendans/eznas
- Repository: https://github.com/lompendans/eznas

## Overview

ezNAS is a self-hosted LAN NAS. The main workflow is a user managing files in the browser, with the Go server handling file operations and storage. Separate capabilities cover search, recycle-bin recovery, ZIP backups, password and request security, TLS, sharing, and verified updates. The excerpts show file, search, storage-display, and update UI requests, but omit much of the server routing and handler code; uncertain wiring is therefore not asserted as a confirmed call.

Main entry points: [`main.go`](https://github.com/lompendans/eznas/blob/main/main.go) (Server and API), [`web/app.js`](https://github.com/lompendans/eznas/blob/main/web/app.js) (File manager UI), [`shares.go`](https://github.com/lompendans/eznas/blob/main/shares.go) (Share links), [`updater.go`](https://github.com/lompendans/eznas/blob/main/updater.go) (Verified updater)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_ui["File manager UI<br/>[app.js]"]
end

subgraph group_server["NAS server"]
  node_server_entry["Server and API<br/>[main.go]"]
  node_file_ops["File operations<br/>[main.go]"]
  node_search["Name search<br/>[main.go]"]
  node_recycle_backup["Recycle bin and backups<br/>[main.go]"]
  node_storage[("NAS storage")]
  node_capacity["Capacity reporting<br/>[storage_linux.go]"]
end

subgraph group_protection["Security and access"]
  node_config["Configuration and sessions<br/>[main.go]"]
  node_request_security["Request safeguards<br/>[security.go]"]
  node_tls["TLS management<br/>[main.go]"]
end

subgraph group_sharing["Shared links"]
  node_share_api["Share links<br/>[shares.go]"]
  node_share_store[("Share records<br/>[shares.go]")]
end

subgraph group_operations["Maintenance"]
  node_updater["Verified updater<br/>[updater.go]"]
  node_release_service["GitHub releases"]
end

node_user(("NAS user"))

node_user -->|"manages files"| node_ui
node_ui -->|"sends API requests"| node_server_entry
node_server_entry -->|"dispatches requests"| node_file_ops
node_server_entry -->|"dispatches requests"| node_search
node_file_ops -->|"reads and writes"| node_storage
node_search -->|"searches names"| node_storage
node_recycle_backup -->|"backs up and recovers"| node_storage
node_server_entry -->|"checks request origin"| node_request_security
node_ui -->|"manages shares"| node_share_api
node_share_api -->|"persists records"| node_share_store
node_share_api -->|"serves shared files"| node_storage
node_ui -->|"requests installation"| node_updater
node_updater -->|"downloads releases"| node_release_service
node_server_entry -.->|"routes update request"| node_updater
node_server_entry -.->|"routes storage actions"| node_recycle_backup
node_ui -->|"displays capacity"| node_capacity
node_server_entry -->|"configures HTTPS"| node_tls

click node_ui "https://github.com/lompendans/eznas/blob/main/web/app.js"
click node_server_entry "https://github.com/lompendans/eznas/blob/main/main.go"
click node_file_ops "https://github.com/lompendans/eznas/blob/main/main.go"
click node_search "https://github.com/lompendans/eznas/blob/main/main.go"
click node_recycle_backup "https://github.com/lompendans/eznas/blob/main/main.go"
click node_capacity "https://github.com/lompendans/eznas/blob/main/storage_linux.go"
click node_config "https://github.com/lompendans/eznas/blob/main/main.go"
click node_request_security "https://github.com/lompendans/eznas/blob/main/security.go"
click node_share_api "https://github.com/lompendans/eznas/blob/main/shares.go"
click node_share_store "https://github.com/lompendans/eznas/blob/main/shares.go"
click node_updater "https://github.com/lompendans/eznas/blob/main/updater.go"
click node_tls "https://github.com/lompendans/eznas/blob/main/main.go"

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_ui,node_user toneBlue
class node_server_entry,node_file_ops,node_search,node_recycle_backup,node_storage,node_capacity toneAmber
class node_config,node_request_security,node_tls toneMint
class node_share_api,node_share_store toneRose
class node_updater,node_release_service toneIndigo
```

## Components

### Web client

- [File manager UI](https://github.com/lompendans/eznas/blob/main/web/app.js): `web/app.js`

### NAS server

- [Server and API](https://github.com/lompendans/eznas/blob/main/main.go): `main.go`
- [File operations](https://github.com/lompendans/eznas/blob/main/main.go): `main.go`
- [Name search](https://github.com/lompendans/eznas/blob/main/main.go): `main.go`
- [Recycle bin and backups](https://github.com/lompendans/eznas/blob/main/main.go): `main.go`
- **NAS storage**
- [Capacity reporting](https://github.com/lompendans/eznas/blob/main/storage_linux.go): `storage_linux.go`

### Security and access

- [Configuration and sessions](https://github.com/lompendans/eznas/blob/main/main.go): `main.go`
- [Request safeguards](https://github.com/lompendans/eznas/blob/main/security.go): `security.go`
- [TLS management](https://github.com/lompendans/eznas/blob/main/main.go): `main.go`

### Shared links

- [Share links](https://github.com/lompendans/eznas/blob/main/shares.go): `shares.go`
- [Share records](https://github.com/lompendans/eznas/blob/main/shares.go): `shares.go`

### Maintenance

- [Verified updater](https://github.com/lompendans/eznas/blob/main/updater.go): `updater.go`
- **GitHub releases**

### Other components

- **NAS user**

## Connections

- NAS user → File manager UI: manages files (evidence: `README.md`)
- File manager UI → Server and API: sends API requests (evidence: `web/app.js`)
- Server and API → File operations: dispatches requests (evidence: `main.go`)
- Server and API → Name search: dispatches requests (evidence: `main.go`)
- File operations → NAS storage: reads and writes (evidence: `README.md`)
- Name search → NAS storage: searches names (evidence: `main.go`)
- Recycle bin and backups → NAS storage: backs up and recovers (evidence: `README.md`)
- Server and API → Request safeguards: checks request origin (evidence: `main.go`)
- File manager UI → Share links: manages shares (evidence: `web/app.js`)
- Share links → Share records: persists records (evidence: `shares.go`)
- Share links → NAS storage: serves shared files (evidence: `shares.go`)
- File manager UI → Verified updater: requests installation (evidence: `web/app.js`)
- Verified updater → GitHub releases: downloads releases (evidence: `updater.go`)
- Server and API → Verified updater: routes update request
- Server and API → Recycle bin and backups: routes storage actions (evidence: `main.go`)
- File manager UI → Capacity reporting: displays capacity (evidence: `web/app.js`)
- Server and API → TLS management: configures HTTPS (evidence: `README.md`)
