# abraham-ny/sitemaptool architecture

> Architecture diagram of the GitHub repository abraham-ny/sitemaptool, 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/abraham-ny/sitemaptool
- Repository: https://github.com/abraham-ny/sitemaptool

## Overview

SitemapTool is a Cobra-based command-line sitemap manager. Users configure it, add URLs or create sitemaps, then inspect statistics or ping search engines. The sampled source shows configuration and database loading, robots checks, URL deduplication, rotation, and sitemap persistence in one file; sitemap-index generation, VCS filtering, and some command behavior are documented but their implementations were not sampled, so uncertain call paths are omitted.

Main entry points: [`main.go`](https://github.com/abraham-ny/sitemaptool/blob/main/main.go) (Command handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI"]
  node_root["Command entry<br/>[main.go]"]
  node_commands["Command handlers<br/>[main.go]"]
  node_stats["Statistics<br/>[main.go]"]
end

subgraph group_management["Sitemap management"]
  node_manager["Sitemap manager<br/>[main.go]"]
  node_add["Add URL<br/>[main.go]"]
  node_dedupe["URL deduplication<br/>[main.go]"]
  node_rotation["Sitemap rotation<br/>[main.go]"]
  node_sitemap["Sitemap files<br/>[main.go]"]
  node_database[("Sitemap database<br/>[main.go]")]
  node_index["Sitemap index<br/>[main.go]"]
end

subgraph group_policy["Configuration and policy"]
  node_config["Configuration<br/>[main.go]"]
  node_configfile["Config file<br/>[main.go]"]
  node_robots["Robots policy<br/>[main.go]"]
  node_robotsfile["robots.txt<br/>[main.go]"]
  node_vcs["VCS filtering<br/>[main.go]"]
  node_gitignore[".gitignore rules"]
end

subgraph group_integrations["External integrations"]
  node_ping["Search engine ping<br/>[main.go]"]
  node_engines(("Search engines"))
  node_updates["Update checker<br/>[main.go]"]
  node_release(("Release service"))
end

node_user(("User"))

node_user -->|"runs"| node_root
node_root -->|"dispatches"| node_commands
node_commands -->|"creates"| node_manager
node_manager -->|"loads/saves"| node_configfile
node_manager -->|"loads/saves"| node_database
node_manager -->|"loads rules"| node_robots
node_robots -->|"reads"| node_robotsfile
node_commands -->|"configures"| node_config
node_config -->|"writes"| node_configfile
node_commands -->|"adds URL"| node_add
node_add -->|"checks policy"| node_robots
node_add -->|"checks hash"| node_dedupe
node_add -->|"gets current"| node_rotation
node_rotation -->|"reads/writes"| node_database
node_add -->|"writes URL"| node_sitemap
node_add -->|"updates state"| node_database
node_commands -.->|"generates"| node_index
node_commands -.->|"filters paths"| node_vcs
node_vcs -.->|"reads rules"| node_gitignore
node_commands -->|"requests"| node_stats
node_stats -->|"reads"| node_database
node_commands -->|"requests"| node_ping
node_ping -->|"pings"| node_engines
node_commands -->|"checks/updates"| node_updates
node_updates -->|"checks/downloads"| node_release

click node_root "https://github.com/abraham-ny/sitemaptool/blob/main/main.go"
click node_commands "https://github.com/abraham-ny/sitemaptool/blob/main/main.go"
click node_config "https://github.com/abraham-ny/sitemaptool/blob/main/main.go"
click node_configfile "https://github.com/abraham-ny/sitemaptool/blob/main/main.go"
click node_manager "https://github.com/abraham-ny/sitemaptool/blob/main/main.go"
click node_robots "https://github.com/abraham-ny/sitemaptool/blob/main/main.go"
click node_robotsfile "https://github.com/abraham-ny/sitemaptool/blob/main/main.go"
click node_vcs "https://github.com/abraham-ny/sitemaptool/blob/main/main.go"
click node_add "https://github.com/abraham-ny/sitemaptool/blob/main/main.go"
click node_dedupe "https://github.com/abraham-ny/sitemaptool/blob/main/main.go"
click node_rotation "https://github.com/abraham-ny/sitemaptool/blob/main/main.go"
click node_sitemap "https://github.com/abraham-ny/sitemaptool/blob/main/main.go"
click node_database "https://github.com/abraham-ny/sitemaptool/blob/main/main.go"
click node_index "https://github.com/abraham-ny/sitemaptool/blob/main/main.go"
click node_stats "https://github.com/abraham-ny/sitemaptool/blob/main/main.go"
click node_ping "https://github.com/abraham-ny/sitemaptool/blob/main/main.go"
click node_updates "https://github.com/abraham-ny/sitemaptool/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_root,node_commands,node_stats,node_user toneBlue
class node_manager,node_add,node_dedupe,node_rotation,node_sitemap,node_database,node_index toneAmber
class node_config,node_configfile,node_robots,node_robotsfile,node_vcs,node_gitignore toneMint
class node_ping,node_engines,node_updates,node_release toneRose
```

## Components

### CLI

- [Command entry](https://github.com/abraham-ny/sitemaptool/blob/main/main.go): `main.go`
- [Command handlers](https://github.com/abraham-ny/sitemaptool/blob/main/main.go): `main.go`
- [Statistics](https://github.com/abraham-ny/sitemaptool/blob/main/main.go): `main.go`

### Sitemap management

- [Sitemap manager](https://github.com/abraham-ny/sitemaptool/blob/main/main.go): `main.go`
- [Add URL](https://github.com/abraham-ny/sitemaptool/blob/main/main.go): `main.go`
- [URL deduplication](https://github.com/abraham-ny/sitemaptool/blob/main/main.go): `main.go`
- [Sitemap rotation](https://github.com/abraham-ny/sitemaptool/blob/main/main.go): `main.go`
- [Sitemap files](https://github.com/abraham-ny/sitemaptool/blob/main/main.go): `main.go`
- [Sitemap database](https://github.com/abraham-ny/sitemaptool/blob/main/main.go): `main.go`
- [Sitemap index](https://github.com/abraham-ny/sitemaptool/blob/main/main.go): `main.go`

### Configuration and policy

- [Configuration](https://github.com/abraham-ny/sitemaptool/blob/main/main.go): `main.go`
- [Config file](https://github.com/abraham-ny/sitemaptool/blob/main/main.go): `main.go`
- [Robots policy](https://github.com/abraham-ny/sitemaptool/blob/main/main.go): `main.go`
- [robots.txt](https://github.com/abraham-ny/sitemaptool/blob/main/main.go): `main.go`
- [VCS filtering](https://github.com/abraham-ny/sitemaptool/blob/main/main.go): `main.go`
- **.gitignore rules**

### External integrations

- [Search engine ping](https://github.com/abraham-ny/sitemaptool/blob/main/main.go): `main.go`
- **Search engines**
- [Update checker](https://github.com/abraham-ny/sitemaptool/blob/main/main.go): `main.go`
- **Release service**

### Other components

- **User**

## Connections

- User → Command entry: runs
- Command entry → Command handlers: dispatches
- Command handlers → Sitemap manager: creates
- Sitemap manager → Config file: loads/saves
- Sitemap manager → Sitemap database: loads/saves
- Sitemap manager → Robots policy: loads rules
- Robots policy → robots.txt: reads
- Command handlers → Configuration: configures
- Configuration → Config file: writes
- Command handlers → Add URL: adds URL
- Add URL → Robots policy: checks policy
- Add URL → URL deduplication: checks hash
- Add URL → Sitemap rotation: gets current
- Sitemap rotation → Sitemap database: reads/writes
- Add URL → Sitemap files: writes URL
- Add URL → Sitemap database: updates state
- Command handlers → Sitemap index: generates
- Command handlers → VCS filtering: filters paths
- VCS filtering → .gitignore rules: reads rules
- Command handlers → Statistics: requests
- Statistics → Sitemap database: reads
- Command handlers → Search engine ping: requests
- Search engine ping → Search engines: pings
- Command handlers → Update checker: checks/updates
- Update checker → Release service: checks/downloads
