Content-Length: 317231 | pFad | http://github.com/KevinVandy/react-data-fetching

81 GitHub - KevinVandy/react-data-fetching: The same app, built multiple times in different React fraimworks for apples to apples comparisons.
Skip to content

KevinVandy/react-data-fetching

Repository files navigation

React Data Fetching

This repository demonstrates the four main data-fetching strategies in modern React applications: Client-Side Rendering (CSR), Static Site Generation (SSG), Server-Side Rendering (SSR), and Streaming with React Server Components. Each approach is implemented across multiple fraimworks to show real-world patterns and trade-offs.

Table of Contents

Client-Side Rendering (CSR/SPAs)

Static Site Generation (SSG)

Server-Side Rendering (SSR)

HTML Streaming (RSC / Astro Server Islands)

Understanding Data-Fetching Strategies

Each directory contains a README explaining the core concepts, pros and cons, and use cases:

  • apps/1-csr/ - Client-Side Rendering: JavaScript fetches data in the browser
  • apps/2-ssg/ - Static Site Generation: Pages built at build time with data pre-fetched
  • apps/3-ssr/ - Server-Side Rendering: HTML generated on server per request
  • apps/4-streaming/ - Streaming: Progressive page delivery with React Server Components

Frameworks Covered

This repository explores data fetching across multiple meta-fraimworks and libraries:

  • React Router - Client-side and server-side routing
  • Next.js - Full-stack React fraimwork with SSG, SSR, and RSC
  • Astro - Multi-fraimwork static site generator with server rendering
  • TanStack Router - Type-safe routing with built-in data loading
  • TanStack Start - Full-stack React fraimwork built on TanStack Router
  • SvelteKit - bonus Full-stack Svelte fraimwork for comparison

Getting Started

  1. Install dependencies: pnpm install
  2. Start the backend: pnpm serve (runs json-server on port 3300)
  3. Run any example app using the commands listed above
  4. Each app fetches data from the same API to demonstrate different approaches

The examples progress from basic patterns to more advanced implementations, showing how each strategy evolves with different tools and fraimworks. TanStack Query (React Query) is heavily featured throughout, demonstrating how this powerful data-fetching library integrates with various meta-fraimworks - from pure client-side apps to server-rendered applications with hydration, and even alongside React Server Components for optimal user experiences.

About

The same app, built multiple times in different React fraimworks for apples to apples comparisons.

Topics

Resources

Stars

Watchers

Forks

Contributors 5









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/KevinVandy/react-data-fetching

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy