mirror of
https://github.com/photoprism/photoprism.git
synced 2025-09-26 21:01:58 +08:00
Develop: Refine examples and context in AGENTS.md file
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
26
AGENTS.md
26
AGENTS.md
@@ -11,26 +11,34 @@ This file tells automated coding agents (and humans) where to find the single so
|
||||
- Developer Guide (tests): https://docs.photoprism.app/developer-guide/tests/
|
||||
- CONTRIBUTING: https://github.com/photoprism/photoprism/blob/develop/CONTRIBUTING.md
|
||||
- SECURITY: https://github.com/photoprism/photoprism/blob/develop/SECURITY.md
|
||||
- REST API docs: https://docs.photoprism.dev/
|
||||
- REST API docs:
|
||||
- https://docs.photoprism.dev/ (Swagger)
|
||||
- https://docs.photoprism.app/developer-guide/api/
|
||||
|
||||
## Build & run (local)
|
||||
|
||||
- Run `make help` to see all targets.
|
||||
- Starting the Development Environment with Docker/Compose:
|
||||
1. Run `make docker-build` once to build a local image based on the `Dockerfile`.
|
||||
2. Then, run `docker compose up -d` to start the Development Environment, if it is not already running.
|
||||
3. Open a terminal session with `make terminal` once the services have been started.
|
||||
- Run `make help` to see common targets (or open the `Makefile`).
|
||||
- Start the Development Environment with Docker/Compose:
|
||||
- Run `make docker-build` once to build a local image based on the `Dockerfile`.
|
||||
- Then, run `docker compose up` to start the Development Environment, if it is not already running (add `-d` to start in the background)
|
||||
- Execute a single command: `docker compose exec photoprism <command>`, e.g. `docker compose exec photoprism ./photoprism help`
|
||||
- Why `./photoprism`? It runs the locally built binary in the project directory (as used in the setup guide).
|
||||
- Run as non-root to avoid root-owned files on bind mounts: `docker compose exec -u "$(id -u):$(id -g)" photoprism <command>`
|
||||
- Durable alternative: set the service user or `PHOTOPRISM_UID` in `compose.yaml`; if you hit issues, run `make fix-permissions`.
|
||||
- Open a terminal session: `make terminal`
|
||||
- From within the Development Environment:
|
||||
- Install deps: `make dep`
|
||||
- Build frontend/backend: `make build-js` and `make build-go`
|
||||
- Start PhotoPrism server on port 2342: `./photoprism start`
|
||||
- Start PhotoPrism server on port 2342: `./photoprism start` (open http://localhost:2342/)
|
||||
- Stop the Development Environment with Docker/Compose: `docker compose --profile=all down --remove-orphans` (`--profile=all` ensures all services are stopped; `make down` does the same)
|
||||
|
||||
## Tests
|
||||
|
||||
- From within the Development Environment:
|
||||
- Full unit test suite: `make test` (runs backend and frontend tests)
|
||||
- Test frontend/backend: `make test-js` and `make test-go`
|
||||
- Frontend unit test scripts are defined in `frontend/package.json`
|
||||
- Frontend unit tests are driven by Vitest; see scripts in `frontend/package.json`
|
||||
- Vitest watch/coverage: `make vitest-watch` and `make vitest-coverage`
|
||||
- Acceptance tests: use the `acceptance-*` targets in the `Makefile`
|
||||
|
||||
## Code Style & Lint
|
||||
@@ -43,4 +51,4 @@ This file tells automated coding agents (and humans) where to find the single so
|
||||
- Never commit secrets. Use environment variables or a local `.env`.
|
||||
- Do not run destructive commands against production data. Prefer ephemeral volumes and test fixtures when running acceptance tests.
|
||||
|
||||
If anything in this file conflicts with the `Makefile` or the Developer Guide, the Makefile and docs win.
|
||||
If anything in this file conflicts with the `Makefile` or the Developer Guide, the `Makefile` and docs win.
|
||||
|
Reference in New Issue
Block a user