> ## Documentation Index
> Fetch the complete documentation index at: https://docs.whilst.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Project Structure

> Monorepo layout and package organization

## Root Layout

```
whilst-slack-bot/
├── apps/                  # Deployable applications
├── services/              # AWS Lambda handlers
├── packages/              # Shared TypeScript libraries
├── infra/                 # AWS CDK infrastructure
├── scripts/               # Utility scripts
├── migrations/            # Database migrations
├── openapi/               # OpenAPI specification
├── docs/                  # Internal documentation
├── docs-site/             # Mintlify documentation site
├── package.json           # Root workspace config
└── pnpm-workspace.yaml    # pnpm workspace definition
```

## Apps

### `apps/web-app/`

The main Next.js 14 web application.

| Directory     | Purpose                                  |
| ------------- | ---------------------------------------- |
| `app/`        | App Router pages and API routes          |
| `components/` | React components                         |
| `hooks/`      | Custom React hooks                       |
| `lib/`        | Utilities, database clients, AI services |

## Services

| Service                   | Purpose                         |
| ------------------------- | ------------------------------- |
| `services/event-intake/`  | Slack event ingestion Lambda    |
| `services/job-worker/`    | Background job processor Lambda |
| `services/user-resolver/` | User context resolution Lambda  |

## Packages

| Package                         | Purpose                                 |
| ------------------------------- | --------------------------------------- |
| `packages/shared/`              | Shared utilities and types              |
| `packages/communication-slack/` | Slack API client                        |
| `packages/mcp-clients/`         | MCP adapter implementations             |
| `packages/tenant-store/`        | Workspace data access layer             |
| `packages/job-store/`           | Job queue management                    |
| `packages/knowledge-pipeline/`  | Thread analysis and auto-doc generation |

## Key Entry Points

| File                                   | Purpose             |
| -------------------------------------- | ------------------- |
| `apps/web-app/app/layout.tsx`          | Web app root layout |
| `apps/web-app/app/[slug]/page.tsx`     | Workspace home page |
| `services/job-worker/src/handler.ts`   | Lambda job handler  |
| `services/event-intake/src/handler.ts` | Slack event handler |

## Configuration Files

| File                  | Purpose                       |
| --------------------- | ----------------------------- |
| `.env.example`        | Environment variable template |
| `pnpm-workspace.yaml` | Workspace package definitions |
| `tsconfig.base.json`  | Shared TypeScript config      |
| `eslint.config.mjs`   | ESLint configuration          |
| `vercel.json`         | Vercel deployment config      |
