How mraghaei/jobgraph-backend works
Purpose and workspace shape
This is a pnpm/Turborepo TypeScript monorepo containing two NestJS backend applications and shared database/configuration packages. The root README is stale starter text (it references absent Next.js apps); the file tree is authoritative. Workspace orchestration is defined by pnpm-workspace.yaml, turbo.json, and package.json.
Service entry points
Two independently runnable NestJS HTTP services exist:
• Core API bootstraps from apps/core-api/src/main.ts, composes its application in apps/core-api/src/app.module.ts, and exposes the initial controller/service layer in apps/core-api/src/app.controller.ts and apps/core-api/src/app.service.ts.
• Scraper is a separate NestJS process, bootstrapped via apps/scraper/src/main.ts, with its own module boundary at apps/scraper/src/app.module.ts and initial controller/service layer under apps/scraper/src/.
Their separate package.json files and Nest CLI configurations indicate independently buildable/deployable service units.
Core API boundary
apps/core-api is the primary API-facing service boundary. Nest module composition should be rooted in apps/core-api/src/app.module.ts; inbound HTTP handling belongs in apps/core-api/src/app.controller.ts; application behavior is currently represented by apps/core-api/src/app.service.ts. This is the natural integration point for consumers, authentication, request validation, and database-backed domain APIs as the system expands.
Scraping boundary
apps/scraper isolates scraping/collection work from the public API runtime. Its control flow is Nest bootstrap → module registration → controller-triggered service logic:
apps/scraper/src/main.ts → apps/scraper/src/app.module.ts → apps/scraper/src/app.controller.ts / apps/scraper/src/app.service.ts.
No job queue, scheduler, browser runtime, or external target integration is visible in the repository tree yet; those would need explicit implementation rather than assumed infrastructure.
Shared persistence layer
packages/database is the repository’s persistence contract and Prisma integration boundary. The data model is defined in packages/database/prisma/schema.prisma; Prisma configuration is in packages/database/prisma.config.ts; the consumable TypeScript database export/client boundary is packages/database/src/index.ts. Both services can depend on this package rather than owning divergent database clients or schemas. The actual database vendor and deployment topology cannot be established from the provided files.
Build and runtime infrastructure
Node.js/TypeScript is the material runtime; NestJS is used by both applications, as indicated by their nest-cli.json and source layout. pnpm manages workspace dependencies and Turbo coordinates cross-workspace build/dev tasks and caching through pnpm-workspace.yaml and turbo.json. Vercel remote cache is mentioned only as optional Turborepo infrastructure, not as an application-hosting dependency.
Shared engineering contracts
Repository-wide TypeScript and linting policy are centralized rather than copied into apps: packages/typescript-config/base.json and packages/eslint-config/base.js provide shared baselines. App-local tsconfig.json and ESLint configs adapt those standards to Nest services. This creates a clear boundary: shared packages define build/persistence contracts, while each app owns its process bootstrap and transport behavior.
Main entry points: src/main.ts Core bootstrap · src/main.ts Scraper bootstrap · turbo.json Turborepo tasks · app.module.ts Core module
Components 15
Workspace
Monorepo orchestration and shared engineering policy.
- pnpm workspace
pnpm-workspace.yaml - Turborepo tasks
turbo.json - TypeScript baseline
packages/typescript-config/base.json - ESLint baseline
packages/eslint-config/base.js
Core API
Primary independently deployable NestJS HTTP service.
- Core bootstrap
apps/core-api/src/main.ts - Core module · Composes the Core API application.
apps/core-api/src/app.module.ts - Core HTTP controller
apps/core-api/src/app.controller.ts - Core application service
apps/core-api/src/app.service.ts
Scraper
Separate NestJS collection-service runtime.
- Scraper bootstrap
apps/scraper/src/main.ts - Scraper module · Composes the scraper process.
apps/scraper/src/app.module.ts - Scraper controller
apps/scraper/src/app.controller.ts - Scraper application service
apps/scraper/src/app.service.ts
Persistence
Shared Prisma persistence contract.
- Prisma schema
packages/database/prisma/schema.prisma - Prisma config
packages/database/prisma.config.ts - Database client export · Consumable TypeScript persistence boundary for both services.
packages/database/src/index.ts
Connections 19
- pnpm workspace → Turborepo tasks: coordinates workspace tasks
- Turborepo tasks → Core bootstrap: builds and runs
- Turborepo tasks → Scraper bootstrap: builds and runs
- TypeScript baseline → Core bootstrap: shared TypeScript policy
- TypeScript baseline → Scraper bootstrap: shared TypeScript policy
- ESLint baseline → Core bootstrap: shared lint policy
- ESLint baseline → Scraper bootstrap: shared lint policy
- Core bootstrap → Core module: boots
- Core module → Core HTTP controller: registers
- Core module → Core application service: provides
- Core HTTP controller → Core application service: invokes
- Scraper bootstrap → Scraper module: boots
- Scraper module → Scraper controller: registers
- Scraper module → Scraper application service: provides
- Scraper controller → Scraper application service: invokes
- Prisma config → Prisma schema: configures
- Prisma schema → Database client export: defines client model
- Core application service → Database client export: may use persistence contract
- Scraper application service → Database client export: may use persistence contract