Skip to content

feat(services): add markdown, storage, email, notifications and slack services - #5

Merged
pulkitxm merged 11 commits into
mainfrom
feat/services
Jul 22, 2026
Merged

pulkitxm merged 11 commits into
mainfrom
feat/services

Conversation

@pulkitxm

Copy link
Copy Markdown
Member

Adds the @orbit/services package with sanitized markdown rendering, pluggable local/S3 storage, idempotent transactional email with React templates, the notification engine, and Slack signature verification, client, blocks and command parsing.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 981a03ac-bc11-4cfe-8db7-ac09ab6b8191

📥 Commits

Reviewing files that changed from the base of the PR and between 80d594e and 8224083.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (27)
  • .env.example
  • .gitignore
  • packages/services/package.json
  • packages/services/src/email/email.test.ts
  • packages/services/src/email/index.ts
  • packages/services/src/email/layout.tsx
  • packages/services/src/email/templates.tsx
  • packages/services/src/email/transports.ts
  • packages/services/src/index.ts
  • packages/services/src/markdown/index.ts
  • packages/services/src/markdown/markdown.test.ts
  • packages/services/src/notifications/index.ts
  • packages/services/src/notifications/notifications.test.ts
  • packages/services/src/notifications/preferences.ts
  • packages/services/src/notifications/quiet-hours.ts
  • packages/services/src/slack/index.ts
  • packages/services/src/slack/slack.test.ts
  • packages/services/src/storage/index.ts
  • packages/services/src/storage/local.ts
  • packages/services/src/storage/s3.ts
  • packages/services/src/storage/storage.test.ts
  • packages/services/src/storage/types.ts
  • packages/services/src/storage/validate.ts
  • packages/services/src/test-database.ts
  • packages/services/tsconfig.json
  • packages/services/vitest.config.ts
  • turbo.json

📝 Walkthrough

Walkthrough

Adds the @orbit/services package with Markdown, storage, email, notification, and Slack modules. The changes include public APIs, environment-based driver selection, database-backed delivery and inbox workflows, sanitization and validation utilities, integration clients, configuration, and comprehensive Vitest coverage.

Changes

Services platform

Layer / File(s) Summary
Package foundation
packages/services/package.json, packages/services/src/index.ts, packages/services/src/test-database.ts, packages/services/tsconfig.json, packages/services/vitest.config.ts
Defines the services package, public entrypoints, TypeScript/Vitest settings, database test transactions, and barrel exports.
Markdown rendering and extraction
packages/services/src/markdown/*
Adds sanitized Markdown HTML/plain-text rendering, summaries, safe image extraction, and tests for GFM and XSS behavior.
Storage validation and drivers
packages/services/src/storage/*, .gitignore
Adds upload validation, safe key generation, local and S3 drivers, driver selection, metadata operations, and storage tests.
Notification planning and inbox
packages/services/src/notifications/*
Adds notification validation, preference filtering, quiet-hours scheduling, deduplication, persistence, inbox mutations, pagination, unread counts, and tests.
Email templates and delivery
.env.example, turbo.json, packages/services/src/email/*
Adds React Email templates, console/SMTP/Resend transports, SMTP configuration, idempotent delivery persistence, and email tests.
Slack integration
packages/services/src/slack/*
Adds request signature verification, Block Kit and unfurl helpers, slash-command parsing, typed Slack API methods, error handling, and tests.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant NotificationEvent
  participant notifyMany
  participant NotificationDatabase
  participant EmailDispatch
  participant SlackDispatch
  NotificationEvent->>notifyMany: validate and plan recipients
  notifyMany->>NotificationDatabase: persist inbox notifications
  notifyMany-->>EmailDispatch: return scheduled email plans
  notifyMany-->>SlackDispatch: return Slack dispatch plans
Loading
sequenceDiagram
  participant Application
  participant sendEmail
  participant EmailDatabase
  participant ResendTransport
  Application->>sendEmail: submit validated email and idempotency key
  sendEmail->>EmailDatabase: insert pending delivery
  sendEmail->>ResendTransport: send message
  ResendTransport-->>sendEmail: provider ID
  sendEmail->>EmailDatabase: mark delivery sent
Loading

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Checkov (3.3.8)
packages/services/package.json

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'

packages/services/tsconfig.json

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'

turbo.json

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'


Comment @coderabbitai help to get the list of available commands.

@pulkitxm

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@pulkitxm

Copy link
Copy Markdown
Member Author

Visual evidence

All shots are real output: the email HTML comes straight from the @orbit/services/email template functions, the markdown panes come straight from renderMarkdown. Each email is shown inside a light and a dark mail client chrome. The templates commit to a single light card on purpose, so they stay legible in clients that do not honour a dark scheme.

Email templates

Magic link email in a light mail client
Magic link sign in, light client. Passwordless copy, accent button, and the pasteable fallback link.

Magic link email in a dark mail client
The same magic link email on a dark client background.

Invite email in a light mail client
Organization invite with inviter, role, and accept button.

Invite email in a dark mail client
Invite email on a dark client background.

Issue assigned email in a light mail client
Issue assigned, subject line doubles as the identifier plus title heading.

Issue assigned email in a dark mail client
Issue assigned on a dark client background.

Mention email in a light mail client
Mention notification with the quoted excerpt card.

Mention email in a dark mail client
Mention email on a dark client background.

Comment email in a light mail client
New comment on an issue, with a reply call to action.

Comment email in a dark mail client
Comment email on a dark client background.

Weekly digest email in a light mail client
Weekly digest with completed, in progress, and needs triage sections.

Weekly digest email in a dark mail client
Weekly digest on a dark client background.

Markdown sanitizer, before and after

Raw markdown input including xss attempts
Input: a GFM table, a fenced TypeScript block, a task list, strikethrough, a blockquote, plus five attacks (<script>, <img onerror>, <iframe>, a markdown javascript: link, and a style attribute carrying javascript:).

Sanitized renderMarkdown output
Output: the table, code block, task list, strikethrough, and blockquote all survive. The script, the iframe, the onerror handler, and the style attribute are gone, and the javascript: link is left as inert text rather than an anchor.

Tests

pnpm verify is green end to end: lint, comment policy, typecheck, and tests.

Suite Tests
markdown 19, seven of them XSS attempts that must be neutralized
storage 19, including six path traversal escapes
email 17, templates, transport selection, idempotency against real Postgres
notifications 19, preferences, actor suppression, dedupe, quiet hours, inbox
slack 27, Slack's published signature vector, tampering, replay, blocks, parser
total 101 passing

Database backed tests run inside a transaction that rolls back, and no test touches the network.

@pulkitxm
pulkitxm merged commit 32111ab into main Jul 22, 2026
3 of 4 checks passed
@pulkitxm

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant