Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
28d0c25
feat(workers): add Temporal worker structure and initial implementation
anatolyshipitz May 16, 2025
1911fba
chore(workers): remove outdated README and clean up code
anatolyshipitz May 16, 2025
5991f4f
feat(docker): update Temporal service configuration and add worker
anatolyshipitz May 16, 2025
49c15b9
fix(workflows): add missing newline at end of file in index.ts
anatolyshipitz May 16, 2025
8c1d0be
fix: add missing newlines at the end of multiple TypeScript files
anatolyshipitz May 16, 2025
91c7c23
fix: add missing newline at end of tsconfig.json
anatolyshipitz May 16, 2025
605b01c
refactor(package): rename worker and update paths in package.json
anatolyshipitz May 16, 2025
a278a28
Update dependencies and rename package in package-lock.json
anatolyshipitz May 16, 2025
4fd8b8a
docs: update project structure and shared utilities documentation
anatolyshipitz May 16, 2025
5c402e9
feat(docker): add temporal-worker-main service and update configurations
anatolyshipitz May 16, 2025
29f3c88
refactor(index.ts): filter out test files from activity modules
anatolyshipitz May 16, 2025
16ced12
fix(docker): pin netcat-openbsd version in Dockerfile.temporal
anatolyshipitz May 16, 2025
270ecfd
refactor(index.ts): enhance activity module import logic
anatolyshipitz May 16, 2025
fa344d1
fix(docker): remove version pin for netcat-openbsd in Dockerfile.temp…
anatolyshipitz May 16, 2025
33c06b1
refactor(index.ts): streamline activity module loading
anatolyshipitz May 16, 2025
6edcf5a
fix(docker): pin netcat-openbsd version in Dockerfile.temporal
anatolyshipitz May 16, 2025
9bbfd7c
fix(docker): update Dockerfile.temporal-worker-main for build process
anatolyshipitz May 16, 2025
1e45e6f
fix(docker): update Docker configurations and ignore files
anatolyshipitz May 16, 2025
ef99fc3
feat(tests): add Vitest configuration and initial test cases
anatolyshipitz May 16, 2025
351d681
feat(coverage): enhance SonarQube integration and testing setup
anatolyshipitz May 16, 2025
07d188d
feat(dependencies): update package-lock and package.json for improved…
anatolyshipitz May 16, 2025
7f710e7
feat(sonar): add exclusions to sonar-project.properties for improved …
anatolyshipitz May 16, 2025
95467f6
Merge branch 'main' into feature/64211-temporal-worker
anatolyshipitz May 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .cursor/rules/temporal-project-structure.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
description:
globs:
alwaysApply: false
---
# Temporal Project Structure Rule

## Purpose
Defines the required directory and documentation structure for Temporal-based workflows and workers in this repository.

## Project Structure

The project follows a modular structure with workers as independent packages:

```
.
├── workers/ # Root directory for all Temporal workers
│ ├── main/ # Main worker package
│ │ ├── src/ # Source code
│ │ │ ├── activities/ # Activity implementations
│ │ │ ├── workflows/ # Workflow definitions
│ │ │ ├── index.ts # Worker entry point
│ │ │ └── types.ts # Worker-specific types
│ │ ├── package.json # Worker dependencies
│ │ ├── tsconfig.json # TypeScript configuration
│ │ └── README.md # Worker documentation
│ └── [other-workers]/ # Additional worker packages
├── docs/ # Project documentation
│ └── user-guide/ # User guides and documentation
├── docker-compose.yml # Docker compose configuration
└── Dockerfile.temporal # Base Temporal worker Dockerfile
```

All Temporal workers must be placed under `src/workers/<worker-name>/` and include:

- `workflows/` — workflow definitions for this worker
- `activities/` — activity implementations for this worker
- `index.ts` — worker entry point (registers workflows/activities, sets task queue)
- `types.ts` — (optional) worker-specific types
- `README.md` — brief usage and development instructions

Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
Shared utilities, types, and configuration should be placed in `src/shared/`.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

## Documentation

Each worker must have a dedicated documentation file at:
`docs/user-guide/temporal/workers/<worker-name>.md`

Documentation must include:

- Purpose and responsibilities of the worker
- List and description of workflows and activities
- Required environment variables
- Integration points (e.g., databases, APIs)
- Best practices and troubleshooting

## Best Practices

- Keep workflow and activity logic modular and well-tested.
- Use clear, descriptive names for workflows, activities, and task queues.
- Update documentation with every significant change to workflows or activities.
- New workers must not duplicate logic already present in shared modules.

## Enforcement

- PRs introducing new Temporal workers or workflows **must** follow this structure and update documentation accordingly.
26 changes: 26 additions & 0 deletions Dockerfile.temporal-worker-main
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM node:20-bullseye AS deps
WORKDIR /app
COPY workers/main/package*.json ./
RUN npm ci

FROM node:20-bullseye AS dev
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
ENV NODE_ENV=development
CMD ["npx", "nodemon", "--watch", "./", "--ext", "ts", "--exec", "npx", "ts-node", "src/index.ts"]
Comment thread
coderabbitai[bot] marked this conversation as resolved.

FROM node:20-bullseye AS build
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY workers/main/ ./
RUN npm run build

FROM gcr.io/distroless/nodejs20-debian11 AS prod
WORKDIR /app
COPY --from=build /app/build ./build
COPY --from=build /app/node_modules ./node_modules

ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}

CMD ["node", "build/worker.js"]
Loading