Skip to content

Commit 5878ba7

Browse files
committed
docs: update CLAUDE.md to include new environment variables and Inngest functions
- Added `UNSPLASH_API_KEY` to server-side environment variables. - Updated Cloudflare R2 section with `S3_REGION` and renamed `S3_SECRET_ACCESS_KEY` to `S3_ACCESS_SECRET`. - Introduced Pusher configuration variables for real-time notifications. - Documented Inngest functions for notification handling and cleanup tasks.
1 parent 9b2aa5f commit 5878ba7

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

CLAUDE.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ Server-side:
128128
- `GITHUB_CALLBACK_URL` - GitHub OAuth callback URL (legacy flow)
129129
- `CLOUDINARY_URL` - Cloudinary configuration
130130
- `MEILISEARCH_ADMIN_API_KEY` - MeilSearch admin API key
131+
- `UNSPLASH_API_KEY` - Unsplash API key (required by env schema)
131132

132133
Client-side:
133134

@@ -138,15 +139,25 @@ Client-side:
138139
Cloudflare R2 (S3-compatible):
139140

140141
- `S3_ENDPOINT` - R2 endpoint URL
142+
- `S3_REGION` - R2 region (usually `auto`)
141143
- `S3_BUCKET` - R2 bucket name
142144
- `S3_ACCESS_KEY_ID` - R2 access key
143-
- `S3_SECRET_ACCESS_KEY` - R2 secret key
145+
- `S3_ACCESS_SECRET` - R2 secret key
144146

145147
Inngest:
146148

147149
- `INNGEST_EVENT_KEY` - Inngest event key (optional for local dev)
148150
- `INNGEST_SIGNING_KEY` - Inngest signing key (optional for local dev)
149151

152+
Pusher / Soketi (real-time):
153+
154+
- `PUSHER_APP_ID` - Pusher app ID
155+
- `PUSHER_APP_KEY` - Pusher app key
156+
- `PUSHER_APP_SECRET` - Pusher app secret
157+
- `PUSHER_WS_HOST` - WebSocket host (self-hosted Soketi or pusher.com)
158+
- `NEXT_PUBLIC_PUSHER_APP_KEY` - Client-side app key
159+
- `NEXT_PUBLIC_PUSHER_WS_HOST` - Client-side WebSocket host
160+
150161
## Key Features Implementation
151162

152163
### Authentication Flow
@@ -239,7 +250,7 @@ persistenceRepository.article.paginate({ where, orderBy, limit, page })
239250
persistenceRepository.article.find({ where, columns, joins })
240251
```
241252

242-
Available repositories: `user`, `userSocial`, `userSession`, `article`, `bookmark`, `comment`, `reaction`, `articleTagPivot`, `tags`, `series`, `seriesItems`, `kv`, `gist`, `gistFile`.
253+
Available repositories: `user`, `userSocial`, `userSession`, `article`, `bookmark`, `comment`, `reaction`, `articleTagPivot`, `tags`, `series`, `seriesItems`, `kv`, `gist`, `gistFile`, `notification`.
243254

244255
For complex multi-join queries, raw SQL is executed directly via `pgClient.executeSQL()`.
245256

@@ -366,6 +377,8 @@ const feedQuery = useInfiniteQuery({
366377
- **SEO Optimization**: Dynamic sitemaps in `src/app/sitemaps/`, Open Graph tags, and schema markup
367378
- **No test framework**: There are no automated tests — use `bun run play` for backend experimentation
368379
- **Article soft-delete**: Articles have a `delete_scheduled_at` field. Setting it schedules permanent deletion; `article-cleanup-service.ts` processes them when the **Inngest cron** (`cleanup-expired-articles`, `0 2 * * *` UTC) fires. Use `restoreScheduleDeletedArticle` to cancel.
380+
- **Inngest functions** (`src/lib/inngest.ts`): Two registered functions — `cleanup-expired-articles` (daily cron) and `persist-notification` (event: `app/notification.requested`). The notification function handles both pre-built payloads and minimal `reaction_request` / `comment_request` shortcuts that it resolves internally. All functions are served via `src/app/api/inngest/route.ts`.
381+
- **Real-time notifications**: After persisting a notification, Inngest publishes to Pusher on channel `private-user.<recipient_id>` with event `REALTIME_PUSHER_EVENTS.NOTIFICATION_NEW`. Client subscribes via `src/lib/pusher/pusher.client.ts`. Pusher is optional — `pusherServer` is `null` when env vars are missing, so `publishMessage()` no-ops gracefully.
369382

370383
## Caching & ISR (Incremental Static Regeneration)
371384

0 commit comments

Comments
 (0)