Skip to content

schema_serverFn_inngestSetup - #3

Merged
xoloAyush merged 1 commit into
mainfrom
serverFn
Jun 27, 2026
Merged

xoloAyush merged 1 commit into
mainfrom
serverFn

Conversation

@xoloAyush

@xoloAyush xoloAyush commented Jun 27, 2026 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added support for creating, editing, regenerating, and deleting presentations.
    • Presentations now include slide details, styles, tones, and layouts, with automatic status tracking while content is being generated.
    • Added a new background processing endpoint to support asynchronous presentation workflows.
  • Bug Fixes

    • Improved access control so presentation actions now require a signed-in account.
    • Added safer handling for missing or invalid presentation data.
  • Style

    • Updated the home page spacing for a slightly improved layout.

@coderabbitai

coderabbitai Bot commented Jun 27, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 699917b9-9bae-40e3-aa2a-a8d1348dfa69

📥 Commits

Reviewing files that changed from the base of the PR and between aa05b98 and 35296b1.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (12)
  • package.json
  • prisma/migrations/20260627170407_presentation_slides/migration.sql
  • prisma/schema.prisma
  • src/features/presentations/actions/presentation-mutations.ts
  • src/features/presentations/lib/server-helpers.ts
  • src/features/presentations/types/schema.ts
  • src/integrations/inngest/client.ts
  • src/integrations/inngest/functions.ts
  • src/middleware/auth.ts
  • src/routeTree.gen.ts
  • src/routes/api/inngest.ts
  • src/routes/index.tsx

📝 Walkthrough

Walkthrough

Adds Presentation and Slide database models (Prisma schema + SQL migration), Zod input schemas, and four authenticated server mutations (create, update, delete, regenerate). Refactors auth middleware to session-only gating. Introduces an Inngest client and helloWorld function exposed via a new /api/inngest route registered in the TanStack Router tree.

Changes

Presentations Feature

Layer / File(s) Summary
Database schema and migration
prisma/schema.prisma, prisma/migrations/.../migration.sql
Adds PresentationStatus enum, Presentation and Slide models with cascade deletes and indexes, and extends User with a presentations relation. SQL migration creates matching tables.
Zod input schemas
src/features/presentations/types/schema.ts
Defines enum schemas for style, tone, and layout; createPresentationInputSchema; updatePresentationInputSchema with .refine requiring at least one optional field; and presentationIdInputSchema.
Server helpers
src/features/presentations/lib/server-helpers.ts
Adds deriveTitle (first-line truncation with fallback) and requirePresentationUserId (session fetch + unauthorized guard).
Presentation server mutations
src/features/presentations/actions/presentation-mutations.ts
Implements createPresentation, updatePresentation, deletePresentation, and regeneratePresentation as authenticated POST server functions with ownership checks.
Auth middleware refactor
src/middleware/auth.ts
Replaces pathname-based authMiddleware with authFnMiddleware that gates solely on session presence and passes { session } via context.

Inngest Integration

Layer / File(s) Summary
Inngest client, function, and API route
src/integrations/inngest/client.ts, src/integrations/inngest/functions.ts, src/routes/api/inngest.ts, src/routeTree.gen.ts
Creates the inngest client, a helloWorld function triggered by test/hello.world, and a /api/inngest Edge route (GET/POST/PUT) registered in the router tree.
Dependency and cosmetic updates
package.json, src/routes/index.tsx
Adds inngest and random-word-slugs, downgrades prisma to ^6.19.3, and adds mx-2 to the home page container.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 Hop hop, the slides appear,
A prompt becomes a title clear.
Inngest waits for hello events,
Auth now guards with session intents.
From DRAFT to GENERATING we go —
Watch the rabbit build the show! 🎉

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch serverFn

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@xoloAyush
xoloAyush merged commit 91279e5 into main Jun 27, 2026
1 check was pending
@coderabbitai coderabbitai Bot mentioned this pull request Jun 29, 2026
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