How zaqpurpur-neo/topaz-workspace works
Purpose and Entry Points
This is a desktop-oriented artwork/reference management application combining a Go backend with a Svelte frontend. It models Krita projects/workspaces, local posts/media, and Danbooru-sourced reference content.
Backend startup is rooted at main.go; an additional native entry artifact exists at main.vala. Frontend bootstraps from frontend/src/main.ts into frontend/src/App.svelte, with route selection in frontend/src/router.ts.
Backend API Boundary
routes/api.go defines the backend API surface consumed by the frontend. Controllers form the application boundary for feature operations:
• controllers/KritaWorkspaceController.go
• controllers/KritaArtworkContoller.go
• controllers/DanbooruLayerController.go
• controllers/PostController.go
This separates UI/API invocation from project, artwork, post, and external-reference behavior.
Krita Workspace and Artwork Domain
Krita-related state is represented by models/KritaProject.go and exposed through workspace/artwork controllers. The frontend renders and manipulates this domain through:
• frontend/src/lib/KritaWorkspacePanel.svelte
• frontend/src/lib/KritaWorkspaceItemPanel.svelte
• frontend/src/component/KritaWorkspaceComponent.svelte
• frontend/src/component/KritaArtworkItemComponent.svelte
The board-oriented UI also distinguishes primary artwork from references via frontend/src/component/MainArtworkNode.svelte and frontend/src/component/ReferenceNode.svelte.
Post and Media Flow
models/Post.go and controllers/PostController.go provide the local post/media domain. Presentation is concentrated in frontend/src/lib/PostDisplay.svelte and frontend/src/lib/MediaPanel.svelte. This creates a flow from backend-managed post data to a dedicated display/media workspace rather than embedding media concerns directly in the Krita project model.
Danbooru Reference Integration
Danbooru is a distinct external-content pipeline. Backend handling begins in controllers/DanbooruLayerController.go; frontend querying, caching, filtering, pagination, cards, and modal display are split across:
• frontend/src/stores/danbooruStore.ts
• frontend/src/stores/queryCacheStore.ts
• frontend/src/lib/DanbooruPanel.svelte
• frontend/src/component/DanbooruFilterBar.svelte
• frontend/src/component/DanbooruPostModal.svelte
Typed integration contracts are maintained in frontend/src/types/DanbooruTypes.ts. The separation between the Danbooru store and query cache indicates remote-search state is managed independently from workspace state.
Frontend Composition and State Boundaries
frontend/src/lib/MainPanel.svelte and frontend/src/lib/SidePanel.svelte organize the primary application shell. Feature panels isolate major workflows: frontend/src/lib/KritaBoardPanel.svelte, frontend/src/lib/FormPanel.svelte, and frontend/src/lib/GitPushPanel.svelte.
The frontend is a TypeScript Svelte application built with Vite, as indicated by frontend/package.json, frontend/src/main.ts, and frontend/vite.config.ts. Shared cross-feature definitions live in frontend/src/common.ts, while board-specific contracts are in frontend/src/types/KritaBoardTypes.ts.
Runtime, Configuration, and External Services
The backend is Go-based (go.mod, main.go) and loads application configuration through config/config.go. services/DOHClient.go introduces a DNS-over-HTTPS service boundary, likely used where resilient or custom hostname resolution is required. Material external dependencies are therefore Danbooru content access and DNS-over-HTTPS; the Git push UI suggests a source-control workflow is exposed to users, though its backend implementation is not present in the listed tree.
Main entry points: api.go API routes · MainPanel.svelte Main and side panels · danbooruStore.ts Danbooru search state · main.go Backend startup
Components 21
Go backend
- Backend startup
main.go - Native entry artifact
main.vala - Application config
config/config.go - API routes
routes/api.go - Krita controllers
controllers/KritaWorkspaceController.go - Krita project
models/KritaProject.go - Post controller
controllers/PostController.go - Post model
models/Post.go - Danbooru controller
controllers/DanbooruLayerController.go - DNS-over-HTTPS client
services/DOHClient.go
Svelte frontend
- Frontend bootstrap
frontend/src/main.ts - App and router
frontend/src/router.ts - Main and side panels
frontend/src/lib/MainPanel.svelte - Krita workspace and board · Renders projects, artwork, and primary/reference board nodes.
frontend/src/lib/KritaWorkspacePanel.svelte - Post and media workspace
frontend/src/lib/PostDisplay.svelte - Danbooru search state · Keeps query state separate from cached results.
frontend/src/stores/danbooruStore.ts - Query cache
frontend/src/stores/queryCacheStore.ts - Danbooru panel · Includes filtering, pagination, cards, and modal display.
frontend/src/lib/DanbooruPanel.svelte - Danbooru contracts
frontend/src/types/DanbooruTypes.ts
External services
- Danbooru
- DNS-over-HTTPS
Connections 20
- Backend startup → Application config: loads
- Backend startup → API routes: serves
- API routes → Krita controllers: dispatches
- API routes → Post controller: dispatches
- API routes → Danbooru controller: dispatches
- Krita controllers → Krita project: manages
- Post controller → Post model: manages
- Danbooru controller → Danbooru: queries
- DNS-over-HTTPS client → DNS-over-HTTPS: resolves through
- Frontend bootstrap → App and router: starts
- App and router → Main and side panels: composes
- Main and side panels → Krita workspace and board: hosts
- Main and side panels → Post and media workspace: hosts
- Main and side panels → Danbooru panel: hosts
- Krita workspace and board → API routes: workspace API calls
- Post and media workspace → API routes: post API calls
- Danbooru panel → Danbooru search state: uses
- Danbooru search state → Query cache: caches results
- Danbooru search state → API routes: search API calls
- Danbooru search state → Danbooru contracts: uses contracts