How immich-app/ui works
Project type and purpose
• This is a monorepo hosting an open-source front-end component library (@immich/ui) and a companion Svelte Markdown preprocessor (svelte-markdown-preprocess).
• It includes a SvelteKit-based documentation/demo site (under packages/ui) and Terraform/Terragrunt modules for deploying the docs as Cloudflare Pages.
File structure
• Top-level “packages” directory contains two workspace packages:
• svelte-markdown-preprocess – a utility library with source, tests, and config.
• ui – the SvelteKit application and component library with src/lib (components & services), src/routes (docs/examples), and build configs (Vite, Tailwind, Svelte).
• A deployment directory holds Terraform modules and Terragrunt configs that target Cloudflare Pages (static-pages and pages-project).
• CI/CD is handled by GitHub Actions workflows (.github/workflows), covering build, test, publish (npm), and destroy (infra teardown).
README for additional insights
• Usage: npm installation, import components.
• Documentation: run a local dev server for the docs site.
• Contributing: uses pnpm and custom tool mise.
a. Main components
1. Developer workstation (local)
2. Monorepo codebase
• Package A: Markdown preprocessor
• Package B: UI component library + SvelteKit docs site
3. CI/CD platform (GitHub Actions)
4. Artifact repositories
• npm registry (for published packages)
• Terraform remote state (e.g., in Cloudflare R2 or S3)
5. Cloudflare Pages hosting (static site)
b. Relationships and data flows
• Developer → GitHub: push code & PRs
• GitHub Actions → run lint/tests/build on both packages
• On release tag: publish packages to npm; apply Terragrunt to deploy docs
• Terraform modules use remote state; deploy static assets to Cloudflare Pages
• End users → browse docs site on Cloudflare Pages; install @immich/ui from npm
c. Architectural patterns & design principles
• Monorepo with pnpm workspace for multi-package coordination
• Package separation: reusability of core logic (markdown-preprocess) and UI components
• SvelteKit SSR/SSG for documentation site, serving static pages
• Infrastructure as Code: Terraform modules, Terragrunt for DRY config
• CI/CD automation for build/test/publish/deploy
d. Relevant technologies & frameworks
• Frontend: Svelte, SvelteKit, Tailwind CSS, Vite
• Package management: pnpm, npm registry
• Testing: Vitest, snapshots
• Infra: Terraform, Terragrunt, Cloudflare provider
• CI: GitHub Actions
• Code quality: ESLint, Prettier