# Health Check — Image Services

How to check whether services are up, and how to start them.

## Check status

### ai-generator (port 19001)

    curl -s http://localhost:19001/providers

If it responds with a JSON provider list → it's up.
If connection fails → it's not running.

### classic-editor (port 19002)

    curl -s http://localhost:19002/health

If it responds with a JSON status → it's up.
If connection fails → it's not running.

### 3d-generator (port 19003)

    curl -s http://localhost:19003/health

If it responds → it's up.

## Check whether the port is taken (quick alternative)

    lsof -ti:19001   # ai-generator
    lsof -ti:19002   # classic-editor
    lsof -ti:19003   # 3d-generator

If it returns a PID → the service is running.
If it returns nothing → it's not running.

## Start services

### ai-generator

    Folder:  image-services/ai-generator/
    Command: make dev

### classic-editor

    Folder:  image-services/classic-editor/
    Command: make dev

### 3d-generator

    Folder:  image-services/3d-generator/
    Command: make dev

## Stop services

    Folder:  image-services/{service}/
    Command: make stop

## Install dependencies (first time only)

    Folder:  image-services/{service}/
    Command: make install

## Advanced diagnostics

Check the status of Gemini models:

    Folder:  image-services/ai-generator/
    Command: node ../../_rjj/scripts/test-gemini-api.js

## Recommended agent flow

1. Curl the health/providers endpoint of the service you need.
2. If it responds → use the service normally.
3. If it doesn't → cd into the service folder and run `make dev`.
4. Wait 3–5 seconds and re-check.
5. If it still doesn't respond → run `make install` first, then `make dev`.
