{
  "markdown": "## Name\nSatellite Status App and API\n\n## Description\nThis is a project space for development of the Satellite Status App and API, hosted at https://www.amsat.org/status.\n\n## Repository structure\n\n```\nsatellite-status/\n├── frontend/v1/          # PHP frontend (status page, submit form, admin)\n│   └── Dockerfile        # builds the frontend container\n├── api/\n│   └── v1/               # PHP REST API\n│       ├── Dockerfile    # builds the API container\n│       ├── overview.php  # HTML API documentation\n│       ├── docs.php      # Swagger UI\n│       └── acknowledgements.php\n├── db/schema.sql         # database schema\n├── db/seed.sql           # local dev seed data\n├── tests/                # PHPUnit + Playwright test suites\n└── docker-compose.yml    # local dev stack\n```\n\n## Installation\n\n**Requires:** Docker\n\nThe app is configured entirely via environment variables — there is no config file to edit.\n\n| Variable | Description |\n|---|---|\n| `SITE_URL` | Public base URL of the deployed site, scheme + host, no trailing slash (e.g. `https://status.amsat.org`). Set to the **same value** for both the `frontend` and `api` containers in production — both are reached through the same host, and the API derives its own base URL (`$SITE_URL/api/v1`) from it. Local Docker dev is the one exception: see [Local Docker](#local-docker) below for why frontend and API use different `SITE_URL` values there. |\n| `MYSQL_HOST` | Database hostname |\n| `MYSQL_USER` | Database username |\n| `MYSQL_PASSWORD` | Database password |\n| `MYSQL_DATABASE` | Database name |\n\nPass these to the container at runtime (e.g. via `docker run -e`, `docker compose`, or your orchestrator's secret/env injection).\n\nThe database schema is in `db/schema.sql`. Apply it to a MariaDB/MySQL instance before first run.\n\nFor local development, see the [Local Docker](#local-docker) section below — `docker compose up` wires everything together automatically.\n\n## Local Docker\n\nThe local stack runs three containers: `frontend`, `api`, and `db`.  Frontend\nand API are on **separate ports** for simplicity — no local routing proxy is\nneeded. Because there's no shared host, `docker-compose.yml` gives each\ncontainer its own default `SITE_URL` (`http://localhost:8080` for frontend,\n`http://localhost:8081` for api) so links and API self-links resolve\ncorrectly on the port each service is actually reachable at. This is a\nlocal-dev-only difference — production sets one `SITE_URL` for both. Override\neither with a `SITE_URL` environment variable before running `docker compose\nup` if you need to point the stack at a specific value (this is also how CI's\nsmoke test proves URL construction is correct for a production-shaped\n`SITE_URL`; see `.github/workflows/ci.yml`'s `docker-compose-smoke` job).\nNote that Docker Compose also auto-loads a `.env` file from this directory if\none exists (separately from the `env_file:` mechanism `deploy/docker-compose.yml`\nuses) — if you've created a root-level `.env` here for some other reason and\nit sets `SITE_URL`, that value silently wins over the port-specific defaults\nbelow.\n\n```sh\ndocker compose up -d --build\n```\n\nThen visit:\n\n| Service | URL |\n|---|---|\n| Frontend (status page) | http://localhost:8080 |\n| API documentation | http://localhost:8081/api/v1/overview.php |\n| API Swagger UI | http://localhost:8081/api/v1/docs.php |\n| API example | http://localhost:8081/api/v1/satellites.php |\n| MariaDB | `localhost:3307`, database `satellite_status`, user `satellite`, password `satellite` |\n\nThe admin login is `admin` / `password` for local development only.\n\nStop the stack with:\n\n```sh\ndocker compose down\n```\n\n## Testing\n\nRun the PHPUnit integration tests (starts a local PHP dev server; no Docker required):\n\n```sh\n# install deps first (once)\ncurl -sS https://getcomposer.org/installer | php -- --quiet\nphp composer.phar install\n\ncp tests/fixtures/config.test.php frontend/v1/config.php\ncp tests/fixtures/config.test.php api/v1/config.php\nphp -S 127.0.0.1:8000 -t . tests/fixtures/router.php &\nvendor/bin/phpunit --configuration tests/phpunit.xml --colors=auto\n```\n\nRun the browser compatibility tests:\n\n```sh\nnpm install\nnpx playwright install chromium\nnpx playwright test --config tests/playwright.config.js\n```\n\n## Usage\n- Visit `$SITE_URL` (set via environment variable) to see the status page.\n- Utilize the API at `$SITE_URL/api/v1`.\n\n## API\nThe public API lives under `/api/v1` and is documented at `/api/v1/overview.php`.\nPublic Swagger documentation is available at `/api/v1/docs.php`.\n\nAvailable API surfaces:\n- `GET /api/v1/catalog.php` lists satellites with links and optional report statistics.\n- `GET /api/v1/reports.php` searches recent reports by satellite, time window, callsign, grid square, and status.\n- `POST /api/v1/reports.php` submits a status report using JSON or form data.\n- `GET /api/v1/summary.php` returns report counts by satellite and status.\n- `GET /api/v1/statuses.php` lists the canonical report values.\n- `GET /api/v1/health.php` checks API and database availability.\n- `GET /api/v1/openapi.php` returns the OpenAPI 3.0 document.\n- `GET /api/v1/satellites.php` remains available as a legacy-compatible satellite catalog array.\n- `GET /api/v1/sat_info.php` remains available as a legacy-compatible report array.\n\nExample:\n\n```sh\ncurl \"$SITE_URL/api/v1/reports.php?name=AO-91&hours=24&limit=25\"\n```\n\n## Support (in order of preference)\n1. Create an Issue on the [Project's GitHub page](https://github.com/AMSAT-NA/satellite-status/issues)\n2. Post in AMSAT Discord Server #open-source-dev channel.\n3. E-mail IT@amsat.org\n\n## Contributing\n- All ideas/contributions are open to discussion. Join us in the AMSAT Discord channel #open-source-dev.\n- PRs for break/fix also welcome!\n\n## License\n- TBD\n",
  "bytes": 5750,
  "sha": "a92c2f3e03c85f82ec18f347d19778baccf564bbf7a51ca42e086cbc661370ce",
  "repo_slug": "amsat-na/satellite-status",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/okf_amsat_na_satellite_status_docs_index_md_795796bb/readme"
}