# dendianugerah/velld architecture

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

- Interactive diagram: https://gitdiagram.com/dendianugerah/velld
- Repository: https://github.com/dendianugerah/velld

## Overview

Velld is a self-hosted database-backup manager. Users authenticate, configure database connections and schedules, then review backup history to compare, restore, or manage backups; settings cover notifications and S3 storage. The API entry point wires routes, services, and repositories, while the web history view exposes comparison and restore actions. Backup scheduling and several backup internals are present in the tree but were not sampled, so their links are left unverified rather than inferred.

Main entry points: [`apps/api/cmd/api-server/main.go`](https://github.com/dendianugerah/velld/blob/main/apps/api/cmd/api-server/main.go) (HTTP server and routes), [`apps/web/components/views/history/history-list.tsx`](https://github.com/dendianugerah/velld/blob/main/apps/web/components/views/history/history-list.tsx) (Backup history), [`apps/api/internal/backup/backup_service.go`](https://github.com/dendianugerah/velld/blob/main/apps/api/internal/backup/backup_service.go) (Backup service), [`apps/api/internal/settings/settings_service.go`](https://github.com/dendianugerah/velld/blob/main/apps/api/internal/settings/settings_service.go) (Settings service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_web_auth["Sign-in and registration<br/>[page.tsx]"]
  node_web_connections["Connection management"]
  node_web_history["Backup history<br/>[history-list.tsx]"]
  node_web_settings["Settings screens<br/>[page.tsx]"]
  node_api_client["API client<br/>[api-client.ts]"]
end

subgraph group_identity["Identity"]
  node_auth_handler["Auth handlers"]
  node_auth_service["Auth service<br/>[auth_service.go]"]
  node_auth_repo["User repository<br/>[auth_repository.go]"]
end

subgraph group_connections["Connections"]
  node_connection_handler["Connection handlers"]
  node_connection_service["Connection service"]
  node_connection_repo["Connection repository"]
end

subgraph group_backup["Backup management"]
  node_backup_handler["Backup handlers"]
  node_backup_service["Backup service<br/>[backup_service.go]"]
  node_backup_repo[("Backup repository")]
  node_scheduler["Backup scheduler"]
  node_s3["S3 object storage<br/>[s3_storage.go]"]
end

subgraph group_platform["Settings and persistence"]
  node_server["HTTP server and routes<br/>[main.go]"]
  node_settings["Settings service"]
  node_settings_repo[("Settings repository")]
  node_notifications["Notifications"]
  node_database[("SQLite database<br/>[database.go]")]
  node_mail["Email delivery<br/>[mail.go]"]
end

node_user(("User"))

node_user -->|"signs in"| node_web_auth
node_user -->|"configures databases"| node_web_connections
node_user -->|"reviews backups"| node_web_history
node_web_history -.->|"manages settings"| node_web_settings
node_server -->|"routes auth"| node_auth_handler
node_server -->|"routes connections"| node_connection_handler
node_server -->|"routes backups"| node_backup_handler
node_server -->|"constructs service"| node_settings
node_server -->|"constructs service"| node_notifications
node_server -->|"initializes"| node_database
node_auth_service -->|"reads and writes"| node_auth_repo
node_web_history -->|"opens compare and restore"| node_web_history
node_backup_service -.->|"schedule support"| node_scheduler
node_backup_service -.->|"optional object storage"| node_s3
node_backup_service -.->|"persists backup records"| node_backup_repo
node_settings -.->|"stores settings"| node_settings_repo
node_notifications -.->|"failure email"| node_mail

click node_web_auth "https://github.com/dendianugerah/velld/blob/main/apps/web/app/(auth)/login/page.tsx"
click node_web_connections "https://github.com/dendianugerah/velld/tree/main/apps/web/components/views/connections"
click node_web_history "https://github.com/dendianugerah/velld/blob/main/apps/web/components/views/history/history-list.tsx"
click node_web_settings "https://github.com/dendianugerah/velld/blob/main/apps/web/app/settings/page.tsx"
click node_api_client "https://github.com/dendianugerah/velld/blob/main/apps/web/lib/api-client.ts"
click node_server "https://github.com/dendianugerah/velld/blob/main/apps/api/cmd/api-server/main.go"
click node_auth_handler "https://github.com/dendianugerah/velld/tree/main/apps/api/internal/auth"
click node_auth_service "https://github.com/dendianugerah/velld/blob/main/apps/api/internal/auth/auth_service.go"
click node_auth_repo "https://github.com/dendianugerah/velld/blob/main/apps/api/internal/auth/auth_repository.go"
click node_connection_handler "https://github.com/dendianugerah/velld/tree/main/apps/api/internal/connection"
click node_connection_service "https://github.com/dendianugerah/velld/blob/main/apps/api/internal/connection/connection_service.go"
click node_connection_repo "https://github.com/dendianugerah/velld/blob/main/apps/api/internal/connection/connection_repository.go"
click node_backup_handler "https://github.com/dendianugerah/velld/tree/main/apps/api/internal/backup"
click node_backup_service "https://github.com/dendianugerah/velld/blob/main/apps/api/internal/backup/backup_service.go"
click node_backup_repo "https://github.com/dendianugerah/velld/blob/main/apps/api/internal/backup/backup_repository.go"
click node_scheduler "https://github.com/dendianugerah/velld/blob/main/apps/api/internal/backup/backup_scheduler.go"
click node_s3 "https://github.com/dendianugerah/velld/blob/main/apps/api/internal/backup/s3_storage.go"
click node_settings "https://github.com/dendianugerah/velld/blob/main/apps/api/internal/settings/settings_service.go"
click node_settings_repo "https://github.com/dendianugerah/velld/blob/main/apps/api/internal/settings/settings_repository.go"
click node_notifications "https://github.com/dendianugerah/velld/blob/main/apps/api/internal/notification/notification_service.go"
click node_database "https://github.com/dendianugerah/velld/blob/main/apps/api/internal/database/database.go"
click node_mail "https://github.com/dendianugerah/velld/blob/main/apps/api/internal/mail/mail.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_web_auth,node_web_connections,node_web_history,node_web_settings,node_api_client,node_user toneBlue
class node_auth_handler,node_auth_service,node_auth_repo toneAmber
class node_connection_handler,node_connection_service,node_connection_repo toneMint
class node_backup_handler,node_backup_service,node_backup_repo,node_scheduler,node_s3 toneRose
class node_server,node_settings,node_settings_repo,node_notifications,node_database,node_mail toneIndigo
```

## Components

### Web application

- [Sign-in and registration](https://github.com/dendianugerah/velld/blob/main/apps/web/app/(auth)/login/page.tsx): `apps/web/app/(auth)/login/page.tsx`
- [Connection management](https://github.com/dendianugerah/velld/tree/main/apps/web/components/views/connections): `apps/web/components/views/connections`
- [Backup history](https://github.com/dendianugerah/velld/blob/main/apps/web/components/views/history/history-list.tsx): `apps/web/components/views/history/history-list.tsx`
- [Settings screens](https://github.com/dendianugerah/velld/blob/main/apps/web/app/settings/page.tsx): `apps/web/app/settings/page.tsx`
- [API client](https://github.com/dendianugerah/velld/blob/main/apps/web/lib/api-client.ts): `apps/web/lib/api-client.ts`

### Identity

- [Auth handlers](https://github.com/dendianugerah/velld/tree/main/apps/api/internal/auth): `apps/api/internal/auth`
- [Auth service](https://github.com/dendianugerah/velld/blob/main/apps/api/internal/auth/auth_service.go): `apps/api/internal/auth/auth_service.go`
- [User repository](https://github.com/dendianugerah/velld/blob/main/apps/api/internal/auth/auth_repository.go): `apps/api/internal/auth/auth_repository.go`

### Connections

- [Connection handlers](https://github.com/dendianugerah/velld/tree/main/apps/api/internal/connection): `apps/api/internal/connection`
- [Connection service](https://github.com/dendianugerah/velld/blob/main/apps/api/internal/connection/connection_service.go): `apps/api/internal/connection/connection_service.go`
- [Connection repository](https://github.com/dendianugerah/velld/blob/main/apps/api/internal/connection/connection_repository.go): `apps/api/internal/connection/connection_repository.go`

### Backup management

- [Backup handlers](https://github.com/dendianugerah/velld/tree/main/apps/api/internal/backup): `apps/api/internal/backup`
- [Backup service](https://github.com/dendianugerah/velld/blob/main/apps/api/internal/backup/backup_service.go): `apps/api/internal/backup/backup_service.go`
- [Backup repository](https://github.com/dendianugerah/velld/blob/main/apps/api/internal/backup/backup_repository.go): `apps/api/internal/backup/backup_repository.go`
- [Backup scheduler](https://github.com/dendianugerah/velld/blob/main/apps/api/internal/backup/backup_scheduler.go): `apps/api/internal/backup/backup_scheduler.go`
- [S3 object storage](https://github.com/dendianugerah/velld/blob/main/apps/api/internal/backup/s3_storage.go): `apps/api/internal/backup/s3_storage.go`

### Settings and persistence

- [HTTP server and routes](https://github.com/dendianugerah/velld/blob/main/apps/api/cmd/api-server/main.go): `apps/api/cmd/api-server/main.go`
- [Settings service](https://github.com/dendianugerah/velld/blob/main/apps/api/internal/settings/settings_service.go): `apps/api/internal/settings/settings_service.go`
- [Settings repository](https://github.com/dendianugerah/velld/blob/main/apps/api/internal/settings/settings_repository.go): `apps/api/internal/settings/settings_repository.go`
- [Notifications](https://github.com/dendianugerah/velld/blob/main/apps/api/internal/notification/notification_service.go): `apps/api/internal/notification/notification_service.go`
- [SQLite database](https://github.com/dendianugerah/velld/blob/main/apps/api/internal/database/database.go): `apps/api/internal/database/database.go`
- [Email delivery](https://github.com/dendianugerah/velld/blob/main/apps/api/internal/mail/mail.go): `apps/api/internal/mail/mail.go`

### Other components

- **User**

## Connections

- User → Sign-in and registration: signs in (evidence: `README.md`)
- User → Connection management: configures databases (evidence: `README.md`)
- User → Backup history: reviews backups (evidence: `README.md`)
- Backup history → Settings screens: manages settings
- HTTP server and routes → Auth handlers: routes auth (evidence: `apps/api/cmd/api-server/main.go`)
- HTTP server and routes → Connection handlers: routes connections (evidence: `apps/api/cmd/api-server/main.go`)
- HTTP server and routes → Backup handlers: routes backups (evidence: `apps/api/cmd/api-server/main.go`)
- HTTP server and routes → Settings service: constructs service (evidence: `apps/api/cmd/api-server/main.go`)
- HTTP server and routes → Notifications: constructs service (evidence: `apps/api/cmd/api-server/main.go`)
- HTTP server and routes → SQLite database: initializes (evidence: `apps/api/cmd/api-server/main.go`)
- Auth service → User repository: reads and writes (evidence: `apps/api/internal/auth/auth_service.go`)
- Backup history → Backup history: opens compare and restore (evidence: `apps/web/components/views/history/history-list.tsx`)
- Backup service → Backup scheduler: schedule support
- Backup service → S3 object storage: optional object storage
- Backup service → Backup repository: persists backup records
- Settings service → Settings repository: stores settings
- Notifications → Email delivery: failure email
