# LuPhoto LuPhoto serves photos.luciochen.com. It is one Go program that reads album folders, cuts every photo into 512 px tiles at several resolutions with libvips, and publishes a static site that the browser stitches back together on a canvas. See [docs/DESIGN.md](docs/DESIGN.md). Status: milestone M1, the processor CLI. `luphoto build` scans the albums, builds tile pyramids, writes manifests and switches the `current` build. `serve` and `export` run one build and exit until M6. ## Develop All builds and runs happen in Docker (Ubuntu 24.04 with Go and libvips-tools); the Windows host has no libvips. From Git Bash or any POSIX shell: ```sh scripts/dev.sh go build -o bin/luphoto ./cmd/luphoto scripts/dev.sh go vet ./... scripts/dev.sh ``` The image has no make; the `Makefile` is for hosts that have Go and make. The first call builds the `luphoto-dev` image. The repository is mounted at `/src`; Go module and build caches live in the `luphoto-gomod` and `luphoto-gocache` volumes. Extra `docker run` arguments, such as a mount for sample albums, go in `LUPHOTO_DEV_ARGS`: ```sh LUPHOTO_DEV_ARGS="-v /path/to/work:/work" scripts/dev.sh bin/luphoto -config /work/config.toml build ``` `LUPHOTO_DEV_REBUILD=1` rebuilds the image. ## Run ```sh luphoto [-config /etc/luphoto/config.toml] build ``` A missing config file means all defaults. Paths default to `/srv/luphoto/albums`, `/var/lib/luphoto/site` and `/var/cache/luphoto` when running as root or under systemd, otherwise to the XDG data and cache folders. The site key and per-photo records live in `state/` next to the output folder. Output layout: ``` site/ current -> builds/ builds//index.html, index..json, a//index.html, a//manifest..json, t -> ../../t t//.webp state/ site.key pyramids/.json ``` ## Front-end TypeScript and CSS live in `web/src`; the minified bundles in `internal/site/static` are committed, so `go build` never needs Node. After changing the front-end, rebuild on the host with Node 22: ```sh npm --prefix web ci npm --prefix web run build ``` `build` type-checks with `tsc --noEmit` (strict) and bundles `app.js`, `app.css` and `worker.js` with esbuild. Each site build copies them to `/assets/` under content-hashed names.