Skip to content

Commit 0a09f01

Browse files
Merge pull request #138 from richardthe3rd/copilot/update-data-source-url
Migrate API URLs to data.cambeerfestival.app custom domain with relative URL support
2 parents 07fd5d3 + 6a26a77 commit 0a09f01

21 files changed

Lines changed: 108 additions & 56 deletions

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ flutter build ios
119119

120120
The app uses a Cloudflare Worker proxy to access Cambridge Beer Festival data:
121121

122-
- Base URL: `https://cbf-data-proxy.richard-alcock.workers.dev`
122+
- Base URL: `https://data.cambeerfestival.app`
123123
- Endpoints: `/{festivalId}/{category}.json` (e.g., `/cbf2025/beer.json`)
124124
- Categories: `beer`, `cider`, `perry`, `mead`, `wine`, `international-beer`, `low-no`
125125

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ Tests go in `test/` mirroring `lib/` structure:
489489

490490
## API Details
491491

492-
**Base URL**: `https://cbf-data-proxy.richard-alcock.workers.dev`
492+
**Base URL**: `https://data.cambeerfestival.app`
493493

494494
**Endpoints**:
495495
- `/{festivalId}/beer.json` - Beers

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ Coverage fails if it drops below 70% overall, helping maintain code quality.
125125
## Data API
126126

127127
This app uses the Cambridge Beer Festival data API via a Cloudflare Worker proxy:
128-
- Base URL: `https://cbf-data-proxy.richard-alcock.workers.dev`
129-
- Example: `https://cbf-data-proxy.richard-alcock.workers.dev/cbf2025/beer.json`
128+
- Base URL: `https://data.cambeerfestival.app`
129+
- Example: `https://data.cambeerfestival.app/cbf2025/beer.json`
130130

131131
### Documentation
132132

cloudflare-worker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ curl https://cbf-data-proxy.<your-subdomain>.workers.dev/festivals.json
116116
Once deployed, update `lib/models/festival.dart` to use the proxy URL:
117117

118118
```dart
119-
dataBaseUrl: 'https://cbf-data-proxy.<your-subdomain>.workers.dev/cbf2025',
119+
dataBaseUrl: 'https://data.cambeerfestival.app/cbf2025',
120120
```
121121

122122
Or configure it dynamically based on the platform (see `lib/services/beer_api_service.dart`).

data/festivals.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"apple-juice",
3131
"low-no"
3232
],
33-
"data_base_url": "https://cbf-data-proxy.richard-alcock.workers.dev/cbf2025",
33+
"data_base_url": "/cbf2025",
3434
"is_active": true
3535
},
3636
{
@@ -55,7 +55,7 @@
5555
"beer",
5656
"low-no"
5757
],
58-
"data_base_url": "https://cbf-data-proxy.richard-alcock.workers.dev/cbfw2025",
58+
"data_base_url": "/cbfw2025",
5959
"is_active": false
6060
},
6161
{
@@ -87,7 +87,7 @@
8787
"wine",
8888
"low-no"
8989
],
90-
"data_base_url": "https://cbf-data-proxy.richard-alcock.workers.dev/cbf2024",
90+
"data_base_url": "/cbf2024",
9191
"is_active": false
9292
}
9393
],

docs/CICD.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ Deploys Cloudflare Worker to production.
217217
4. Copy `festivals.json` to worker directory
218218
5. Deploy using `wrangler` via `cloudflare/wrangler-action@v3`
219219

220-
**Worker URL**: `https://cbf-data-proxy.richard-alcock.workers.dev`
220+
**Worker URL**: `https://data.cambeerfestival.app`
221221

222222
**Key Features:**
223223
- CORS proxy for Cambridge Beer Festival API
@@ -343,7 +343,7 @@ See [GITHUB_SECRETS.md](GITHUB_SECRETS.md) for setup instructions.
343343
| **Staging** | App CI/CD | Push to `main` | `main.cambeerfestival.pages.dev` | Stable staging environment |
344344
| **PR Preview** | App CI/CD | Pull request | `<branch>.cambeerfestival.pages.dev` | Test PRs before merge |
345345
| **Development** | App CI/CD | Push to `main` | `richardthe3rd.github.io/...` | Alternative dev environment |
346-
| **Worker** | Worker | Push to `main` | `cbf-data-proxy.richard-alcock.workers.dev` | API proxy |
346+
| **Worker** | Worker | Push to `main` | `data.cambeerfestival.app` | API proxy |
347347
348348
---
349349

docs/CLOUDFLARE_PAGES_SETUP.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ The app has three main deployment workflows:
292292
3. GitHub Actions automatically:
293293
- Validates festivals.json against schema
294294
- Deploys worker to production
295-
- Worker is live at `https://cbf-data-proxy.richard-alcock.workers.dev`
295+
- Worker is live at `https://data.cambeerfestival.app`
296296

297297
**On Pull Requests**:
298298
- Validates festivals.json
@@ -364,7 +364,7 @@ After deployment, verify:
364364
Open browser console on `https://cambeerfestival.app` and run:
365365

366366
```javascript
367-
fetch('https://cbf-data-proxy.richard-alcock.workers.dev/festivals.json')
367+
fetch('https://data.cambeerfestival.app/festivals.json')
368368
.then(r => r.json())
369369
.then(console.log)
370370
```

docs/NETWORK_ALLOWLIST.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This document lists all the network domains that need to be allowed for GitHub C
1010
| `pub.dev` | Dart packages | `flutter pub get` |
1111
| `www.gstatic.com` | Flutter CanvasKit engine | Running web app |
1212
| `fonts.gstatic.com` | Google Fonts (Roboto) | Running web app |
13-
| `cbf-data-proxy.richard-alcock.workers.dev` | Festival API (via Cloudflare Worker) | App runtime data |
13+
| `data.cambeerfestival.app` | Festival API (via Cloudflare Worker) | App runtime data |
1414
| `data.cambridgebeerfestival.com` | Upstream festival data | App runtime data (proxied) |
1515

1616
## Detailed Breakdown
@@ -68,14 +68,14 @@ Failed to load font Roboto at https://fonts.gstatic.com/s/roboto/v20/...
6868

6969
### 5. Festival Data API
7070

71-
**Domain:** `cbf-data-proxy.richard-alcock.workers.dev`
71+
**Domain:** `data.cambeerfestival.app`
7272

7373
The app's Cloudflare Worker proxy that serves festival data with CORS headers enabled for web access.
7474

7575
```
76-
https://cbf-data-proxy.richard-alcock.workers.dev/festivals.json
77-
https://cbf-data-proxy.richard-alcock.workers.dev/cbf2025/beer.json
78-
https://cbf-data-proxy.richard-alcock.workers.dev/cbf2025/cider.json
76+
https://data.cambeerfestival.app/festivals.json
77+
https://data.cambeerfestival.app/cbf2025/beer.json
78+
https://data.cambeerfestival.app/cbf2025/cider.json
7979
# ... other beverage types
8080
```
8181

@@ -123,4 +123,4 @@ For **running the web app and taking screenshots**:
123123

124124
For **full app functionality with live data**:
125125

126-
5. `cbf-data-proxy.richard-alcock.workers.dev` - Festival API
126+
5. `data.cambeerfestival.app` - Festival API

docs/PLAY_STORE_METADATA.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ The Cambridge Beer Festival app is designed with privacy in mind. We do not coll
168168

169169
- The app fetches public festival data from our Cloudflare Worker API
170170
- These requests contain no personal information
171-
- API endpoint: `https://cbf-data-proxy.richard-alcock.workers.dev`
171+
- API endpoint: `https://data.cambeerfestival.app`
172172

173173
## Permissions
174174

docs/api/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,27 @@ node validate-festivals.js
2525

2626
The Cambridge Beer Festival app fetches beverage data from a public API:
2727

28-
- **Base URL:** `https://data.cambridgebeerfestival.com`
28+
- **Base URL:** `https://data.cambeerfestival.app`
2929
- **Format:** JSON
3030
- **Authentication:** None required (public API)
3131

3232
### URL Pattern
3333

3434
```
35-
https://data.cambridgebeerfestival.com/{festival_id}/{beverage_type}.json
35+
https://data.cambeerfestival.app/{festival_id}/{beverage_type}.json
3636
```
3737

3838
### Examples
3939

4040
```bash
4141
# Beer data for CBF 2025
42-
curl https://data.cambridgebeerfestival.com/cbf2025/beer.json
42+
curl https://data.cambeerfestival.app/cbf2025/beer.json
4343

4444
# Cider data for CBF 2025
45-
curl https://data.cambridgebeerfestival.com/cbf2025/cider.json
45+
curl https://data.cambeerfestival.app/cbf2025/cider.json
4646

4747
# Winter festival beer data
48-
curl https://data.cambridgebeerfestival.com/cbfw2025/beer.json
48+
curl https://data.cambeerfestival.app/cbfw2025/beer.json
4949
```
5050

5151
## Schemas
@@ -93,7 +93,7 @@ const ajv = new Ajv();
9393
addFormats(ajv);
9494
const validate = ajv.compile(schema);
9595

96-
const data = await fetch('https://data.cambridgebeerfestival.com/cbf2025/beer.json')
96+
const data = await fetch('https://data.cambeerfestival.app/cbf2025/beer.json')
9797
.then(r => r.json());
9898

9999
if (validate(data)) {
@@ -113,7 +113,7 @@ import requests
113113
with open('beer-list-schema.json') as f:
114114
schema = json.load(f)
115115

116-
data = requests.get('https://data.cambridgebeerfestival.com/cbf2025/beer.json').json()
116+
data = requests.get('https://data.cambeerfestival.app/cbf2025/beer.json').json()
117117

118118
jsonschema.validate(data, schema) # Raises on error
119119
print('Valid!')

0 commit comments

Comments
 (0)