Skip to content

A comprehensive example application demonstrating the features and capabilities of TanStack Start, a type-safe, client-first, full-stack React framework.

Notifications You must be signed in to change notification settings

FullStack-Flow/TanStack-Start-Tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TanStack Start Basic Example

A comprehensive example application demonstrating the features and capabilities of TanStack Start, a type-safe, client-first, full-stack React framework.

image

Full Video Tutorial From YouTube

πŸš€ Overview

This project showcases a modern full-stack React application built with TanStack Start, featuring:

  • Type-safe routing with TanStack Router
  • Server-side rendering (SSR) capabilities
  • Authentication system with protected routes
  • Data fetching with TanStack Query
  • File upload functionality
  • Error handling and boundary components
  • Streaming and deferred data loading
  • Infinite scrolling with pagination
  • Form handling and validation
  • Modern UI with Tailwind CSS

πŸ“‹ Prerequisites

  • Node.js (version 18 or higher)
  • npm or pnpm package manager
  • Git

πŸ› οΈ Installation

  1. Clone the repository:
git clone https://github.com/FullStack-Flow/TanStack-Start-Tutorial.git
cd TanStack-Start-Tutorial
  1. Install dependencies:
npm install
# or
pnpm install

πŸƒβ€β™‚οΈ Development

Start the development server:

npm run dev
# or
pnpm dev

The application will be available at http://localhost:3000

πŸ“¦ Build

Build the application for production:

npm run build
# or
pnpm build

πŸš€ Production

Start the production server:

npm start
# or
pnpm start

πŸ“ Project Structure

src/
β”œβ”€β”€ components/          # Reusable UI components
β”‚   β”œβ”€β”€ ui/             # UI component library
β”‚   β”œβ”€β”€ DefaultCatchBoundary.tsx  # Global error boundary
β”‚   β”œβ”€β”€ NotFound.tsx    # 404 page component
β”‚   β”œβ”€β”€ auth-header.tsx # Authentication header
β”‚   └── protected.tsx   # Protected route wrapper
β”œβ”€β”€ routes/             # File-based routing
β”‚   β”œβ”€β”€ __root.tsx      # Root layout and navigation
β”‚   β”œβ”€β”€ index.tsx       # Home page
β”‚   β”œβ”€β”€ dashboard.tsx   # Dashboard with nested routes
β”‚   β”œβ”€β”€ dashboard.*.tsx # Dashboard sub-pages
β”‚   β”œβ”€β”€ posts/          # Posts-related routes
β”‚   β”œβ”€β”€ users/          # Users-related routes
β”‚   β”œβ”€β”€ api/            # API routes
β”‚   └── *.tsx           # Feature-specific routes
β”œβ”€β”€ utils/              # Utility functions and server code
β”‚   β”œβ”€β”€ auth-*.ts       # Authentication logic
β”‚   β”œβ”€β”€ *.server.ts     # Server-side utilities
β”‚   └── middleware.ts   # Custom middleware
β”œβ”€β”€ styles/             # Global styles
└── router.tsx          # Router configuration

🎯 Features Demonstrated

πŸ” Authentication

  • Login system with form validation
  • Protected routes requiring authentication
  • User context management
  • Auth header component

πŸ“Š Dashboard

  • Multi-level navigation
  • Protected dashboard area
  • Profile and settings pages
  • Nested routing structure

πŸ“ Posts Management

  • Post listing with infinite scroll
  • Individual post pages
  • Deep nested routing
  • Server-side data fetching

πŸ‘₯ Users Management

  • User listing
  • User detail pages
  • User editing functionality
  • Form handling and validation

πŸ”„ Advanced Features

  • File Upload: Drag-and-drop file upload with progress
  • Streaming: Real-time data streaming
  • Deferred Loading: Progressive data loading
  • Parallel Routes: Multiple routes rendering simultaneously
  • Error Handling: Comprehensive error boundaries
  • SSR: Server-side rendering for improved performance

πŸ”§ Technical Features

  • TypeScript for type safety
  • Tailwind CSS for styling
  • TanStack Query for data management
  • TanStack Router for routing
  • Vite for build tooling
  • Modern ES modules

πŸ”— API Routes

The application includes several API endpoints:

  • /api/users - User management
  • /api/users/:id - Individual user operations

🎨 Styling

The project uses Tailwind CSS for styling with:

  • Responsive design
  • Modern color palette
  • Consistent spacing and typography
  • Dark mode support (ready)

πŸ› Error Handling

Comprehensive error handling with:

  • Global error boundaries
  • Route-specific error components
  • 404 page handling
  • User-friendly error messages

πŸ“± Responsive Design

The application is fully responsive and works across:

  • Desktop computers
  • Tablets
  • Mobile devices

πŸ”§ Configuration

Key configuration files:

  • vite.config.ts - Vite build configuration
  • tsconfig.json - TypeScript configuration
  • postcss.config.mjs - PostCSS configuration

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License.

πŸ†˜ Support

For support and questions:

πŸŽ‰ Acknowledgments


Happy coding! πŸš€

About

A comprehensive example application demonstrating the features and capabilities of TanStack Start, a type-safe, client-first, full-stack React framework.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages