Project Structure
The physical layout of the repository and the anatomy of a vertical slice.
Job-Easy enforces strict dependency tiers. To maintain this, the src/ directory is organized into distinct functional folders. Nothing is born in shared/ or components/; code starts inside the feature that needs it and is only promoted outwards when a second, unrelated feature requires it.
Root Directory Map
src/ ├── app/ Tier 0: Next.js routing, layouts, and API route handlers ├── features/ Tier 1: The 23 vertical domain slices (e.g., auth, mail) ├── shared/ Tier 2: App-aware, domain-free logic (e.g., messaging, db) ├── components/ Tier 3: Domain-free UI kit (buttons, layout shells) ├── hooks/ Tier 3: Domain-free React hooks ├── providers/ Tier 3: Global React context providers ├── lib/ Tier 4: Publishable pure utilities (e.g., parsing, crypto) ├── config/ Tier 4: Deploy-time configuration and env parsing ├── emails/ Side-car: React Email templates ├── middleware/ Side-car: Edge runtime middleware └── proxy.ts Next.js middleware entrypoint
Canonical Feature Shape
The src/features/ directory contains exactly 23 completely flat feature slices. We never nest features two levels deep (e.g., it is integrations-google, not integrations/google). Below is the canonical anatomy of a single feature slice.
features/<name>/ ├── README.md what it owns, which models, invariants, dependencies ├── index.ts CLIENT public API — safe for 'use client' components ├── index.server.ts SERVER public API — imports 'server-only' ├── types/ Prisma-free Typescript interfaces and DTOs ├── constants/ Static configurations, sort maps, defaults ├── schemas/ Zod validation schemas ├── utils/ Pure functions (no I/O, no React) ├── server/ │ ├── repositories/ ONLY files in here may import Prisma │ ├── mappers/ Map Prisma rows to pure DTOs │ ├── services/ Business rules, orchestrations, throws AppError │ ├── controllers/ NextRequest in, NextResponse out │ ├── queries/ Optimized reads for React Server Components │ └── jobs/ Cron job entry points ├── api/ CLIENT fetch wrappers (use SWR / native fetch) ├── hooks/ Client state management; calls api/ wrappers ├── components/ Presentational (dumb) React components ├── containers/ Stateful (smart) React components ├── admin/ Admin-audience mini-slice (inherits domain logic) └── __tests__/ Colocated node:test unit tests
The 23 Feature Slices
analyticsapplicationsauditauthcompaniescompany-discoveryglobal-companiesintegrations-googlelandinglegallocationsmailmonitoringnewsletternotificationsoutreachresumessearchsettingsshellsubscriptionssupportusers