|
| 1 | +# Atmos Weather |
| 2 | + |
| 3 | +Atmos Weather is a native SwiftUI weather app prototype for iOS. |
| 4 | + |
| 5 | +## Launch with mock weather data |
| 6 | + |
| 7 | +Build and run the app with XcodeBuildMCP first: |
| 8 | + |
| 9 | +```bash |
| 10 | +../../build/cli.js simulator build-and-run |
| 11 | +``` |
| 12 | + |
| 13 | +Then relaunch the installed app with the mock API argument: |
| 14 | + |
| 15 | +```bash |
| 16 | +../../build/cli.js simulator launch-app \ |
| 17 | + --bundle-id com.sentry.weather.Weather \ |
| 18 | + --args=--mock-weather-api |
| 19 | +``` |
| 20 | + |
| 21 | +## JSON fixtures |
| 22 | + |
| 23 | +Fixture JSON files live in: |
| 24 | + |
| 25 | +```text |
| 26 | +WeatherTests/Fixtures/ |
| 27 | +``` |
| 28 | + |
| 29 | +Current fixtures: |
| 30 | + |
| 31 | +- `WeatherTests/Fixtures/default-locations.json` |
| 32 | +- `WeatherTests/Fixtures/search-locations.json` |
| 33 | +- `WeatherTests/Fixtures/weather-report-loc-current-san-francisco.json` |
| 34 | + |
| 35 | +## API schemas |
| 36 | + |
| 37 | +OpenAI-compatible API schema files live in: |
| 38 | + |
| 39 | +```text |
| 40 | +Schemas/ |
| 41 | +``` |
| 42 | + |
| 43 | +Current schemas: |
| 44 | + |
| 45 | +- `Schemas/default-locations.schema.json` |
| 46 | +- `Schemas/search-locations.schema.json` |
| 47 | +- `Schemas/weather-report.schema.json` |
| 48 | + |
| 49 | +These schemas describe the JSON response shape expected by the DTO layer. |
| 50 | + |
| 51 | +## Expected API endpoints |
| 52 | + |
| 53 | +The production client is `URLSessionWeatherAPIClient`. It currently expects a JSON API rooted at: |
| 54 | + |
| 55 | +```text |
| 56 | +https://api.atmosweather.example/v1 |
| 57 | +``` |
| 58 | + |
| 59 | +All endpoints are `GET` requests. |
| 60 | + |
| 61 | +| Purpose | Method | Path | Request shape | Schema | |
| 62 | +| --- | --- | --- | --- | --- | |
| 63 | +| Default saved locations | `GET` | `/locations/default` | No path params, query params, or body. | `Schemas/default-locations.schema.json` | |
| 64 | +| Search locations | `GET` | `/locations/search` | Query string: `query=<string>` | `Schemas/search-locations.schema.json` | |
| 65 | +| Weather report for a location | `GET` | `/weather/{locationID}` | Path param: `locationID=<WeatherLocationDTO.id>` | `Schemas/weather-report.schema.json` | |
| 66 | + |
| 67 | +### Request examples |
| 68 | + |
| 69 | +Default locations: |
| 70 | + |
| 71 | +```http |
| 72 | +GET /v1/locations/default |
| 73 | +``` |
| 74 | + |
| 75 | +Search locations: |
| 76 | + |
| 77 | +```http |
| 78 | +GET /v1/locations/search?query=San%20Francisco |
| 79 | +``` |
| 80 | + |
| 81 | +Weather report: |
| 82 | + |
| 83 | +```http |
| 84 | +GET /v1/weather/loc-current-san-francisco |
| 85 | +``` |
| 86 | + |
| 87 | +### Response expectations |
| 88 | + |
| 89 | +- Responses must be JSON. |
| 90 | +- Successful responses should use a `2xx` HTTP status code. |
| 91 | +- Non-`2xx` responses are treated as API failures. |
| 92 | + |
| 93 | +## Tests |
| 94 | + |
| 95 | +Run the app test suite through XcodeBuildMCP: |
| 96 | + |
| 97 | +```bash |
| 98 | +../../build/cli.js simulator test |
| 99 | +``` |
| 100 | + |
| 101 | +UI tests inject `--mock-weather-api` themselves so they do not depend on the production API endpoint. |
0 commit comments