Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ Migration naming: `{sequence}_{description}.{up|down}.sql`

## Development Workflows

### Getting Started (Fresh Worktree or Clone)
**First time setup** - `task dev` automatically installs dependencies:
- Installs UI npm packages (cached based on package.json)
Comment thread
SmilyOrg marked this conversation as resolved.
- Downloads geo assets for reverse geocoding (~50MB)
- Starts API + UI in watch mode

**Working in worktrees**: Set `PHOTOFIELD_DATA_DIR=~/code/photofield/data` to share the data directory (config, databases, caches) with the main repo. Without this, each worktree has isolated data.

### Build System (Taskfile.yml)
**Conditional compilation with build tags**:
- `embedui` - embeds `ui/dist/` into binary (requires `task build:ui` first)
Expand All @@ -63,7 +71,8 @@ Migration naming: `{sequence}_{description}.{up|down}.sql`

Common workflows:
```bash
task dev # Run API + UI in watch mode (two terminals)
task dev # Run API + UI in watch mode (auto-setup on first run)
task setup # Manually install UI deps + geo assets
task watch # API only with hot-reload via watchexec
task ui # UI dev server (Vite)
task run:embed # Build with embedded UI+docs, run locally
Expand Down
25 changes: 24 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,35 @@ tasks:
wget -q -O "$gpkg_path" https://github.com/SmilyOrg/tinygpkg-data/releases/download/{{ .GPKG_VER }}/{{ .GPKG_FILE }}
echo "downloaded to $PWD/$gpkg_path"

setup:ui:
desc: Install UI dependencies
dir: ui
sources:
- package.json
- package-lock.json
generates:
- node_modules/.package-lock.json
cmds:
- npm install

setup:
desc: Setup minimal dependencies for development (UI npm packages and geo assets)
deps:
- setup:ui
Comment on lines +280 to +282
- assets

dev:
desc: Run the API and UI in watch mode
cmds:
- task: setup
- task: dev:watch

Comment on lines +279 to +290

Copilot AI Jan 26, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

task dev now runs task setup, which depends on assets; the assets task currently uses wget directly. That makes wget an implicit requirement for task dev in fresh environments (where it may not be installed). Consider adding a curl fallback (or explicitly documenting/installing wget) so task dev works out-of-the-box as intended.

Copilot uses AI. Check for mistakes.
dev:watch:
desc: Run the API and UI in watch mode
deps:
- watch
- ui

ui:
desc: Run the UI in watch mode
dir: ui
Expand Down
Loading