@startuml system-architecture skinparam backgroundColor white skinparam componentStyle rectangle title SmartTools System Architecture package "User Interfaces" { [Terminal/CLI] as CLI [Web Browser] as Browser } package "SmartTools CLI" { [smarttools command] as SMT [Tool Runner] as Runner [Registry Client] as RegClient } package "Web Application" { [Flask Web App] as WebApp [Jinja Templates] as Templates [Static Assets] as Static } package "Registry API" { [Flask API] as API [Rate Limiter] as RateLimit [Auth Handler] as Auth } package "Data Layer" { database "SQLite (FTS5)" as DB folder "~/.smarttools/" as ToolDir } package "External" { [AI Providers] as Providers [Sentry] as Sentry } CLI --> SMT : runs SMT --> Runner : executes tools Runner --> ToolDir : reads configs Runner --> Providers : calls AI SMT --> RegClient : install/publish Browser --> WebApp : HTTP requests WebApp --> Templates : renders WebApp --> Static : serves CSS/JS WebApp --> API : internal calls RegClient --> API : REST API API --> RateLimit : enforces limits API --> Auth : validates tokens API --> DB : queries WebApp ..> Sentry : reports errors API ..> Sentry : reports errors note right of DB Tables: - publishers - tools - api_tokens - download_stats - pageviews - tools_fts end note note right of ToolDir ~/.smarttools/ - /config.yaml - providers.yaml - config.yaml end note @enduml