mirror of
https://github.com/immich-app/services.git
synced 2026-09-30 13:23:10 +08:00
850d9fe7f736513d740e118612b2dc0af4f62d1c
Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>
Immich Workers
Monorepo for Immich Cloudflare Workers (backend-only/API services).
Structure
apps/
├── hello/ # Hello world example worker
├── datasets/ # Datasets API worker
└── .../ # Other worker applications
deployment/
├── modules/ # Terraform modules
└── terragrunt/ # Terragrunt configurations
src/
└── lib/ # Shared libraries and utilities
Development
Setup
npm install
Working with Individual Workers
cd apps/<worker-name>
npm install
npm run dev # Start development server
npm run test # Run tests
npm run build # Build for production
npm run deploy # Deploy to Cloudflare
Global Commands
npm run lint # Lint all workers
npm run format # Check formatting
npm run test # Run all tests
npm run typecheck # Type-check all workers
Deployment
Using Wrangler (Direct)
cd apps/<worker-name>
npm run deploy
Using Terraform/Terragrunt
cd deployment/terragrunt/<environment>/<worker-name>
terragrunt plan
terragrunt apply
Creating a New Worker
- Create directory:
apps/<worker-name>/ - Add
package.json,wrangler.toml,tsconfig.json - Create source in
src/index.ts - Add terraform module in
deployment/modules/cloudflare/workers/<worker-name>/ - Add terragrunt config in
deployment/terragrunt/
Environment Variables
Workers use .dev.vars for local development and Cloudflare secrets for production.
Example .dev.vars:
MY_SECRET=secret_value
API_KEY=test_key
Languages
TypeScript
87.4%
HCL
11.5%
JavaScript
0.6%
Shell
0.5%