Skip to content

Commit cf9aefd

Browse files
chore: add tanstack start example app (#1431)
1 parent a51472f commit cf9aefd

34 files changed

+2917
-95
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,6 @@ dist/
5050

5151
# turbo
5252
.turbo
53+
54+
# tanstack
55+
.tanstack

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
"files.associations": {
1818
"*.css": "tailwindcss"
1919
},
20+
"files.readonlyInclude": {
21+
"**/routeTree.gen.ts": true
22+
},
23+
"files.watcherExclude": {
24+
"**/routeTree.gen.ts": true
25+
},
2026
"prettier.ignorePath": ".gitignore",
2127
"tailwindCSS.classFunctions": ["cva", "cx", "cn"],
2228
"typescript.enablePromptUseWorkspaceTsdk": true,

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
> [!NOTE]
44
>
5-
> create-t3-turbo now uses better-auth for authentication!
6-
> Look out for bugs as we're working through the last issues,
7-
> especially, the oauth proxy might not play very nice with Expo
8-
> so you might need to disable that in [`@acme/auth`](./packages/auth/src/index.ts)
5+
> create-t3-turbo now includes the option to use Tanstack Start for the web app!
96
107
## Installation
118

@@ -42,8 +39,13 @@ apps
4239
│ ├─ Navigation using Expo Router
4340
│ ├─ Tailwind CSS v4 using NativeWind v5
4441
│ └─ Typesafe API calls using tRPC
45-
└─ next.js
46-
├─ Next.js 15
42+
├─ nextjs
43+
│ ├─ Next.js 15
44+
│ ├─ React 19
45+
│ ├─ Tailwind CSS v4
46+
│ └─ E2E Typesafe API Server & Client
47+
└─ tanstack-start
48+
├─ Tanstack Start v1 (rc)
4749
├─ React 19
4850
├─ Tailwind CSS v4
4951
└─ E2E Typesafe API Server & Client
@@ -78,6 +80,10 @@ To get it running, follow the steps below:
7880

7981
### 1. Setup dependencies
8082

83+
> [!NOTE]
84+
>
85+
> While the repo does contain both a Next.js and Tanstack Start version of a web app, you can pick which one you like to use and delete the other folder before starting the setup.
86+
8187
```bash
8288
# Install dependencies
8389
pnpm i

apps/nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"@acme/prettier-config": "workspace:*",
3737
"@acme/tailwind-config": "workspace:*",
3838
"@acme/tsconfig": "workspace:*",
39-
"@types/node": "^22.18.10",
39+
"@types/node": "catalog:",
4040
"@types/react": "catalog:react19",
4141
"@types/react-dom": "catalog:react19",
4242
"eslint": "catalog:",

apps/nextjs/src/app/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Toaster } from "@acme/ui/toast";
88
import { env } from "~/env";
99
import { TRPCReactProvider } from "~/trpc/react";
1010

11-
import "~/app/globals.css";
11+
import "~/app/styles.css";
1212

1313
export const metadata: Metadata = {
1414
metadataBase: new URL(
@@ -57,7 +57,7 @@ export default function RootLayout(props: { children: React.ReactNode }) {
5757
geistMono.variable,
5858
)}
5959
>
60-
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
60+
<ThemeProvider>
6161
<TRPCReactProvider>{props.children}</TRPCReactProvider>
6262
<div className="absolute right-4 bottom-4">
6363
<ThemeToggle />

apps/nextjs/src/app/globals.css renamed to apps/nextjs/src/app/styles.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
@source "../../../../packages/ui/src/*.{ts,tsx}";
66

77
@custom-variant dark (&:where(.dark, .dark *));
8+
@custom-variant light (&:where(.light, .light *));
9+
@custom-variant auto (&:where(.auto, .auto *));
810

911
@utility container {
1012
margin-inline: auto;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
routeTree.gen.ts
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { defineConfig } from "eslint/config";
2+
3+
import { baseConfig, restrictEnvAccess } from "@acme/eslint-config/base";
4+
import { reactConfig } from "@acme/eslint-config/react";
5+
6+
export default defineConfig(
7+
{
8+
ignores: [".nitro/**", ".output/**", ".tanstack/**"],
9+
},
10+
baseConfig,
11+
reactConfig,
12+
restrictEnvAccess,
13+
);

apps/tanstack-start/package.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"name": "@acme/tanstack-start",
3+
"private": true,
4+
"sideEffects": false,
5+
"type": "module",
6+
"scripts": {
7+
"dev": "pnpm with-env vite dev",
8+
"build": "vite build",
9+
"start": "vite start",
10+
"format": "prettier --check . --ignore-path ../../.gitignore --ignore-path .prettierignore",
11+
"lint": "eslint --flag unstable_native_nodejs_ts_config",
12+
"typecheck": "tsc --noEmit",
13+
"with-env": "dotenv -e ../../.env --"
14+
},
15+
"dependencies": {
16+
"@acme/api": "workspace:*",
17+
"@acme/auth": "workspace:*",
18+
"@acme/db": "workspace:*",
19+
"@acme/ui": "workspace:*",
20+
"@fontsource-variable/geist": "^5.2.8",
21+
"@fontsource-variable/geist-mono": "^5.2.7",
22+
"@t3-oss/env-core": "^0.13.8",
23+
"@tanstack/react-form": "catalog:",
24+
"@tanstack/react-query": "catalog:",
25+
"@tanstack/react-router": "^1.132.47",
26+
"@tanstack/react-router-devtools": "^1.132.51",
27+
"@tanstack/react-router-ssr-query": "^1.132.47",
28+
"@tanstack/react-start": "^1.132.52",
29+
"@trpc/client": "catalog:",
30+
"@trpc/server": "catalog:",
31+
"@trpc/tanstack-react-query": "catalog:",
32+
"better-auth": "catalog:",
33+
"nitro": "npm:nitro-nightly@latest",
34+
"react": "catalog:react19",
35+
"react-dom": "catalog:react19",
36+
"superjson": "2.2.3",
37+
"zod": "catalog:"
38+
},
39+
"devDependencies": {
40+
"@acme/eslint-config": "workspace:*",
41+
"@acme/prettier-config": "workspace:*",
42+
"@acme/tailwind-config": "workspace:*",
43+
"@acme/tsconfig": "workspace:*",
44+
"@tailwindcss/vite": "catalog:",
45+
"@types/node": "catalog:",
46+
"@types/react": "catalog:react19",
47+
"@types/react-dom": "catalog:react19",
48+
"@vitejs/plugin-react": "^4.3.4",
49+
"eslint": "catalog:",
50+
"prettier": "catalog:",
51+
"tailwindcss": "catalog:",
52+
"typescript": "catalog:",
53+
"vite": "^7.1.7",
54+
"vite-tsconfig-paths": "^5.1.4"
55+
},
56+
"prettier": "@acme/prettier-config"
57+
}
101 KB
Binary file not shown.

0 commit comments

Comments
 (0)