An open API service indexing awesome lists of open source software.

https://github.com/felipfr/tanstack-start-query-clerk-template

A modern, full-stack React application template built with TanStack Start, Clerk, and a rich ecosystem of cutting-edge tools.
https://github.com/felipfr/tanstack-start-query-clerk-template

clerk new-relic shadcn-ui tanstack-query tanstack-start

Last synced: about 1 month ago
JSON representation

A modern, full-stack React application template built with TanStack Start, Clerk, and a rich ecosystem of cutting-edge tools.

Awesome Lists containing this project

README

          

# TanStack Start + Clerk Template

A modern, full-stack React application template built with [TanStack Start](https://tanstack.com/start), [Clerk](https://clerk.com/), and a rich ecosystem of cutting-edge tools.

## Overview

This template leverages **TanStack Start**, a powerful React framework designed for maximum flexibility and scalability. It supports deployment anywhere JavaScript runsβ€”traditional servers, serverless platforms, or even CDNsβ€”thanks to its universal rendering capabilities. Built on top of [TanStack Router](https://tanstack.com/router/latest) and deeply integrated with [TanStack Query](https://tanstack.com/query/latest), it enables advanced routing, data fetching, and caching with ease.

For authentication and authorization, it uses **Clerk**, providing seamless user management, social login, and **Role-Based Access Control (RBAC)**. RBAC allows you to define granular permissions and secure your app effectively. Learn more about Clerk RBAC [here](https://clerk.com/docs/references/nextjs/basic-rbac).

## Key Features

- ⚑ **TanStack Start** β€” Modern React framework with universal rendering, flexible deployment, and built-in SSR.
- πŸ—ΊοΈ **TanStack Router** β€” Type-safe, file-based routing with nested layouts and data loading.
- πŸ” **TanStack Query** β€” Powerful asynchronous state management, caching, and background updates.
- πŸ” **Clerk Auth with RBAC** β€” Authentication, social login, and fine-grained access control ([RBAC docs](https://clerk.com/docs/references/nextjs/basic-rbac)).
- 🎨 **Tailwind CSS** β€” Utility-first styling with [shadcn/ui](https://ui.shadcn.com/) components.
- 🧩 **Radix UI** β€” Accessible, composable UI primitives.
- 🌐 **Jotai** β€” Atomic state management for local/global state.
- πŸ›‘οΈ **Prisma ORM** β€” Type-safe database access.
- πŸ“ˆ **New Relic** β€” Performance monitoring and observability.
- 🧰 **Zod** β€” Type-safe schema validation.
- πŸŒ™ **Dark/Light Mode** β€” Theme switching with [next-themes](https://github.com/pacocoursey/next-themes).
- πŸ”” **Sonner** β€” Elegant toast notifications.
- 🎭 **Lucide Icons** β€” Beautiful, consistent icon set.
- βš™οΈ **TypeScript** β€” Fully typed codebase.
- 🧹 **Prettier & ESLint** β€” Code formatting and linting with TanStack plugins.l

## Getting Started

### 1. Clone the repository

```bash
git clone https://github.com/your-username/tanstack-start-query-clerk-template.git
cd tanstack-start-query-clerk-template
```

### 2. Install dependencies

```bash
npm install
# or
yarn install
# or
pnpm install
```

### 3. Configure environment variables

Copy the example environment file and update it with your credentials:

```bash
cp .env.local.example .env.local
```

Edit `.env.local` to set up:

- **Clerk** API keys and social login credentials
- **Database** connection string (Prisma)
- **New Relic** monitoring keys
- App metadata (name, description, URL)

### 4. Run database migrations (if applicable)

```bash
npm run migrate:prisma
```

### 5. Start the development server

```bash
npm run start:dev
```

Visit [http://localhost:3000](http://localhost:3000) to see your app in action.

## Project Structure

```plaintext
tanstack-start-query-clerk-template/
β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ components/ # Reusable UI components
β”‚ β”œβ”€β”€ lib/ # Config, hooks, helpers, types
β”‚ β”œβ”€β”€ routes/ # App routes (file-based, TanStack Router)
β”‚ β”œβ”€β”€ styles/ # Global styles (Tailwind CSS)
β”‚ └── ... # SSR entry points, API utilities
β”œβ”€β”€ public/ # Static assets
β”œβ”€β”€ app.config.ts # TanStack Start + Vite config
β”œβ”€β”€ package.json # Dependencies and scripts
β”œβ”€β”€ tsconfig.json # TypeScript config
β”œβ”€β”€ .env.local # Environment variables
└── README.md # Project documentation
```

## License

This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.

## Contributing

Contributions are welcome! Feel free to open issues or submit pull requests to improve this template.

## Acknowledgements

- [TanStack](https://tanstack.com/) for their incredible open-source libraries.
- [Clerk](https://clerk.com/) for seamless authentication and RBAC.
- [shadcn/ui](https://ui.shadcn.com/) for beautiful UI components.