14a32bdc0d
- Unified monorepo with backend (Express), frontend (Next.js), and devops - Backend: ESLint, Prettier, Jest tests (3 passing), health endpoint, .env.example - Frontend: Fixed build errors, fixed all lint errors (0 remaining), tests passing - DevOps: Docker Compose with PostgreSQL, backend, frontend + healthchecks - CI/CD: 3 GitHub Actions workflows (backend, frontend, docker integration) - DX: Husky pre-commit hooks with smart change detection - Docs: Root README with architecture, CONTRIBUTING.md, PR template Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2.3 KiB
2.3 KiB
Contributing to Website Monitoring
Branch Strategy
main ← production-ready, protected
└─ develop ← integration branch
└─ feature/xxx ← your work
└─ fix/xxx ← bug fixes
└─ chore/xxx ← maintenance
Rules
- Never push directly to
main— always open a PR - Branch from
developfor features, frommainfor hotfixes - Delete branches after merge
Development Setup
# Clone & install
git clone <repo-url>
cd website-monitoring
npm install
# Install project dependencies
cd website-monitoring-backend && npm install && cd ..
cd website-monitoring-frontend && npm install && cd ..
# Start everything
npm run dev
Workflow
- Create a branch:
git checkout -b feature/my-feature develop - Make changes: Write code, add tests
- Verify locally:
npm run lint # No errors npm run test # All pass npm run build # Compiles clean - Commit: Use Conventional Commits
feat: add uptime monitoring endpoint fix: resolve SSE connection leak chore: update lighthouse dependency docs: add API endpoint documentation test: add lighthouse service unit tests - Push & open PR: Target
develop(ormainfor hotfixes)
Code Review Checklist
- Code compiles and all tests pass
- New code has tests
- No
console.logleft in production code (use proper logger) - TypeScript types are explicit (minimize
any) - API changes are documented
- Environment variables documented in
.env.example - No secrets committed
Code Style
- TypeScript everywhere (no plain JS)
- ESLint for linting —
npm run lint - Prettier for formatting — auto-runs on commit via Husky
- Use
async/awaitover.then()chains - Prefer named exports over default exports
Testing
- Backend: Jest + Supertest —
cd website-monitoring-backend && npm test - Frontend: Jest + Testing Library —
cd website-monitoring-frontend && npm test - Aim for tests on all API endpoints and critical business logic
- Use meaningful test names:
it("should return 400 when URL is missing")
Docker
# Full stack with Docker Compose
npm run docker:up
# Tear down
npm run docker:down