Architecture of stashapp/stash
stashapp/stash is 1,561 source files holding 11,136 symbols across 7 modules, written mainly in Go, TypeScript, Python. The largest module is ui, with 710 files, and 14 files are entry points into the dependency graph.
How stash fits together
On first run, Stash asks for media directories to index, a step the README calls Scanning, and the indexed media becomes available for browsing and tagging. The entry point cmd/stash/main.go starts the application, and internal/api/server.go serves the API that the interface calls. The graphql directory holds the GraphQL schema that defines this API. Metadata such as performers, tags and studios comes from scrapers and from stash-box services, and pkg/stashbox/graphql/generated_client.go is the generated client for talking to stash-box. The ui directory contains the React and TypeScript frontend, where ui/v2.5/src/components/Scenes/SceneList.tsx renders the list of scenes.
Largest modules
- ui: 710 files and 21,880 lines of code
- pkg: 568 files and 75,766 lines of code
- internal: 216 files and 31,282 lines of code
- graphql: 31 files
- .github: 8 files
- docker: 8 files
- root: 7 files
- scripts: 7 files and 669 lines of code
Languages
By file count: Go 689 files, TypeScript 527 files, Python 3 files, Dockerfile 2 files, JavaScript 2 files, Makefile 2 files.
More on stash: summary and FAQ, codebase overview, code health.
Related guide: Best dependency graph tools for monorepos