Architecture of shadcn-ui/ui
shadcn-ui/ui is 5,449 source files holding 12,290 symbols across 7 modules, written mainly in TypeScript, JavaScript, Astro. The largest module is apps, with 3,631 files, and 9 files are entry points into the dependency graph.
How ui fits together
The command-line tool lives in packages/shadcn, and its entry point is packages/shadcn/src/index.ts. The init command in packages/shadcn/src/commands/init.ts is one of the hotspot files in the repository. The shared registry logic is in packages/registry, and its entry point packages/registry/src/registry/index.ts exposes the registry code. Updater modules such as packages/registry/src/updaters/update-files.ts handle changes to project files. The apps/v4 directory holds the documentation site and the component registry its examples draw from. The templates directory contains starter code for several app stacks, such as templates/astro-app/src/layouts/main.astro for an Astro app.
Largest modules
- apps: 3,631 files and 376,885 lines of code
- packages: 369 files and 108,900 lines of code
- templates: 67 files and 1,515 lines of code
- .github: 6 files and 318 lines of code
- root: 3 files and 63 lines of code
- skills: 3 files and 219 lines of code
- scripts: 1 file and 27 lines of code
Languages
By file count: TypeScript 4,039 files, JavaScript 34 files, Astro 4 files, Dockerfile 2 files, Shell 1 file.
Documentation
Repowise documents ui in 4,255 pages generated from the source, 62 of them written explanations of the repository and its modules. Module guides include:
- apps/v4/registry/bases/aria/ui: ARIA UI Components
- apps/v4/app/(app)/(create): Apps V4
- apps/v4/registry/bases/base: Base Overview
- apps/v4/registry/bases/base/ui: Base UI Components
- apps/v4/registry/bases: Bases
More on ui: summary and FAQ, codebase overview, code health.
Related guide: Best dependency graph tools for monorepos