Thank you for your interest in contributing! π
Make sure you have installed:
- Node.js 20+ (
node --version) - Docker Desktop (
docker --version) - Git (
git --version) - VS Code with Azure Functions extension
See README.md for detailed setup.
# 1. Clone your fork
git clone https://github.com/YOUR_USERNAME/secretsanta.git
cd secretsanta
# 2. Start Docker containers (runs Cosmos DB emulator)
docker-compose up -d
# 3. Open in VS Code
code .In VS Code:
- Press
F5to open the Debug menu - Select "π Full Stack (Frontend + API + Emulators)"
- Press Enter or click the play button
- Frontend opens at
http://localhost:5173β¨ - API runs on
http://localhost:7071
Automatic Setup:
local.settings.jsonis automatically created from the template- Database configured for local emulator
- No manual npm install or configuration needed!
For details, see Local Development Setup.
-
Create a branch from
main:git checkout -b feature/your-feature
-
Make changes following the code style
-
Test your changes:
npm run lint # Lint check cd api && npm test # API unit tests npm run test:e2e # E2E tests
-
Commit with clear messages:
git commit -m "feat: add new feature" git commit -m "fix: resolve issue"
-
Push and create PR to
main
| Directory | Purpose |
|---|---|
src/ |
React frontend |
src/components/ |
UI components |
src/lib/ |
Utilities, types, translations |
api/src/functions/ |
Azure Functions endpoints |
api/src/shared/ |
Shared code (DB, email) |
e2e/ |
Playwright E2E tests |
infra/ |
Bicep infrastructure |
- Open
src/lib/translations.ts - Add your key to both
esandenobjects:export const translations = { es: { newKey: "Texto en espaΓ±ol" }, en: { newKey: "English text" } }
- Use in components:
const { t } = useLanguage() return <span>{t('newKey')}</span>
- API tests: Located in
api/src/__tests__/(248+ tests across 13 suites) - E2E tests: Located in
e2e/(runs on Chromium, Firefox, and WebKit) - Accessibility: E2E tests include automated axe-core WCAG 2.0 AA checks
- Type validation: Run
npm run validate:typesto ensure frontend/API types stay in sync - Run tests before submitting PRs
- Add tests for new features
- Use
crypto.randomUUID()/crypto.randomInt()β neverMath.random() - Use
safeCompare()for all token comparisons - Enforce input length limits via
INPUT_LIMITSinapi/src/shared/types.ts - Never expose
error.messagein API responses
- Use TypeScript
- Follow existing patterns
- Use Tailwind CSS for styling
- Keep components small and focused
PRs automatically get:
- Lint and build checks
- Unit tests
- E2E tests (Chromium, Firefox, WebKit)
- Accessibility checks
- Preview deployment
Open an issue or start a discussion!