-
Notifications
You must be signed in to change notification settings - Fork 0
[Architecture] Feature — Exportable Provider Interface (Library Architecture) #15
Description
Overview
gh-dash puts all of its code in internal/, which means no other Go project can import any of it. lazydash has an opportunity to be different from day one by structuring the project so the data layer is exported and the TUI layer is private, making lazydash both a standalone terminal app AND a reusable Go library.
Current State
All code is in a flat structure with no exported provider interface. Other Go projects cannot import lazydash's data-fetching logic.
Proposed Solution
Separate the project into exported (public) packages for data access and private packages for the TUI:
lazydash/
provider/
provider.go -- interface definition + shared types (EXPORTED)
github/
github.go -- GitHub implementation (EXPORTED)
cache/
cache.go -- local storage/search (EXPORTED)
internal/
tui/ -- bubbletea UI code (PRIVATE)
config/ -- config parsing internals (PRIVATE)
cmd/
root.go
search.go
main.go
The provider.go file defines a contract:
type Provider interface {
FetchProjects(ctx context.Context) ([]Project, error)
FetchBoardView(ctx context.Context, projectID string) (*BoardView, error)
FetchItems(ctx context.Context, projectID string) ([]Item, error)
SearchItems(ctx context.Context, query string) ([]Item, error)
}Shared data types (Project, Item, BoardView, Column, Card) live in the provider package and are provider-agnostic.
Why This Matters
This is the single most important architectural decision to get right early. Once you export a type, you cannot casually rename it without breaking other people's builds. Keep exported types small and stable at first, use internal/ for anything experimental, and promote things to exported status only when confident in the design.
Priority
Do first. This is the foundation everything else builds on.
Recommended Build Order (for reference)
- Provider interface + project structure (this issue)
- Offline cache (#next) + local search/recall + context-aware repo scoping
- Issue detail view
- Fullscreen/zen mode
- Verbose/debug mode
- Offline notes
- Multi-provider support
- pkg.go.dev docs
- Scriptable batch operations
- Online write support
Acceptance Criteria
-
provider/provider.godefines theProviderinterface withFetchProjects,FetchBoardView,FetchItems,SearchItems - Shared types (
Project,Item,BoardView,Column,Card) are in the provider package -
provider/github/github.goimplements the interface using gh CLI / GraphQL - TUI code lives in
internal/tui/ - External Go code can
importand use the provider package
Epic: This is an epic-sized issue that will need to be broken down into smaller sub-issues when work begins.