- Imported packages from separate repos: - github.com/Snider/config -> pkg/config - github.com/Snider/display -> pkg/display - github.com/Snider/help -> pkg/help - github.com/Snider/i18n -> pkg/i18n - github.com/Snider/updater -> pkg/updater - Moved core code from root to pkg/core - Flattened nested package structures - Updated all import paths to github.com/Snider/Core/pkg/* - Added Display interface to Core - Updated go.work for workspace modules Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1.9 KiB
1.9 KiB
Architecture Overview
This project implements a modular configuration system with a Go backend and an Angular frontend, orchestrated by a CLI runner.
Components
The architecture consists of three main components:
-
Backend Library (
pkg/config)- Responsibility: Manages configuration loading, saving, and persistence.
- Tech Stack: Go.
- Features:
- Struct-based configuration with JSON persistence.
- Generic key-value storage supporting JSON, YAML, INI, and XML.
- XDG-compliant directory management.
- Integration: Can be used via static (
New) or dynamic (Register) dependency injection.
-
Frontend (
ui)- Responsibility: Provides a user interface for the application.
- Tech Stack: Angular.
- Deployment: Built as a static asset (or Custom Element) served by the backend.
-
CLI Runner (
cmd/demo-cli)- Responsibility: Entry point for the application.
- Tech Stack: Go (
spf13/cobra). - Functions:
serve: Starts a web server that hosts the compiled Angular frontend and API endpoints.
Data Flow
- Initialization: The CLI starts and initializes the
pkg/configservice to load settings from disk. - Serving: The CLI's
servecommand spins up an HTTP server. - Interaction: Users interact with the Angular UI in the browser.
- API Communication: The UI communicates with the backend via REST API endpoints (e.g.,
/api/v1/demo). - Persistence: Configuration changes made via the backend service are persisted to the filesystem.
Directory Structure
├── cmd/
│ └── demo-cli/ # CLI Application entry point
├── pkg/
│ └── config/ # Core configuration logic (Go)
├── ui/ # Frontend application (Angular)
└── docs/ # Project documentation