Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "♿ The Accessibility Nightmare | 🟢 Beginner (The Initial Audit)",
"image": "mcr.microsoft.com/devcontainers/base:bullseye",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}/adventures/planned/adventure-accessibility-nightmare/beginner",
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "22"
},
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"postCreateCommand": "bash /workspaces/${localWorkspaceFolderBasename}/.devcontainer/adventure-accessibility-nightmare_beginner/post-create.sh",
"postStartCommand": "bash /workspaces/${localWorkspaceFolderBasename}/.devcontainer/adventure-accessibility-nightmare_beginner/post-start.sh",
"customizations": {
"vscode": {
"extensions": [
"ms-playwright.playwright"
]
},
"codespaces": {
"openFiles": [
"src/App.jsx",
"src/styles.css"
],
"permissions": {
"codespaces": "write"
}
}
},
"forwardPorts": [
5173
],
"portsAttributes": {
"5173": {
"label": "ShopSmart",
"onAutoForward": "openBrowser"
}
},
"otherPortsAttributes": {
"onAutoForward": "ignore"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -e

REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"

# shellcheck disable=SC1091
source "$REPO_ROOT/lib/scripts/tracker.sh"
set_tracking_context "adventure-accessibility-nightmare" "beginner" "" "TODO" "TODO"
track_container_created

"$REPO_ROOT/lib/shared/init.sh" --version v0.17.0

CHALLENGE_DIR="$REPO_ROOT/adventures/planned/adventure-accessibility-nightmare/beginner"

echo "✨ Installing ShopSmart dependencies..."
cd "$CHALLENGE_DIR"
npm ci

echo "✨ Installing Playwright Chromium..."
npx playwright install --with-deps chromium

CHROME_PATH="$(node -e "const { chromium } = require('playwright'); console.log(chromium.executablePath())")"
if [[ -x "$CHROME_PATH" ]] && ! grep -q '^export CHROME_PATH=' "$HOME/.bashrc"; then
echo "export CHROME_PATH=\"$CHROME_PATH\"" >> "$HOME/.bashrc"
fi

echo "✅ Post-create complete."
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
set -e

REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
CHALLENGE_DIR="$REPO_ROOT/adventures/planned/adventure-accessibility-nightmare/beginner"

echo "✨ Starting The Accessibility Nightmare - Beginner Level"

cd "$CHALLENGE_DIR"

LOG_FILE="/tmp/accessibility-nightmare-vite.log"

if ! pgrep -f "vite --host 0.0.0.0" >/dev/null 2>&1; then
echo "✨ Starting ShopSmart on port 5173"
nohup npm run dev </dev/null >"$LOG_FILE" 2>&1 &
fi

for _ in {1..30}; do
if curl --fail --silent http://127.0.0.1:5173 >/dev/null; then
echo "✅ ShopSmart is running on port 5173"
break
fi
sleep 1
done

if ! curl --fail --silent http://127.0.0.1:5173 >/dev/null; then
echo "❌ ShopSmart failed to start."
if [[ -f "$LOG_FILE" ]]; then
tail -n 20 "$LOG_FILE"
fi
echo "Run 'npm run dev' from the beginner directory to start it manually."
exit 1
fi
# shellcheck disable=SC1091
source "$REPO_ROOT/lib/scripts/tracker.sh"
set_tracking_context "adventure-accessibility-nightmare" "beginner" "" "TODO" "TODO"
track_container_initialized
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Open Ecosystem Challenges
# ==============================================================================

.PHONY: help new-adventure docs
.PHONY: help new-adventure docs accessibility-nightmare-beginner

# Default target - show help
help:
Expand All @@ -19,3 +19,6 @@ new-adventure:
docs:
@mkdocs serve


accessibility-nightmare-beginner:
$(MAKE) -C adventures/planned/adventure-accessibility-nightmare/beginner app
12 changes: 12 additions & 0 deletions adventures/planned/adventure-accessibility-nightmare/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# ♿ The Accessibility Nightmare

ShopSmart's e-commerce expansion is blocked by ADA lawsuits and strict European Accessibility Act (EAA) fines. As the lead frontend engineer, your mission is to audit the broken site, build an accessible component library, and automate compliance to save the EU launch and protect the company from millions in fines.

**Technologies:** axe-core, Lighthouse, Playwright, Pa11y, NVDA, VoiceOver, React, Storybook, GitHub Actions

The entire **infrastructure is pre-provisioned in your Codespace**
**You don't need to set up anything locally. Just focus on solving the problem.**

## 🚀 Ready to Start?

[Choose your level](https://offon.dev/adventures/adventure-accessibility-nightmare/) and begin learning!
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
dist/
.lighthouseci/
test-results/
playwright-report/
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.DEFAULT_GOAL := help

.PHONY: help app verify

help:
@echo "The Accessibility Nightmare - Beginner: Available Commands:"
@echo " make app Start the ShopSmart application"
@echo " make verify Run the verification script"

app:
@npm run dev

verify:
@./verify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="ShopSmart accessibility challenge homepage" />
<title>ShopSmart</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>

</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
ci: {
collect: {
startServerCommand: 'npm run dev -- --host 127.0.0.1',
startServerReadyPattern: 'Local:',
url: ['http://127.0.0.1:5173/'],
numberOfRuns: 1,
settings: {
chromeFlags: '--no-sandbox --disable-dev-shm-usage --disable-gpu',
},
},
assert: {
assertions: {
'categories:accessibility': ['error', { minScore: 0.95 }],
},
},
upload: {
target: 'filesystem',
outputDir: './.lighthouseci',
},
},
};
Loading
Loading