This project demonstrates how to set up server-side rendering (SSR) with Vite and TanStack Router. It provides a minimal setup to get you started with SSR in a React application.
- Vite for fast development and optimized production builds
- React for building user interfaces
- Server-side rendering (SSR) for improved performance and SEO
- TanStack Router for type-safe routing
- TanStack React Query for efficient data fetching, caching, and state management
- Tailwind CSS for utility-first styling and rapid UI development
To get started with this project, follow these steps:
-
Clone the repository:
git clone https://github.com/romannmk/vite-tanstack.git cd vite-tanstack
-
Install dependencies:
npm install
-
Run the development server:
npm run dev
The application will be available at http://localhost:5173.
The project structure is organized as follows:
vite-tanstack/
├── src/
│ ├── components/
│ ├── queries/
│ ├── routes/
│ ├── entry-client.tsx
│ ├── entry-server.tsx
│ ├── routeTree.gen.ts
│ └── router.tsx
├── index.html
├── vite.config.ts
└── package.json
The following npm scripts are available:
npm run dev
- Starts the development servernpm run build
- Builds the production-ready applicationnpm run serve
- Serves the production build locally
Contributions are welcome! Please feel free to submit a Pull Request or contact me by email.
This project is open source and available under the MIT License.