Thanks for your interest in contributing to the BlueCollar frontend!
git clone https://github.com/your-org/bluecollar.git
cd bluecollar
pnpm install
cp packages/app/.env.example packages/app/.env
# fill in NEXT_PUBLIC_API_URL
cd packages/app
pnpm dev # starts on :3001Requirements: Node.js >= 20, pnpm >= 9
- ESLint —
pnpm lint(extendsnext/core-web-vitals+next/typescript) - TypeScript — strict mode; run
pnpm type-checkbefore pushing - No Prettier config yet — match the surrounding code style (2-space indent, double quotes)
- One component per file, named to match the filename (
WorkerCard.tsx→export default function WorkerCard) - Shared UI primitives live in
src/components/ui/(shadcn/ui pattern) - Feature-specific components live in
src/features/<feature-name>/ - Page-level components live in
src/app/following Next.js App Router conventions - Use Tailwind utility classes; avoid inline styles
Figma design file: BlueCollar UI Kit (request access from a maintainer)
pnpm test # run all tests
pnpm test:a11y # run accessibility tests onlypnpm test:e2e # run Playwright tests
pnpm test:e2e:ui # run with interactive UIAccessibility tests run automatically on every page using axe-core. Tests fail on critical or serious violations.
To run locally:
pnpm dev # start the app
pnpm test:e2e # in another terminalAccessibility reports are generated in a11y-reports/ and included as CI artifacts. Review these to understand any violations found.
Common violations to fix:
- Missing
alttext on images - Insufficient color contrast
- Missing form labels
- Improper heading hierarchy
- Missing ARIA attributes
See WCAG 2.1 Guidelines for details.
Visual tests catch unintended UI changes using Playwright snapshots and Percy.
To update snapshots after intentional UI changes:
pnpm test:e2e visual.spec.ts --update-snapshotsTo run visual tests:
pnpm test:e2e visual.spec.tsSee VISUAL_TESTING.md for Percy setup and CI integration.
- Fork the repo and create a branch:
git checkout -b feat/your-feature - Make your changes and ensure checks pass:
pnpm lint pnpm type-check pnpm build pnpm test pnpm test:e2e - Open a pull request against
mainwith a clear description - All PRs require passing CI checks before merge
Open an issue or start a discussion on GitHub.
The app uses next-intl for translations. Locale files live in src/messages/.
| Code | Language |
|---|---|
en |
English |
fr |
Français |
es |
Español |
pt |
Português |
- Create
src/messages/<code>.jsonby copyingen.jsonas a template. - Translate every value (keep the keys identical to
en.json). - Add the locale code to the
localesarray insrc/middleware.ts. - Add the language to the
languagesarray insrc/components/LanguageSwitcher.tsx.
- Add the key/value to
src/messages/en.jsonfirst. - Add the same key to every other locale file (
fr.json,es.json,pt.json, …). - Use
useTranslationsin client components orgetTranslationsin server components:
// Client component
import { useTranslations } from 'next-intl';
const t = useTranslations('common');
return <span>{t('save')}</span>;
// Server component
import { getTranslations } from 'next-intl/server';
const t = await getTranslations('workers');
return <h1>{t('title')}</h1>;The middleware (src/middleware.ts) reads the Accept-Language header and redirects to the best-matching locale prefix (e.g. /pt/workers). The default locale is en.