feat: initialize monorepo with full dev team best practices
- 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>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
## Description
|
||||
|
||||
<!-- What does this PR do? Link to issue if applicable. -->
|
||||
|
||||
Closes #
|
||||
|
||||
## Type of Change
|
||||
|
||||
- [ ] 🐛 Bug fix (non-breaking change fixing an issue)
|
||||
- [ ] ✨ New feature (non-breaking change adding functionality)
|
||||
- [ ] 💥 Breaking change (fix or feature causing existing functionality to change)
|
||||
- [ ] 📝 Documentation update
|
||||
- [ ] 🧹 Chore (dependency update, refactor, etc.)
|
||||
|
||||
## Changes Made
|
||||
|
||||
<!-- List the key changes -->
|
||||
|
||||
-
|
||||
-
|
||||
-
|
||||
|
||||
## Testing
|
||||
|
||||
- [ ] Existing tests pass (`npm test`)
|
||||
- [ ] New tests added for new functionality
|
||||
- [ ] Tested locally with `npm run dev`
|
||||
- [ ] Tested with Docker (`npm run docker:up`)
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] My code follows the project code style
|
||||
- [ ] I've run `npm run lint` with no errors
|
||||
- [ ] I've updated documentation if needed
|
||||
- [ ] I've updated `.env.example` if new env vars were added
|
||||
- [ ] No secrets or credentials in the code
|
||||
|
||||
## Screenshots (if applicable)
|
||||
|
||||
<!-- Add screenshots for UI changes -->
|
||||
@@ -0,0 +1,56 @@
|
||||
name: Backend CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
paths:
|
||||
- "website-monitoring-backend/**"
|
||||
- ".github/workflows/backend.yml"
|
||||
pull_request:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "website-monitoring-backend/**"
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: website-monitoring-backend
|
||||
|
||||
jobs:
|
||||
lint-test-build:
|
||||
name: Lint, Test & Build
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [18, 20]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: npm
|
||||
cache-dependency-path: website-monitoring-backend/package-lock.json
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
|
||||
- name: Test
|
||||
run: npm test
|
||||
env:
|
||||
NODE_ENV: test
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
- name: Upload coverage
|
||||
if: matrix.node-version == 20
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: backend-coverage
|
||||
path: website-monitoring-backend/coverage/
|
||||
retention-days: 7
|
||||
@@ -0,0 +1,31 @@
|
||||
name: Docker Integration
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
docker-build:
|
||||
name: Docker Compose Build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build all services
|
||||
run: docker compose -f website-monitoring-devops/docker-compose.yml build
|
||||
|
||||
- name: Start services
|
||||
run: |
|
||||
docker compose -f website-monitoring-devops/docker-compose.yml up -d db backend
|
||||
sleep 15
|
||||
|
||||
- name: Verify backend health
|
||||
run: |
|
||||
docker compose -f website-monitoring-devops/docker-compose.yml exec -T backend curl -f http://localhost:5000/health || exit 1
|
||||
|
||||
- name: Cleanup
|
||||
if: always()
|
||||
run: docker compose -f website-monitoring-devops/docker-compose.yml down -v
|
||||
@@ -0,0 +1,51 @@
|
||||
name: Frontend CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
paths:
|
||||
- "website-monitoring-frontend/**"
|
||||
- ".github/workflows/frontend.yml"
|
||||
pull_request:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "website-monitoring-frontend/**"
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: website-monitoring-frontend
|
||||
|
||||
jobs:
|
||||
lint-test-build:
|
||||
name: Lint, Test & Build
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [18, 20]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: npm
|
||||
cache-dependency-path: website-monitoring-frontend/package-lock.json
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
|
||||
- name: Test
|
||||
run: npm test
|
||||
env:
|
||||
NODE_ENV: test
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
env:
|
||||
NEXT_PUBLIC_SUPABASE_URL: https://placeholder.supabase.co
|
||||
NEXT_PUBLIC_SUPABASE_ANON_KEY: placeholder-key
|
||||
Reference in New Issue
Block a user