# rabblo06/rab-recurit architecture

> Architecture diagram of the GitHub repository rabblo06/rab-recurit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rabblo06/rab-recurit
- Repository: https://github.com/rabblo06/rab-recurit

## Overview

Crewflow is a workforce-operations product for staffing agencies and hospitality operators. Managers and venue managers plan shifts and staffing; staff receive and accept offers, work shifts, and record attendance in the mobile app; reviewed attendance feeds payroll and timesheets. The README documents this lifecycle and workspace isolation. The graph preserves the main domain stages and the web, mobile, server, and worker layers. Some subsystem links are documented behavior rather than inspected implementation; edges use the README where source excerpts do not establish the connection.

Main entry points: [`packages/rab-server/src/main.ts`](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-server/src/main.ts) (Application server), [`packages/rab-server/src/modules/offer/services/venue-offer-pipeline.service.ts`](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-server/src/modules/offer/services/venue-offer-pipeline.service.ts) (Offer lifecycle), [`packages/rab-worker/src/main.ts`](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-worker/src/main.ts) (Scheduled job queues), [`packages/rab-front/src/features/dashboard/Dashboard.tsx`](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-front/src/features/dashboard/Dashboard.tsx) (Manager web app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User applications"]
  node_web_app["Manager web app<br/>[Dashboard.tsx]"]
  node_mobile_app["Staff and venue app"]
  node_web_api["Web API client<br/>[api.ts]"]
end

subgraph group_workforce["Workforce workflow"]
  node_workforce_records[("Staff and manager records")]
  node_shift_planning["Shift planning<br/>[Shifts.tsx]"]
  node_offer_pipeline["Offer lifecycle"]
  node_mobile_attendance["Mobile attendance"]
  node_attendance_review["Attendance review"]
  node_payroll["Payroll and timesheets<br/>[Payroll.tsx]"]
end

subgraph group_platform["Server platform"]
  node_offer_api["Offer pipeline routes"]
  node_server["Application server<br/>[main.ts]"]
  node_authentication["Session authentication<br/>[jwt-auth.guard.ts]"]
  node_tenant_context["Workspace context"]
  node_permissions["Authorization"]
  node_workspace_data[("Tenant data store<br/>[core.datasource.ts]")]
end

subgraph group_operations["Background operations"]
  node_worker["Background worker<br/>[main.ts]"]
  node_job_queues["Scheduled job queues<br/>[main.ts]"]
  node_reports["Generated shift reports<br/>[main.ts]"]
end

node_managers(("Managers"))
node_venue_managers(("Venue managers"))
node_staff(("Staff"))

node_managers -->|"manage workforce"| node_web_app
node_venue_managers -->|"request cover"| node_web_app
node_staff -->|"use mobile app"| node_mobile_app
node_web_app -->|"request data"| node_web_api
node_web_api -.->|"send requests"| node_server
node_mobile_app -->|"record attendance"| node_server
node_server -.->|"authenticate requests"| node_authentication
node_server -.->|"manage records"| node_workforce_records
node_server -.->|"serve scheduling"| node_shift_planning
node_shift_planning -->|"send shift offers"| node_offer_api
node_offer_api -->|"dispatches"| node_offer_pipeline
node_offer_pipeline -->|"select eligible staff"| node_workforce_records
node_staff -->|"accept or decline"| node_offer_pipeline
node_managers -->|"confirm placements"| node_offer_pipeline
node_mobile_attendance -->|"submit worked time"| node_attendance_review
node_attendance_review -->|"provide reviewed hours"| node_payroll
node_server -.->|"scope workspace data"| node_tenant_context
node_tenant_context -->|"bind tenant context"| node_workspace_data
node_server -.->|"authorize actions"| node_permissions
node_worker -->|"run background jobs"| node_job_queues
node_job_queues -->|"confirm on timeout"| node_offer_pipeline
node_job_queues -->|"detect attendance issues"| node_attendance_review
node_job_queues -->|"generate timesheets"| node_reports
node_reports -->|"produce timesheets"| node_payroll

click node_web_app "https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-front/src/features/dashboard/Dashboard.tsx"
click node_mobile_app "https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-iphone/Crewflow/Features/Staff/Views/StaffRootView.swift"
click node_web_api "https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-front/src/shared/api.ts"
click node_workforce_records "https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-server/src/modules/staff/entities/staff-profile.entity.ts"
click node_shift_planning "https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-front/src/features/scheduling/Shifts.tsx"
click node_offer_pipeline "https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-server/src/modules/offer/services/venue-offer-pipeline.service.ts"
click node_offer_api "https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-server/src/modules/offer/controllers/venue-offer-pipeline.controller.ts"
click node_mobile_attendance "https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-iphone/Crewflow/Features/Staff/Attendance/StaffClockFlow.swift"
click node_attendance_review "https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-server/src/modules/attendance/controllers/staff-reviews.controller.ts"
click node_payroll "https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-front/src/features/payroll/Payroll.tsx"
click node_server "https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-server/src/main.ts"
click node_authentication "https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-server/src/engine/core-modules/auth/guards/jwt-auth.guard.ts"
click node_tenant_context "https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-server/src/engine/core-modules/tenant/tenant-context.service.ts"
click node_permissions "https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-server/src/engine/core-modules/permissions/permissions.service.ts"
click node_workspace_data "https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-server/src/database/typeorm/core/core.datasource.ts"
click node_worker "https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-worker/src/main.ts"
click node_job_queues "https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-worker/src/main.ts"
click node_reports "https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-worker/src/main.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web_app,node_mobile_app,node_web_api toneBlue
class node_workforce_records,node_shift_planning,node_offer_pipeline,node_mobile_attendance,node_attendance_review,node_payroll toneAmber
class node_offer_api,node_server,node_authentication,node_tenant_context,node_permissions,node_workspace_data toneMint
class node_worker,node_job_queues,node_reports toneRose
class node_managers,node_venue_managers,node_staff toneIndigo
```

## Components

### User applications

- [Manager web app](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-front/src/features/dashboard/Dashboard.tsx): `packages/rab-front/src/features/dashboard/Dashboard.tsx`
- [Staff and venue app](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-iphone/Crewflow/Features/Staff/Views/StaffRootView.swift): `packages/rab-iphone/Crewflow/Features/Staff/Views/StaffRootView.swift`
- [Web API client](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-front/src/shared/api.ts): `packages/rab-front/src/shared/api.ts`

### Workforce workflow

- [Staff and manager records](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-server/src/modules/staff/entities/staff-profile.entity.ts): `packages/rab-server/src/modules/staff/entities/staff-profile.entity.ts`
- [Shift planning](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-front/src/features/scheduling/Shifts.tsx): `packages/rab-front/src/features/scheduling/Shifts.tsx`
- [Offer lifecycle](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-server/src/modules/offer/services/venue-offer-pipeline.service.ts): `packages/rab-server/src/modules/offer/services/venue-offer-pipeline.service.ts`
- [Mobile attendance](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-iphone/Crewflow/Features/Staff/Attendance/StaffClockFlow.swift): `packages/rab-iphone/Crewflow/Features/Staff/Attendance/StaffClockFlow.swift`
- [Attendance review](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-server/src/modules/attendance/controllers/staff-reviews.controller.ts): `packages/rab-server/src/modules/attendance/controllers/staff-reviews.controller.ts`
- [Payroll and timesheets](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-front/src/features/payroll/Payroll.tsx): `packages/rab-front/src/features/payroll/Payroll.tsx`

### Server platform

- [Offer pipeline routes](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-server/src/modules/offer/controllers/venue-offer-pipeline.controller.ts): `packages/rab-server/src/modules/offer/controllers/venue-offer-pipeline.controller.ts`
- [Application server](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-server/src/main.ts): `packages/rab-server/src/main.ts`
- [Session authentication](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-server/src/engine/core-modules/auth/guards/jwt-auth.guard.ts): `packages/rab-server/src/engine/core-modules/auth/guards/jwt-auth.guard.ts`
- [Workspace context](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-server/src/engine/core-modules/tenant/tenant-context.service.ts): `packages/rab-server/src/engine/core-modules/tenant/tenant-context.service.ts`
- [Authorization](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-server/src/engine/core-modules/permissions/permissions.service.ts): `packages/rab-server/src/engine/core-modules/permissions/permissions.service.ts`
- [Tenant data store](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-server/src/database/typeorm/core/core.datasource.ts): `packages/rab-server/src/database/typeorm/core/core.datasource.ts`

### Background operations

- [Background worker](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-worker/src/main.ts): `packages/rab-worker/src/main.ts`
- [Scheduled job queues](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-worker/src/main.ts): `packages/rab-worker/src/main.ts`
- [Generated shift reports](https://github.com/rabblo06/rab-recurit/blob/main/packages/rab-worker/src/main.ts): `packages/rab-worker/src/main.ts`

### Other components

- **Managers**
- **Venue managers**
- **Staff**

## Connections

- Managers → Manager web app: manage workforce (evidence: `README.md`)
- Venue managers → Manager web app: request cover (evidence: `README.md`)
- Staff → Staff and venue app: use mobile app (evidence: `README.md`)
- Manager web app → Web API client: request data (evidence: `packages/rab-front/src/shared/api.ts`)
- Web API client → Application server: send requests
- Staff and venue app → Application server: record attendance (evidence: `README.md`)
- Application server → Session authentication: authenticate requests
- Application server → Staff and manager records: manage records
- Application server → Shift planning: serve scheduling
- Shift planning → Offer pipeline routes: send shift offers (evidence: `README.md`)
- Offer pipeline routes → Offer lifecycle: dispatches (evidence: `packages/rab-server/src/modules/offer/controllers/venue-offer-pipeline.controller.ts`)
- Offer lifecycle → Staff and manager records: select eligible staff (evidence: `packages/rab-server/src/modules/offer/services/venue-offer-pipeline.service.ts`)
- Staff → Offer lifecycle: accept or decline (evidence: `README.md`)
- Managers → Offer lifecycle: confirm placements (evidence: `README.md`)
- Mobile attendance → Attendance review: submit worked time (evidence: `README.md`)
- Attendance review → Payroll and timesheets: provide reviewed hours (evidence: `README.md`)
- Application server → Workspace context: scope workspace data
- Workspace context → Tenant data store: bind tenant context (evidence: `packages/rab-server/src/engine/core-modules/tenant/tenant-context.service.ts`)
- Application server → Authorization: authorize actions
- Background worker → Scheduled job queues: run background jobs (evidence: `packages/rab-worker/src/main.ts`)
- Scheduled job queues → Offer lifecycle: confirm on timeout (evidence: `README.md`)
- Scheduled job queues → Attendance review: detect attendance issues (evidence: `README.md`)
- Scheduled job queues → Generated shift reports: generate timesheets (evidence: `README.md`)
- Generated shift reports → Payroll and timesheets: produce timesheets (evidence: `README.md`)
