Skip to content

Commit 270f027

Browse files
committed
Add PWA offline support and accessibility CI
Introduces a service worker and offline.html for PWA offline support, updates the web manifest with enhanced metadata, and registers the service worker in BaseLayout. Adds Playwright accessibility tests using axe-core and configures a new accessibility test project and CI workflow. Also adds OSV-Scanner workflows for vulnerability scanning and updates dependencies.
1 parent f0bb10d commit 270f027

11 files changed

Lines changed: 900 additions & 39 deletions

File tree

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,37 @@ jobs:
3737

3838
- name: Run Playwright tests
3939
run: npx playwright test
40+
41+
accessibility:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout
45+
uses: actions/checkout@v4
46+
47+
- name: Setup Node.js
48+
uses: actions/setup-node@v4
49+
with:
50+
node-version: '22'
51+
cache: 'npm'
52+
53+
- name: Install dependencies and generate API
54+
run: |
55+
npm ci
56+
node scripts/generate-api.cjs
57+
58+
- name: Build site
59+
run: npm run build
60+
61+
- name: Install Playwright
62+
run: npx playwright install --with-deps
63+
64+
- name: Run accessibility tests
65+
run: npx playwright test --project=accessibility
66+
67+
- name: Upload accessibility report
68+
uses: actions/upload-artifact@v4
69+
if: always()
70+
with:
71+
name: accessibility-report
72+
path: test-results/
73+
retention-days: 30
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# OSV-Scanner PR Workflow
2+
# Scans for new vulnerabilities introduced in pull requests
3+
# https://google.github.io/osv-scanner/github-action/
4+
5+
name: OSV-Scanner PR
6+
7+
on:
8+
pull_request:
9+
branches: [main]
10+
merge_group:
11+
branches: [main]
12+
13+
permissions:
14+
contents: read
15+
security-events: write
16+
17+
jobs:
18+
scan-pr:
19+
uses: google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml@v2.0.0
20+
with:
21+
scan-args: |-
22+
--recursive
23+
--skip-git
24+
./
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# OSV-Scanner Scheduled Workflow
2+
# Performs regular vulnerability scanning on the main branch
3+
# https://google.github.io/osv-scanner/github-action/
4+
5+
name: OSV-Scanner Scheduled
6+
7+
on:
8+
push:
9+
branches: [main]
10+
schedule:
11+
# Run every Monday at 6 AM UTC
12+
- cron: '0 6 * * 1'
13+
workflow_dispatch:
14+
15+
permissions:
16+
contents: read
17+
security-events: write
18+
19+
jobs:
20+
scan-scheduled:
21+
uses: google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml@v2.0.0
22+
with:
23+
scan-args: |-
24+
--recursive
25+
--skip-git
26+
--format=sarif
27+
--output=results.sarif
28+
./
Lines changed: 80 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,109 @@
11
{
22
"name": "Bay Navigator",
33
"short_name": "Bay Nav",
4-
"description": "Community-maintained guide to free and discounted benefits across the San Francisco Bay Area",
4+
"description": "Find free and low-cost programs for food, housing, healthcare, utilities, and more in the San Francisco Bay Area",
55
"start_url": "/",
6+
"scope": "/",
7+
"id": "/",
68
"display": "standalone",
9+
"display_override": ["window-controls-overlay", "standalone", "browser"],
710
"background_color": "#ffffff",
8-
"theme_color": "#00acc1",
9-
"orientation": "portrait-primary",
11+
"theme_color": "#0097a7",
12+
"orientation": "any",
13+
"lang": "en-US",
14+
"dir": "ltr",
1015
"icons": [
16+
{
17+
"src": "/assets/images/favicons/favicon-96.webp",
18+
"sizes": "96x96",
19+
"type": "image/webp"
20+
},
21+
{
22+
"src": "/assets/images/favicons/favicon-192.webp",
23+
"sizes": "192x192",
24+
"type": "image/webp",
25+
"purpose": "any"
26+
},
1127
{
1228
"src": "/assets/images/favicons/web-app-manifest-192x192.webp",
1329
"sizes": "192x192",
1430
"type": "image/webp",
15-
"purpose": "any maskable"
31+
"purpose": "maskable"
32+
},
33+
{
34+
"src": "/assets/images/favicons/favicon-512.webp",
35+
"sizes": "512x512",
36+
"type": "image/webp",
37+
"purpose": "any"
1638
},
1739
{
1840
"src": "/assets/images/favicons/web-app-manifest-512x512.webp",
1941
"sizes": "512x512",
2042
"type": "image/webp",
21-
"purpose": "any maskable"
43+
"purpose": "maskable"
44+
}
45+
],
46+
"screenshots": [
47+
{
48+
"src": "/assets/images/screenshots/home-wide.webp",
49+
"sizes": "1280x720",
50+
"type": "image/webp",
51+
"form_factor": "wide",
52+
"label": "Bay Navigator home page showing program search"
53+
},
54+
{
55+
"src": "/assets/images/screenshots/home-narrow.webp",
56+
"sizes": "390x844",
57+
"type": "image/webp",
58+
"form_factor": "narrow",
59+
"label": "Bay Navigator mobile view"
2260
}
2361
],
24-
"categories": ["finance", "lifestyle", "utilities", "reference"],
62+
"categories": ["lifestyle", "utilities", "government", "health", "finance"],
63+
"iarc_rating_id": "",
64+
"prefer_related_applications": false,
2565
"shortcuts": [
2666
{
27-
"name": "Bay Navigator",
28-
"short_name": "Navigator",
29-
"description": "View the main resource guide",
30-
"url": "/",
67+
"name": "Search Programs",
68+
"short_name": "Search",
69+
"description": "Search all available programs",
70+
"url": "/?focus=search",
3171
"icons": [{ "src": "/assets/images/favicons/favicon-96.webp", "sizes": "96x96", "type": "image/webp" }]
3272
},
3373
{
34-
"name": "College Student Resources",
35-
"short_name": "Students",
36-
"description": "Resources for college students",
37-
"url": "/students.html",
74+
"name": "Food Assistance",
75+
"short_name": "Food",
76+
"description": "Find food banks and meal programs",
77+
"url": "/#food",
3878
"icons": [{ "src": "/assets/images/favicons/favicon-96.webp", "sizes": "96x96", "type": "image/webp" }]
3979
},
4080
{
41-
"name": "Nonprofit Resources",
42-
"short_name": "Nonprofits",
43-
"description": "Resources for nonprofit organizations",
44-
"url": "/nonprofit_resources_section.html",
81+
"name": "Utility Help",
82+
"short_name": "Utilities",
83+
"description": "Get help with bills",
84+
"url": "/#utilities",
4585
"icons": [{ "src": "/assets/images/favicons/favicon-96.webp", "sizes": "96x96", "type": "image/webp" }]
86+
},
87+
{
88+
"name": "Eligibility Guides",
89+
"short_name": "Eligibility",
90+
"description": "Check what you qualify for",
91+
"url": "/eligibility",
92+
"icons": [{ "src": "/assets/images/favicons/favicon-96.webp", "sizes": "96x96", "type": "image/webp" }]
93+
}
94+
],
95+
"share_target": {
96+
"action": "/",
97+
"method": "GET",
98+
"params": {
99+
"text": "search"
46100
}
47-
]
101+
},
102+
"launch_handler": {
103+
"client_mode": "navigate-existing"
104+
},
105+
"handle_links": "preferred",
106+
"edge_side_panel": {
107+
"preferred_width": 400
108+
}
48109
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"tailwindcss": "^3.4.19"
2727
},
2828
"devDependencies": {
29+
"@axe-core/playwright": "^4.10.0",
2930
"@playwright/test": "^1.57.0",
3031
"@types/js-yaml": "^4.0.9"
3132
}

playwright.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
// Basic Playwright config
1+
// Playwright config with accessibility testing
22
// To run: npx playwright test
3+
// To run accessibility only: npx playwright test --project=accessibility
34
import { defineConfig, devices } from '@playwright/test';
45

56
export default defineConfig({
@@ -22,6 +23,12 @@ export default defineConfig({
2223
{
2324
name: 'chromium',
2425
use: { ...devices['Desktop Chrome'] },
26+
testMatch: /.*\.spec\.js/,
27+
},
28+
{
29+
name: 'accessibility',
30+
use: { ...devices['Desktop Chrome'] },
31+
testMatch: /.*\.a11y\.js/,
2532
},
2633
],
2734
});
Lines changed: 80 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,109 @@
11
{
22
"name": "Bay Navigator",
33
"short_name": "Bay Nav",
4-
"description": "Community-maintained guide to free and discounted benefits across the San Francisco Bay Area",
4+
"description": "Find free and low-cost programs for food, housing, healthcare, utilities, and more in the San Francisco Bay Area",
55
"start_url": "/",
6+
"scope": "/",
7+
"id": "/",
68
"display": "standalone",
9+
"display_override": ["window-controls-overlay", "standalone", "browser"],
710
"background_color": "#ffffff",
8-
"theme_color": "#00acc1",
9-
"orientation": "portrait-primary",
11+
"theme_color": "#0097a7",
12+
"orientation": "any",
13+
"lang": "en-US",
14+
"dir": "ltr",
1015
"icons": [
16+
{
17+
"src": "/assets/images/favicons/favicon-96.webp",
18+
"sizes": "96x96",
19+
"type": "image/webp"
20+
},
21+
{
22+
"src": "/assets/images/favicons/favicon-192.webp",
23+
"sizes": "192x192",
24+
"type": "image/webp",
25+
"purpose": "any"
26+
},
1127
{
1228
"src": "/assets/images/favicons/web-app-manifest-192x192.webp",
1329
"sizes": "192x192",
1430
"type": "image/webp",
15-
"purpose": "any maskable"
31+
"purpose": "maskable"
32+
},
33+
{
34+
"src": "/assets/images/favicons/favicon-512.webp",
35+
"sizes": "512x512",
36+
"type": "image/webp",
37+
"purpose": "any"
1638
},
1739
{
1840
"src": "/assets/images/favicons/web-app-manifest-512x512.webp",
1941
"sizes": "512x512",
2042
"type": "image/webp",
21-
"purpose": "any maskable"
43+
"purpose": "maskable"
44+
}
45+
],
46+
"screenshots": [
47+
{
48+
"src": "/assets/images/screenshots/home-wide.webp",
49+
"sizes": "1280x720",
50+
"type": "image/webp",
51+
"form_factor": "wide",
52+
"label": "Bay Navigator home page showing program search"
53+
},
54+
{
55+
"src": "/assets/images/screenshots/home-narrow.webp",
56+
"sizes": "390x844",
57+
"type": "image/webp",
58+
"form_factor": "narrow",
59+
"label": "Bay Navigator mobile view"
2260
}
2361
],
24-
"categories": ["finance", "lifestyle", "utilities", "reference"],
62+
"categories": ["lifestyle", "utilities", "government", "health", "finance"],
63+
"iarc_rating_id": "",
64+
"prefer_related_applications": false,
2565
"shortcuts": [
2666
{
27-
"name": "Bay Navigator",
28-
"short_name": "Navigator",
29-
"description": "View the main resource guide",
30-
"url": "/",
67+
"name": "Search Programs",
68+
"short_name": "Search",
69+
"description": "Search all available programs",
70+
"url": "/?focus=search",
3171
"icons": [{ "src": "/assets/images/favicons/favicon-96.webp", "sizes": "96x96", "type": "image/webp" }]
3272
},
3373
{
34-
"name": "College Student Resources",
35-
"short_name": "Students",
36-
"description": "Resources for college students",
37-
"url": "/students.html",
74+
"name": "Food Assistance",
75+
"short_name": "Food",
76+
"description": "Find food banks and meal programs",
77+
"url": "/#food",
3878
"icons": [{ "src": "/assets/images/favicons/favicon-96.webp", "sizes": "96x96", "type": "image/webp" }]
3979
},
4080
{
41-
"name": "Nonprofit Resources",
42-
"short_name": "Nonprofits",
43-
"description": "Resources for nonprofit organizations",
44-
"url": "/nonprofit_resources_section.html",
81+
"name": "Utility Help",
82+
"short_name": "Utilities",
83+
"description": "Get help with bills",
84+
"url": "/#utilities",
4585
"icons": [{ "src": "/assets/images/favicons/favicon-96.webp", "sizes": "96x96", "type": "image/webp" }]
86+
},
87+
{
88+
"name": "Eligibility Guides",
89+
"short_name": "Eligibility",
90+
"description": "Check what you qualify for",
91+
"url": "/eligibility",
92+
"icons": [{ "src": "/assets/images/favicons/favicon-96.webp", "sizes": "96x96", "type": "image/webp" }]
93+
}
94+
],
95+
"share_target": {
96+
"action": "/",
97+
"method": "GET",
98+
"params": {
99+
"text": "search"
46100
}
47-
]
101+
},
102+
"launch_handler": {
103+
"client_mode": "navigate-existing"
104+
},
105+
"handle_links": "preferred",
106+
"edge_side_panel": {
107+
"preferred_width": 400
108+
}
48109
}

0 commit comments

Comments
 (0)