Conversation
… workspaces - Updated package.json to define a monorepo structure with workspaces for frontend and backend. - Removed obsolete files related to job scraping and exporting functionalities. - Deleted configuration, logger, and server files as part of the refactor. - Removed tests associated with the deleted functionalities. - Introduced new scripts for concurrent development of frontend and backend.
…components - Created unit tests for backend services, including app, browser, exporter, and linkedinScraper. - Added tests for utility functions and configuration handling. - Implemented integration tests for frontend hooks and components, ensuring proper functionality and state management. - Established Vitest configuration for both backend and frontend, including coverage thresholds. - Introduced mock implementations for external dependencies to isolate tests.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restructures the repository into an npm workspaces monorepo (frontend + backend), adds Vitest-based test suites with coverage enforcement, and updates Docker/CI to match the new layout.
Changes:
- Convert root project into a workspaces-based monorepo and adjust root scripts accordingly.
- Add Vitest configs and a broad set of frontend/backend unit + integration tests with 80% coverage thresholds.
- Update Docker Compose, Dockerfiles, and CI workflow to build/run the new
frontendandbackendservices.
Reviewed changes
Copilot reviewed 35 out of 50 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.js | Remove root Vitest config. |
| package.json | Define workspaces + root orchestration scripts. |
| frontend/vitest.config.js | Add frontend Vitest + coverage configuration. |
| frontend/tsconfig.json | Add Vitest/testing-library types and include tests. |
| frontend/tests/unit/utils/useJobsPagination.test.ts | Add pagination hook unit tests. |
| frontend/tests/unit/utils/useJobsFiltering.test.ts | Add filtering hook unit tests. |
| frontend/tests/unit/utils/jobsService.test.ts | Add jobs service fetch/validation tests. |
| frontend/tests/unit/utils/cn.test.ts | Add cn utility test. |
| frontend/tests/unit/pages/main.test.tsx | Add main entrypoint behavior tests. |
| frontend/tests/unit/pages/App.test.tsx | Add App rendering test with mocked hooks. |
| frontend/tests/unit/hooks/useTheme.test.ts | Add theme hook behavior tests. |
| frontend/tests/unit/components/ThemeToggle.test.tsx | Add ThemeToggle click behavior test. |
| frontend/tests/unit/components/JobsTableCard.test.tsx | Add table card rendering/pagination tests. |
| frontend/tests/unit/components/JobsHeaderCard.test.tsx | Add header card metadata/fallback tests. |
| frontend/tests/unit/components/JobsFiltersCard.test.tsx | Add filters interactions/loading tests. |
| frontend/tests/setup.js | Add jest-dom Vitest setup import. |
| frontend/tests/integration/useJobsData.test.tsx | Add integration test for useJobsData. |
| frontend/package.json | Add frontend test scripts + testing deps. |
| frontend/Dockerfile | Adjust Docker build to frontend workspace context. |
| docker-compose.yml | Split services into backend and frontend. |
| backend/vitest.config.js | Add backend Vitest + coverage configuration. |
| backend/tests/unit/utils/logger.test.js | Add logger unit tests. |
| backend/tests/unit/utils/config.test.js | Fix config test import + expand parsing tests. |
| backend/tests/unit/services/server.test.js | Add backend server entrypoint tests. |
| backend/tests/unit/services/linkedinScraper.test.js | Add scraper parsing/dedupe + error tests. |
| backend/tests/unit/services/index.test.js | Add backend index entrypoint error handling tests. |
| backend/tests/unit/services/exporter.test.js | Add XLSX/PDF exporter tests. |
| backend/tests/unit/services/browser.test.js | Add browser executable + launch tests. |
| backend/tests/unit/services/app.test.js | Add run() orchestration unit test. |
| backend/tests/unit/models/.gitkeep | Keep empty test dir in VCS. |
| backend/tests/unit/controllers/.gitkeep | Keep empty test dir in VCS. |
| backend/tests/integration/jobsApi.test.js | Fix integration test import paths/formatting. |
| backend/src/server.js | Add backend API server entrypoint. |
| backend/src/logger.js | Add simple timestamped logger helpers. |
| backend/src/linkedinScraper.js | Add HTTP-based LinkedIn scraper implementation. |
| backend/src/jobsApiApp.js | Ensure output dir exists when listing XLSX files. |
| backend/src/exporter.js | Add Excel/PDF export implementation. |
| backend/src/config.js | Add env parsing + defaults for scraper/runtime. |
| backend/src/browser.js | Add browser executable resolution + launch helper. |
| backend/src/app.js | Add scraper/export orchestration (run). |
| backend/package.json | Add backend workspace scripts and deps. |
| backend/package-lock.json | Add backend lockfile for workspace installs. |
| backend/index.js | Add backend scraper entrypoint with error handling. |
| backend/Dockerfile | Add backend Docker image definition. |
| backend/.env.example | Document backend environment variables. |
| TESTING.md | Add testing/coverage guide for monorepo. |
| README.md | Update documentation for monorepo + scripts + Docker. |
| .gitignore | Expand ignores for envs/builds/coverage outputs. |
| .github/workflows/ci.yml | Run workspace coverage + frontend lint/build in CI. |
Comments suppressed due to low confidence (1)
backend/src/jobsApiApp.js:22
listXlsxFiles()chamamkdirSync(outputDir, { recursive: true })em toda requisição. SeoutputDirestiver inválido ou sem permissão, isso lança exceção; em/api/jobs/filesnão hátry/catch, então o endpoint pode falhar com 500 e logar stack trace. Sugestão: criar/validar o diretório uma única vez na inicialização do app (ou envolvermkdirSyncemtry/catche responder com erro controlado), e remover oexistsSync(fica redundante apósmkdirSync).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.