Skip to content

Conversation

@shomriddho
Copy link
Contributor

@shomriddho shomriddho commented Jan 23, 2026

This PR adds a new example application demonstrating how to integrate Payload CMS with TanStack Start and TanStack Query for modern full-stack development.

What?

  • Adds examples/tanstack-start/ directory with complete example application
  • Includes Payload CMS configuration with Posts collection and CRUD operations
  • TanStack Start frontend with TanStack Query for efficient data management
  • Demonstrates server-side data fetching and client-side mutations
  • Shows proper monorepo setup with workspace dependencies

Why?

  • Provides developers with a reference implementation for TanStack Start + Payload CMS integration
  • Shows best practices for data fetching and state management with TanStack Query
  • Demonstrates modern React patterns with server/client components
  • Expands the examples directory with cutting-edge technology stack
  • Complements the existing examples/astro by showing integration with different frontend frameworks

How?

This example is adapted from the existing examples/astro but uses TanStack Start instead of Astro:

  • Monorepo configuration with pnpm workspaces (same as astro)
  • Server-side data fetching in TanStack Router loaders (vs Astro server actions)
  • Client-side mutations with automatic cache invalidation (vs Astro actions)
  • CORS configuration for cross-origin API calls
  • Public access controls for demo purposes (same as astro)
  • Proper TypeScript integration throughout

Features Demonstrated

  • ✅ Payload CMS Posts collection with title field
  • ✅ Sample data initialization on startup
  • ✅ TanStack Query for data fetching and caching
  • ✅ Create, read, update, delete operations
  • ✅ Real-time UI updates without page reloads
  • ✅ Modern React Server Components architecture
  • ✅ Full TypeScript support

Comparison to examples/astro

While examples/astro shows Payload integration with Astro framework, this example demonstrates:

  • TanStack Start as an alternative modern React framework
  • TanStack Query for advanced data management
  • Different architectural patterns for server/client data flow
  • Enhanced developer experience with real-time updates

Fixes # (no specific issue)

@shomriddho shomriddho changed the title Feat: add tanstack start example and add readme.md file to astro example feat: add tanstack start example and add readme.md file to astro example Jan 23, 2026
@shomriddho
Copy link
Contributor Author

Hey @denolfe @AlessioGr 👋
This PR adds a new TanStack Start example alongside the existing Astro one.

Main things to review:
• Overall structure of the new examples/tanstack-start example
• Whether this fits well alongside examples/astro from a docs/examples POV

I’ve resolved the merge conflicts and all checks should be green now.
No rush at all — appreciate any feedback when you have time 🙏

@shomriddho shomriddho marked this pull request as draft January 24, 2026 20:42
@shomriddho shomriddho marked this pull request as ready for review January 24, 2026 20:43
@shomriddho
Copy link
Contributor Author

Hey @denolfe @AlessioGr 👋 This PR adds a new TanStack Start example alongside the existing Astro one.

Main things to review: • Overall structure of the new examples/tanstack-start example • Whether this fits well alongside examples/astro from a docs/examples POV

I’ve resolved the merge conflicts and all checks should be green now. No rush at all — appreciate any feedback when you have time 🙏

1 similar comment
@shomriddho
Copy link
Contributor Author

Hey @denolfe @AlessioGr 👋 This PR adds a new TanStack Start example alongside the existing Astro one.

Main things to review: • Overall structure of the new examples/tanstack-start example • Whether this fits well alongside examples/astro from a docs/examples POV

I’ve resolved the merge conflicts and all checks should be green now. No rush at all — appreciate any feedback when you have time 🙏

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant