@tanstack/cta-framework-solid 0.27.1 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/ADD-ON-AUTHORING.md +211 -1
  2. package/add-ons/convex/README.md +4 -0
  3. package/add-ons/convex/assets/_dot_cursorrules.append +93 -0
  4. package/add-ons/convex/assets/_dot_env.local.append +3 -0
  5. package/add-ons/convex/assets/convex/_generated/api.d.ts +36 -0
  6. package/add-ons/convex/assets/convex/_generated/api.js +22 -0
  7. package/add-ons/convex/assets/convex/_generated/dataModel.d.ts +60 -0
  8. package/add-ons/convex/assets/convex/_generated/server.d.ts +142 -0
  9. package/add-ons/convex/assets/convex/_generated/server.js +89 -0
  10. package/add-ons/convex/assets/convex/schema.ts +14 -0
  11. package/add-ons/convex/assets/convex/todos.ts +43 -0
  12. package/add-ons/convex/assets/convex/tsconfig.json +25 -0
  13. package/add-ons/convex/assets/src/integrations/convex/provider.tsx +12 -0
  14. package/add-ons/convex/assets/src/routes/demo/convex.tsx +169 -0
  15. package/add-ons/convex/info.json +23 -0
  16. package/add-ons/convex/package.json +7 -0
  17. package/add-ons/convex/small-logo.svg +5 -0
  18. package/add-ons/start/assets/public/tanstack-circle-logo.png +0 -0
  19. package/add-ons/start/assets/public/tanstack-word-logo-white.svg +1 -0
  20. package/add-ons/start/assets/src/router.tsx.ejs +0 -2
  21. package/add-ons/start/assets/src/routes/index.tsx.ejs +154 -0
  22. package/add-ons/start/package.json +3 -2
  23. package/add-ons/strapi/README.md +14 -0
  24. package/add-ons/strapi/assets/_dot_env.local.append +2 -0
  25. package/add-ons/strapi/assets/src/lib/strapiClient.ts +7 -0
  26. package/add-ons/strapi/assets/src/routes/demo/strapi.tsx +69 -0
  27. package/add-ons/strapi/assets/src/routes/demo/strapi_.$articleId.tsx +78 -0
  28. package/add-ons/strapi/info.json +18 -0
  29. package/add-ons/strapi/package.json +5 -0
  30. package/add-ons/strapi/small-logo.svg +8 -0
  31. package/package.json +2 -2
  32. package/project/base/src/components/Header.tsx.ejs +160 -11
  33. package/project/base/src/routes/__root.tsx.ejs +5 -0
  34. package/tests/snapshots/solid/solid-cr-ts-start-npm.json +5 -5
  35. package/tests/snapshots/solid/solid-fr-ts-npm.json +1 -1
  36. package/tests/snapshots/solid/solid-fr-ts-tw-npm.json +1 -1
@@ -0,0 +1,43 @@
1
+ import { mutation, query } from './_generated/server'
2
+ import { v } from 'convex/values'
3
+
4
+ export const list = query({
5
+ args: {},
6
+ handler: async (ctx) => {
7
+ return await ctx.db
8
+ .query('todos')
9
+ .withIndex('by_creation_time')
10
+ .order('desc')
11
+ .collect()
12
+ },
13
+ })
14
+
15
+ export const add = mutation({
16
+ args: { text: v.string() },
17
+ handler: async (ctx, args) => {
18
+ return await ctx.db.insert('todos', {
19
+ text: args.text,
20
+ completed: false,
21
+ })
22
+ },
23
+ })
24
+
25
+ export const toggle = mutation({
26
+ args: { id: v.id('todos') },
27
+ handler: async (ctx, args) => {
28
+ const todo = await ctx.db.get(args.id)
29
+ if (!todo) {
30
+ throw new Error('Todo not found')
31
+ }
32
+ return await ctx.db.patch(args.id, {
33
+ completed: !todo.completed,
34
+ })
35
+ },
36
+ })
37
+
38
+ export const remove = mutation({
39
+ args: { id: v.id('todos') },
40
+ handler: async (ctx, args) => {
41
+ return await ctx.db.delete(args.id)
42
+ },
43
+ })
@@ -0,0 +1,25 @@
1
+ {
2
+ /* This TypeScript project config describes the environment that
3
+ * Convex functions run in and is used to typecheck them.
4
+ * You can modify it, but some settings are required to use Convex.
5
+ */
6
+ "compilerOptions": {
7
+ /* These settings are not required by Convex and can be modified. */
8
+ "allowJs": true,
9
+ "strict": true,
10
+ "moduleResolution": "Bundler",
11
+ "jsx": "react-jsx",
12
+ "skipLibCheck": true,
13
+ "allowSyntheticDefaultImports": true,
14
+
15
+ /* These compiler options are required by Convex */
16
+ "target": "ESNext",
17
+ "lib": ["ES2021", "dom"],
18
+ "forceConsistentCasingInFileNames": true,
19
+ "module": "ESNext",
20
+ "isolatedModules": true,
21
+ "noEmit": true
22
+ },
23
+ "include": ["./**/*"],
24
+ "exclude": ["./_generated"]
25
+ }
@@ -0,0 +1,12 @@
1
+ import { setupConvex, ConvexProvider } from 'convex-solidjs'
2
+ import type { JSXElement } from 'solid-js'
3
+
4
+ const CONVEX_URL = (import.meta as any).env.VITE_CONVEX_URL
5
+ if (!CONVEX_URL) {
6
+ console.error('missing envar CONVEX_URL')
7
+ }
8
+ const client = setupConvex(CONVEX_URL)
9
+
10
+ export default function AppConvexProvider(props: { children: JSXElement }) {
11
+ return <ConvexProvider client={client}>{props.children}</ConvexProvider>
12
+ }
@@ -0,0 +1,169 @@
1
+ import { createFileRoute } from '@tanstack/solid-router'
2
+ import { Trash2, Plus, Check, Circle } from 'lucide-solid'
3
+
4
+ import { api } from '../../../convex/_generated/api'
5
+ import type { Id } from '../../../convex/_generated/dataModel'
6
+ import { createSignal, For, Show } from 'solid-js'
7
+ import { useMutation, useQuery } from 'convex-solidjs'
8
+
9
+ export const Route = createFileRoute('/demo/convex')({
10
+ ssr: false,
11
+ component: ConvexTodos,
12
+ })
13
+
14
+ function ConvexTodos() {
15
+ const todos = useQuery(api.todos.list, () => ({}))
16
+ const addTodo = useMutation(api.todos.add)
17
+ const toggleTodo = useMutation(api.todos.toggle)
18
+ const removeTodo = useMutation(api.todos.remove)
19
+
20
+ const [newTodo, setNewTodo] = createSignal('')
21
+
22
+ const handleAddTodo = async () => {
23
+ if (newTodo().trim()) {
24
+ await addTodo.mutate({ text: newTodo().trim() })
25
+ setNewTodo('')
26
+ }
27
+ }
28
+
29
+ const handleToggleTodo = async (id: Id<'todos'>) => {
30
+ await toggleTodo.mutate({ id })
31
+ }
32
+ const handleRemoveTodo = async (id: Id<'todos'>) => {
33
+ await removeTodo.mutate({ id })
34
+ }
35
+
36
+ const completedCount = () =>
37
+ todos?.data()?.filter((todo) => todo.completed).length || 0
38
+ const totalCount = () => todos?.data()?.length || 0
39
+
40
+ return (
41
+ <div
42
+ class="min-h-screen flex items-center justify-center p-4"
43
+ style={{
44
+ background:
45
+ 'linear-gradient(135deg, #667a56 0%, #8fbc8f 25%, #90ee90 50%, #98fb98 75%, #f0fff0 100%)',
46
+ }}
47
+ >
48
+ <div class="w-full max-w-2xl">
49
+ {/* Header Card */}
50
+ <div class="bg-white/95 backdrop-blur-sm rounded-2xl shadow-2xl border border-green-200/50 p-8 mb-6">
51
+ <div class="text-center">
52
+ <h1 class="text-4xl font-bold text-green-800 mb-2">Convex Todos</h1>
53
+ <p class="text-green-600 text-lg">Powered by real-time sync</p>
54
+ <Show when={totalCount() > 0}>
55
+ <div class="mt-4 flex justify-center space-x-6 text-sm">
56
+ <span class="text-green-700 font-medium">
57
+ {completedCount()} completed
58
+ </span>
59
+ <span class="text-gray-600">
60
+ {totalCount() - completedCount()} remaining
61
+ </span>
62
+ </div>
63
+ </Show>
64
+ </div>
65
+ </div>
66
+
67
+ {/* Add Todo Card */}
68
+ <div class="bg-white/95 backdrop-blur-sm rounded-2xl shadow-xl border border-green-200/50 p-6 mb-6">
69
+ <div class="flex gap-3">
70
+ <input
71
+ type="text"
72
+ value={newTodo()}
73
+ onInput={(e) => setNewTodo(e.target.value)}
74
+ onKeyDown={(e) => {
75
+ if (e.key === 'Enter') {
76
+ handleAddTodo()
77
+ }
78
+ }}
79
+ placeholder="What needs to be done?"
80
+ class="flex-1 px-4 py-3 rounded-xl border-2 border-green-200 focus:border-green-400 focus:outline-none text-gray-800 placeholder-gray-500 bg-white/80 transition-colors"
81
+ />
82
+ <button
83
+ onClick={handleAddTodo}
84
+ disabled={!newTodo().trim()}
85
+ class="bg-gradient-to-r from-green-500 to-green-600 hover:from-green-600 hover:to-green-700 disabled:from-gray-300 disabled:to-gray-400 disabled:cursor-not-allowed text-white font-semibold py-3 px-6 rounded-xl transition-all duration-200 flex items-center gap-2 shadow-lg hover:shadow-xl"
86
+ >
87
+ <Plus size={20} />
88
+ Add
89
+ </button>
90
+ </div>
91
+ </div>
92
+
93
+ {/* Todos List */}
94
+ <div class="bg-white/95 backdrop-blur-sm rounded-2xl shadow-xl border border-green-200/50 overflow-hidden">
95
+ <Show when={todos.isLoading()}>
96
+ <div class="p-8 text-center">
97
+ <div class="animate-spin rounded-full h-8 w-8 border-b-2 border-green-500 mx-auto mb-4"></div>
98
+ <p class="text-green-600">Loading todos...</p>
99
+ </div>
100
+ </Show>
101
+ <Show
102
+ when={todos.data()?.length !== 0}
103
+ fallback={
104
+ <div class="p-12 text-center">
105
+ <Circle size={48} class="text-green-300 mx-auto mb-4" />
106
+ <h3 class="text-xl font-semibold text-green-800 mb-2">
107
+ No todos yet
108
+ </h3>
109
+ <p class="text-green-600">
110
+ Add your first todo above to get started!
111
+ </p>
112
+ </div>
113
+ }
114
+ >
115
+ <div class="divide-y divide-green-100">
116
+ <For each={todos.data()}>
117
+ {(todo, index) => (
118
+ <div
119
+ class={`p-4 flex items-center gap-4 hover:bg-green-50/50 transition-colors ${
120
+ todo.completed ? 'opacity-75' : ''
121
+ }`}
122
+ style={{
123
+ 'animation-delay': `${index() * 50}ms`,
124
+ }}
125
+ >
126
+ <button
127
+ onClick={() => handleToggleTodo(todo._id)}
128
+ class={`flex-shrink-0 w-6 h-6 rounded-full border-2 flex items-center justify-center transition-all duration-200 ${
129
+ todo.completed
130
+ ? 'bg-green-500 border-green-500 text-white'
131
+ : 'border-green-300 hover:border-green-400 text-transparent hover:text-green-400'
132
+ }`}
133
+ >
134
+ <Check size={14} />
135
+ </button>
136
+
137
+ <span
138
+ class={`flex-1 text-lg transition-all duration-200 ${
139
+ todo.completed
140
+ ? 'line-through text-gray-500'
141
+ : 'text-gray-800'
142
+ }`}
143
+ >
144
+ {todo.text}
145
+ </span>
146
+
147
+ <button
148
+ onClick={() => handleRemoveTodo(todo._id)}
149
+ class="flex-shrink-0 p-2 text-red-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors"
150
+ >
151
+ <Trash2 size={18} />
152
+ </button>
153
+ </div>
154
+ )}
155
+ </For>
156
+ </div>
157
+ </Show>
158
+ </div>
159
+
160
+ {/* Footer */}
161
+ <div class="text-center mt-6">
162
+ <p class="text-green-700/80 text-sm">
163
+ Built with Convex • Real-time updates • Always in sync
164
+ </p>
165
+ </div>
166
+ </div>
167
+ </div>
168
+ )
169
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "Convex",
3
+ "description": "Add the Convex database to your application.",
4
+ "link": "https://convex.dev",
5
+ "phase": "add-on",
6
+ "type": "add-on",
7
+ "modes": ["file-router"],
8
+ "routes": [
9
+ {
10
+ "url": "/demo/convex",
11
+ "name": "Convex",
12
+ "path": "src/routes/demo.convex.tsx",
13
+ "jsName": "ConvexDemo"
14
+ }
15
+ ],
16
+ "integrations": [
17
+ {
18
+ "type": "provider",
19
+ "path": "src/integrations/convex/provider.tsx",
20
+ "jsName": "ConvexProvider"
21
+ }
22
+ ]
23
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "dependencies": {
3
+ "convex-solidjs": "^0.0.3",
4
+ "convex": "^1.27.3",
5
+ "lucide-solid": "^0.544.0"
6
+ }
7
+ }
@@ -0,0 +1,5 @@
1
+ <svg width="184" height="188" viewBox="0 0 184 188" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M108.092 130.021C126.258 128.003 143.385 118.323 152.815 102.167C148.349 142.128 104.653 167.385 68.9858 151.878C65.6992 150.453 62.8702 148.082 60.9288 145.034C52.9134 132.448 50.2786 116.433 54.0644 101.899C64.881 120.567 86.8748 132.01 108.092 130.021Z" fill="#F3B01C"/>
3
+ <path d="M53.4012 90.1735C46.0375 107.191 45.7186 127.114 54.7463 143.51C22.9759 119.608 23.3226 68.4578 54.358 44.7949C57.2286 42.6078 60.64 41.3097 64.2178 41.1121C78.9312 40.336 93.8804 46.0225 104.364 56.6193C83.0637 56.831 62.318 70.4756 53.4012 90.1735Z" fill="#8D2676"/>
4
+ <path d="M114.637 61.8552C103.89 46.8701 87.0686 36.6684 68.6387 36.358C104.264 20.1876 148.085 46.4045 152.856 85.1654C153.3 88.7635 152.717 92.4322 151.122 95.6775C144.466 109.195 132.124 119.679 117.702 123.559C128.269 103.96 126.965 80.0151 114.637 61.8552Z" fill="#EE342F"/>
5
+ </svg>
@@ -0,0 +1 @@
1
+ <svg height="660" viewBox="0 0 3178 660" width="3178" xmlns="http://www.w3.org/2000/svg"><g fill="#fff" transform="translate(.9778)"><g transform="translate(740.0222 38)"><path d="m101.695801 467h101.445312v-264.858398h90.917969v-80.390625h-283.28125v80.390625h90.917969z"/><path d="m241.544434 467h106.708984l68.666992-262.944336h33.017578v-82.304687h-95.703125zm70.820312-68.666992h211.025391l-21.054688-71.538086h-168.916015zm175.136719 68.666992h106.708984l-112.690429-345.249023h-62.685547v82.304687z"/><path d="m600.313965 467h101.445312v-179.443359h41.391602l-66.274414-38.759766 149.536133 218.203125h83.500976v-345.249023h-101.445312v176.572265h-41.391602l66.513672 38.759766-148.818359-215.332031h-84.458008z"/><path d="m1072.01318 473.220703c31.74154 0 58.85743-4.74528 81.34766-14.23584s39.67692-22.96875 51.56006-40.43457 17.82471-38.081869 17.82471-61.848145v-.239257c0-18.66211-3.94776-34.572754-11.84327-47.731934-7.8955-13.15918-19.89827-23.965658-36.0083-32.419434-16.11002-8.453776-36.52669-14.913737-61.25-19.379882l-34.69238-6.220703c-17.22656-3.190105-29.74772-6.898601-37.56348-11.125489-7.81575-4.226888-11.72363-10.248209-11.72363-18.063965v-.239257c0-5.263672 1.59505-10.008952 4.78516-14.23584 3.1901-4.226888 7.93538-7.576498 14.23584-10.048828 6.30045-2.472331 14.07633-3.708497 23.32763-3.708497 9.25131 0 17.5057 1.276042 24.76319 3.828126 7.25748 2.552083 13.07942 6.101074 17.46582 10.646972 4.38639 4.545899 6.8986 10.008952 7.53662 16.38916l.23926 2.392578h93.31054l-.23925-5.263671c-.95704-21.533204-7.01823-40.235189-18.1836-56.105957-11.16536-15.870769-27.27539-28.112793-48.33008-36.726075-21.05468-8.613281-46.97428-12.919922-77.75879-12.919922-27.27539 0-51.59993 4.625651-72.973628 13.876954-21.373698 9.251302-38.161621 22.330729-50.36377 39.238281-12.202148 16.907552-18.303222 36.925456-18.303222 60.053711v.239258c0 26.796875 9.131673 48.728841 27.395019 65.795898s44.541831 28.631185 78.835451 34.692383l34.69238 6.220703c19.14063 3.509115 32.61882 7.33724 40.43457 11.484375 7.81576 4.147135 11.72363 10.288086 11.72363 18.422852v.239257c0 5.742188-1.99381 10.846354-5.98144 15.3125s-9.61019 7.975261-16.86768 10.527344c-7.25748 2.552083-15.99039 3.828125-26.19873 3.828125-9.57031 0-18.3431-1.315918-26.31836-3.947754s-14.59472-6.260579-19.8584-10.88623c-5.26367-4.625651-8.61328-10.048828-10.04882-16.269532l-.47852-2.15332h-93.310546l.239258 4.545899c1.276042 22.649739 8.015137 41.909993 20.217285 57.780761 12.202149 15.870769 29.189453 27.953288 50.961914 36.247559 21.772459 8.294271 47.572429 12.441406 77.399899 12.441406z"/><path d="m1303.73682 467h101.44531v-264.858398h90.91797v-80.390625h-283.28125v80.390625h90.91797z"/><path d="m1443.58545 467h106.70898l68.667-262.944336h33.01757v-82.304687h-95.70312zm70.82031-68.666992h211.02539l-21.05469-71.538086h-168.91601zm175.13672 68.666992h106.70898l-112.69042-345.249023h-62.68555v82.304687z"/><path d="m1941.12451 473.220703c31.74154 0 59.65495-6.300456 83.74024-18.901367 24.08528-12.600912 42.94677-29.667969 56.58447-51.201172 13.63769-21.533203 20.45654-45.777995 20.45654-72.734375v-2.631836h-97.13867l-.23926 2.631836c-1.11653 12.122396-4.46614 22.689616-10.04883 31.70166-5.58268 9.012044-12.91992 15.990397-22.01171 20.935059-9.0918 4.944661-19.45964 7.416992-31.10352 7.416992-13.87695 0-25.9196-3.748372-36.12793-11.245117s-18.06396-18.462728-23.56689-32.897949c-5.50293-14.435222-8.2544-31.861166-8.2544-52.277832v-.239258c0-20.257162 2.75147-37.483724 8.2544-51.679688 5.50293-14.195963 13.31868-25.042317 23.44726-32.539062s22.13135-11.245117 36.0083-11.245117c12.60091 0 23.40739 2.591959 32.41944 7.775878 9.01204 5.18392 16.11002 12.281902 21.29394 21.293946s8.2544 19.260254 9.21143 30.744629l.23925 2.871093h97.13868v-2.15332c0-27.115885-6.69922-51.480306-20.09766-73.093262-13.39844-21.612955-32.10042-38.719889-56.10596-51.3208-24.00553-12.600912-52.03857-18.901368-84.09912-18.901368-35.09114 0-65.43701 6.978353-91.0376 20.935059-25.60058 13.956706-45.33935 34.213867-59.2163 60.771484-13.87696 26.557618-20.81543 58.817546-20.81543 96.779786v.239257c0 37.96224 6.8986 70.262045 20.6958 96.899414 13.7972 26.63737 33.49609 46.974284 59.09668 61.010743 25.60058 14.036458 56.0262 21.054687 91.27685 21.054687z"/><path d="m2214.23975 379.670898 75.36621-101.445312h26.0791l116.04004-156.474609h-106.46973l-106.70898 146.425781h-4.30664zm-99.05274 87.329102h101.44531v-345.249023h-101.44531zm203.84766 0h117.9541l-140.20508-226.577148-74.16992 64.121093z"/></g><path d="m305.114318.62443771c8.717817-1.14462121 17.926803-.36545135 26.712694-.36545135 32.548987 0 64.505987 5.05339923 95.64868 14.63098274 39.74418 12.2236582 76.762804 31.7666864 109.435876 57.477568 40.046637 31.5132839 73.228974 72.8472109 94.520714 119.2362609 39.836383 86.790386 39.544267 191.973146-1.268422 278.398081-26.388695 55.880442-68.724007 102.650458-119.964986 136.75724-41.808813 27.828603-90.706831 44.862601-140.45707 50.89341-63.325458 7.677926-131.784923-3.541603-188.712259-32.729444-106.868873-54.795293-179.52309291-165.076271-180.9604082-285.932068-.27660564-23.300971.08616998-46.74071 4.69884909-69.814998 7.51316071-37.57857 20.61272131-73.903917 40.28618971-106.877282 21.2814003-35.670293 48.7704861-67.1473767 81.6882804-92.5255597 38.602429-29.7610135 83.467691-51.1674988 130.978372-62.05777669 11.473831-2.62966514 22.9946-4.0869914 34.57273-5.4964306l3.658171-.44480576c3.050084-.37153079 6.104217-.74794222 9.162589-1.14972654zm-110.555861 549.44131429c-14.716752 1.577863-30.238964 4.25635-42.869928 12.522173 2.84343.683658 6.102369.004954 9.068638 0 7.124652-.011559 14.317732-.279903 21.434964.032202 17.817402.781913 36.381729 3.63214 53.58741 8.350042 22.029372 6.040631 41.432961 17.928687 62.656049 25.945156 22.389644 8.456554 44.67706 11.084675 68.427 11.084675 11.96813 0 23.845573-.035504 35.450133-3.302696-6.056202-3.225083-14.72582-2.619864-21.434964-3.963236-14.556814-2.915455-28.868774-6.474936-42.869928-11.470264-10.304996-3.676672-20.230803-8.214291-30.11097-12.848661l-6.348531-2.985046c-9.1705-4.309263-18.363277-8.560752-27.845391-12.142608-24.932161-9.418465-52.560181-14.071964-79.144482-11.221737zm22.259385-62.614168c-29.163917 0-58.660076 5.137344-84.915434 18.369597-6.361238 3.206092-12.407546 7.02566-18.137277 11.258891-1.746125 1.290529-4.841829 2.948483-5.487351 5.191839-.654591 2.275558 1.685942 4.182039 3.014086 5.637703 6.562396-3.497556 12.797498-7.199878 19.78612-9.855246 45.19892-17.169893 99.992458-13.570779 145.098218 2.172348 22.494346 7.851335 43.219483 19.592421 65.129314 28.800338 24.503461 10.297807 49.53043 16.975034 75.846795 20.399104 31.04195 4.037546 66.433549.7654 94.808495-13.242161 9.970556-4.921843 23.814245-12.422267 28.030337-23.320339-5.207047.454947-9.892236 2.685918-14.83959 4.224149-7.866632 2.445646-15.827248 4.51974-23.908229 6.138887-27.388113 5.486604-56.512458 6.619429-84.091013 1.639788-25.991939-4.693152-50.142596-14.119246-74.179513-24.03502l-3.068058-1.268177c-2.045137-.846788-4.089983-1.695816-6.135603-2.544467l-3.069142-1.272366c-12.279956-5.085721-24.606928-10.110797-37.210937-14.51024-24.485325-8.546552-50.726667-13.784628-76.671218-13.784628zm51.114145-447.9909432c-34.959602 7.7225298-66.276908 22.7605319-96.457338 41.7180089-17.521434 11.0054099-34.281927 22.2799893-49.465301 36.4444283-22.5792616 21.065423-39.8360564 46.668751-54.8866988 73.411509-15.507372 27.55357-25.4498976 59.665686-30.2554517 90.824149-4.7140432 30.568106-5.4906485 62.70747-.0906864 93.301172 6.7503648 38.248526 19.5989769 74.140579 39.8896436 107.337631 6.8187918-3.184625 11.659796-10.445603 17.3128555-15.336896 11.4149428-9.875888 23.3995608-19.029311 36.2745548-26.928535 4.765981-2.923712 9.662222-5.194315 14.83959-7.275014 1.953055-.785216 5.14604-1.502727 6.06527-3.647828 1.460876-3.406732-1.240754-9.335897-1.704904-12.865654-1.324845-10.095517-2.124534-20.362774-1.874735-30.549941.725492-29.668947 6.269727-59.751557 16.825623-87.521453 7.954845-20.924233 20.10682-39.922168 34.502872-56.971512 4.884699-5.785498 10.077731-11.170545 15.437296-16.512656 3.167428-3.157378 7.098271-5.858983 9.068639-9.908915-10.336599.006606-20.674847 2.987289-30.503603 6.013385-21.174447 6.519522-41.801477 16.19312-59.358362 29.841512-8.008432 6.226409-13.873368 14.387371-21.44733 20.939921-2.32322 2.010516-6.484901 4.704691-9.695199 3.187928-4.8500728-2.29042-4.1014979-11.835213-4.6571581-16.222019-2.1369011-16.873476 4.2548401-38.216325 12.3778671-52.843142 13.039878-23.479694 37.150915-43.528712 65.467327-42.82854 12.228647.302197 22.934587 4.551115 34.625711 7.324555-2.964621-4.211764-6.939158-7.28162-10.717482-10.733763-9.257431-8.459031-19.382979-16.184864-30.503603-22.028985-4.474136-2.350694-9.291232-3.77911-14.015169-5.506421-2.375159-.867783-5.36616-2.062533-6.259834-4.702213-1.654614-4.888817 7.148561-9.416813 10.381943-11.478522 12.499882-7.969406 27.826705-14.525258 42.869928-14.894334 23.509209-.577147 46.479246 12.467678 56.162903 34.665926 3.404469 7.803171 4.411273 16.054969 5.079109 24.382907l.121749 1.56229.174325 2.345587c.01913.260708.038244.521433.057403.782164l.11601 1.56437.120128 1.563971c7.38352-6.019164 12.576553-14.876995 19.78612-21.323859 16.861073-15.07846 39.936636-21.7722 61.831627-14.984333 19.786945 6.133107 36.984382 19.788105 47.105807 37.959541 2.648042 4.754231 10.035685 16.373942 4.698379 21.109183-4.177345 3.707277-9.475079.818243-13.880788-.719162-3.33605-1.16376-6.782939-1.90214-10.241828-2.585698l-1.887262-.369639c-.629089-.122886-1.257979-.246187-1.886079-.372129-11.980496-2.401886-25.91652-2.152533-37.923398-.041284-7.762754 1.364839-15.349083 4.127545-23.083807 5.271929v1.651348c21.149714.175043 41.608563 12.240618 52.043268 30.549941 4.323267 7.585468 6.482428 16.267431 8.138691 24.770223 2.047864 10.50918.608423 21.958802-2.263037 32.201289-.962925 3.433979-2.710699 9.255807-6.817143 10.046802-2.902789.558982-5.36781-2.330878-7.024898-4.279468-4.343878-5.10762-8.475879-9.96341-13.573278-14.374161-12.895604-11.157333-26.530715-21.449361-40.396663-31.373138-7.362086-5.269452-15.425755-12.12007-23.908229-15.340199 2.385052 5.745041 4.721463 11.086326 5.532694 17.339156 2.385876 18.392716-5.314223 35.704625-16.87179 49.540445-3.526876 4.222498-7.29943 8.475545-11.744712 11.755948-1.843407 1.360711-4.156734 3.137561-6.595373 2.752797-7.645687-1.207961-8.555849-12.73272-9.728176-18.637115-3.970415-19.998652-2.375984-39.861068 3.132802-59.448534-4.901187 2.485279-8.443727 7.923994-11.521293 12.385111-6.770975 9.816439-12.645804 20.199291-16.858599 31.375615-16.777806 44.519521-16.616219 96.664142 5.118834 139.523233 2.427098 4.786433 6.110614 4.144058 10.894733 4.144058.720854 0 1.44257-.004515 2.164851-.010924l2.168232-.022283c4.338648-.045438 8.686803-.064635 12.979772.508795 2.227588.297243 5.320818.032202 7.084256 1.673642 2.111344 1.966755.986008 5.338808.4996 7.758859-1.358647 6.765574-1.812904 12.914369-1.812904 19.816178 9.02412-1.398692 11.525415-15.866153 14.724172-23.118874 3.624982-8.216283 7.313444-16.440823 10.667192-24.770223 1.648843-4.093692 3.854171-8.671229 3.275427-13.210785-.649644-5.10184-4.335633-10.510831-6.904531-14.862134-4.86244-8.234447-10.389363-16.70834-13.969002-25.595896-2.861567-7.104926-.197036-15.983399 7.871579-18.521521 4.450228-1.400344 9.198073 1.345848 12.094266 4.562675 6.07269 6.74328 9.992815 16.777697 14.401823 24.692609l34.394873 61.925556c2.920926 5.243856 5.848447 10.481933 8.836976 15.687808 1.165732 2.031158 2.352075 5.167068 4.740424 6.0332 2.127008.77118 5.033095-.325315 7.148561-.748886 5.492297-1.099798 10.97635-2.287117 16.488434-3.28288 6.605266-1.193099 16.673928-.969342 21.434964-6.129805-6.963066-2.205375-15.011895-2.074919-22.259386-1.577863-4.352947.298894-9.178287 1.856116-13.178381-.686135-5.953149-3.783239-9.910373-12.522173-13.552668-18.377854-8.980425-14.439388-17.441465-29.095929-26.041008-43.760726l-1.376261-2.335014-2.765943-4.665258c-1.380597-2.334387-2.750786-4.67476-4.079753-7.036188-1.02723-1.826391-2.549937-4.233231-1.078344-6.24705 1.545791-2.114476 4.91472-2.239146 7.956473-2.243117l.603351.000261c1.195428.001526 2.315572.002427 3.222811-.11692 12.27399-1.615019 24.718635-2.952611 37.098976-2.952611-.963749-3.352237-3.719791-7.141255-2.838484-10.73046 1.972017-8.030506 13.526287-10.543033 18.899867-4.780653 3.60767 3.868283 5.704174 9.192229 8.051303 13.859765 3.097352 6.162006 6.624228 12.118418 9.940876 18.16483 5.805578 10.585967 12.146205 20.881297 18.116667 31.375615.49237.865561.999687 1.726685 1.512269 2.587098l.771613 1.290552c2.577138 4.303168 5.164895 8.635123 6.553094 13.461506-20.735854-.9487-36.30176-25.018751-45.343193-41.283704-.721369 2.604176.450959 4.928448 1.388326 7.431066 1.948109 5.197619 4.276275 10.147535 7.20627 14.862134 4.184765 6.732546 8.982075 13.665732 15.313633 18.553722 11.236043 8.673707 26.05255 8.721596 39.572241 7.794364 8.669619-.595311 19.50252-4.542034 28.030338-1.864372 8.513803 2.673532 11.940924 12.063098 6.884745 19.276187-3.787393 5.403211-8.842747 7.443452-15.128962 8.257566 4.445282 9.53571 10.268996 18.385285 14.490036 28.072919 1.758491 4.035895 3.59118 10.22102 7.8048 12.350433 2.805507 1.416857 6.824562.09743 9.85761.034678-3.043765-8.053625-8.742992-14.887729-11.541904-23.118874 8.533589.390544 16.786875 4.843404 24.732651 7.685374 15.630376 5.590144 31.063836 11.701854 46.475333 17.86913l7.112077 2.848685c6.338978 2.538947 12.71588 5.052299 18.961699 7.812528 2.285297 1.009799 5.449427 3.370401 7.975455 1.917215 2.061054-1.186494 3.394144-4.015253 4.665403-5.931643 3.55573-5.361927 6.775921-10.928622 9.965609-16.513481 12.774414-22.36586 22.143967-46.872692 28.402976-71.833646 20.645168-82.323009 2.934117-173.156241-46.677107-241.922507-19.061454-26.420745-43.033164-49.262193-69.46165-68.1783861-66.13923-47.336721-152.911262-66.294198-232.486917-48.7172481zm135.205158 410.5292842c-17.532977 4.570931-35.601827 8.714164-53.58741 11.040088 2.365265 8.052799 8.145286 15.885969 12.376218 23.118874 1.635653 2.796558 3.3859 6.541816 6.618457 7.755557 3.651364 1.370619 8.063669-.853747 11.508927-1.975838-1.595256-4.364513-4.279573-8.292245-6.476657-12.385112-.905215-1.687677-2.305907-3.685809-1.559805-5.68972 1.410585-3.786541 7.266452-3.563609 10.509727-4.221671 8.54678-1.733916 17.004522-3.898008 25.557073-5.611281 3.150939-.631641 7.538512-2.342438 10.705115-1.285575 2.371037.791232 3.800147 2.744743 5.152304 4.781948l.606196.918752c.80912 1.222827 1.637246 2.41754 2.671212 3.351165 3.457625 3.121874 8.628398 3.60159 13.017619 4.453686-2.678546-6.027421-7.130424-11.301001-9.984571-17.339156-1.659561-3.511592-3.023155-8.677834-6.656381-10.707341-5.005064-2.795733-15.341663 2.461334-20.458024 3.795624zm-110.472507-40.151706c-.825246 10.467897-4.036369 18.984725-9.068639 28.072919 5.76683.729896 11.649079.989984 17.312856 2.39363 4.244947 1.051908 8.156828 3.058296 12.366325 4.211763-2.250671-6.157877-6.426367-11.651913-9.661398-17.339156-3.266358-5.740912-6.189758-12.717032-10.949144-17.339156z"/></g></svg>
@@ -3,8 +3,6 @@ import { createRouter } from '@tanstack/solid-router'
3
3
  // Import the generated route tree
4
4
  import { routeTree } from './routeTree.gen'
5
5
 
6
- import './styles.css'
7
-
8
6
  // Create a new router instance
9
7
  export const getRouter = () => {
10
8
  const router = createRouter({
@@ -0,0 +1,154 @@
1
+ import { createFileRoute } from "@tanstack/solid-router";
2
+ <% if (!tailwind) { %>
3
+ import logo from "../logo.svg";
4
+ import "../App.css";
5
+ <% } else { %>
6
+ import {
7
+ Zap,
8
+ Server,
9
+ Route as RouteIcon,
10
+ Shield,
11
+ Waves,
12
+ Sparkles,
13
+ } from "lucide-solid";
14
+ <% } %>
15
+
16
+ export const Route = createFileRoute("/")({
17
+ component: App,
18
+ });
19
+
20
+ function App() {
21
+ <% if (tailwind) { %>
22
+ const features = [
23
+ {
24
+ icon: <Zap class="w-12 h-12 text-cyan-400" />,
25
+ title: "Powerful Server Functions",
26
+ description:
27
+ "Write server-side code that seamlessly integrates with your client components. Type-safe, secure, and simple.",
28
+ },
29
+ {
30
+ icon: <Server class="w-12 h-12 text-cyan-400" />,
31
+ title: "Flexible Server Side Rendering",
32
+ description:
33
+ "Full-document SSR, streaming, and progressive enhancement out of the box. Control exactly what renders where.",
34
+ },
35
+ {
36
+ icon: <RouteIcon class="w-12 h-12 text-cyan-400" />,
37
+ title: "API Routes",
38
+ description:
39
+ "Build type-safe API endpoints alongside your application. No separate backend needed.",
40
+ },
41
+ {
42
+ icon: <Shield class="w-12 h-12 text-cyan-400" />,
43
+ title: "Strongly Typed Everything",
44
+ description:
45
+ "End-to-end type safety from server to client. Catch errors before they reach production.",
46
+ },
47
+ {
48
+ icon: <Waves class="w-12 h-12 text-cyan-400" />,
49
+ title: "Full Streaming Support",
50
+ description:
51
+ "Stream data from server to client progressively. Perfect for AI applications and real-time updates.",
52
+ },
53
+ {
54
+ icon: <Sparkles class="w-12 h-12 text-cyan-400" />,
55
+ title: "Next Generation Ready",
56
+ description:
57
+ "Built from the ground up for modern web applications. Deploy anywhere JavaScript runs.",
58
+ },
59
+ ];
60
+
61
+ return (
62
+ <div class="min-h-screen bg-gradient-to-b from-slate-900 via-slate-800 to-slate-900">
63
+ <section class="relative py-20 px-6 text-center overflow-hidden">
64
+ <div class="absolute inset-0 bg-gradient-to-r from-cyan-500/10 via-blue-500/10 to-purple-500/10"></div>
65
+ <div class="relative max-w-5xl mx-auto">
66
+ <div class="flex items-center justify-center gap-6 mb-6">
67
+ <img
68
+ src="/tanstack-circle-logo.png"
69
+ alt="TanStack Logo"
70
+ class="w-24 h-24 md:w-32 md:h-32"
71
+ />
72
+ <h1 class="text-6xl md:text-7xl font-bold text-white">
73
+ <span class="text-gray-300">TANSTACK</span>{" "}
74
+ <span class="bg-gradient-to-r from-cyan-400 to-blue-400 bg-clip-text text-transparent">
75
+ START
76
+ </span>
77
+ </h1>
78
+ </div>
79
+ <p class="text-2xl md:text-3xl text-gray-300 mb-4 font-light">
80
+ The framework for next generation AI applications
81
+ </p>
82
+ <p class="text-lg text-gray-400 max-w-3xl mx-auto mb-8">
83
+ Full-stack framework powered by TanStack Router for React and Solid.
84
+ Build modern applications with server functions, streaming, and type
85
+ safety.
86
+ </p>
87
+ <div class="flex flex-col items-center gap-4">
88
+ <a
89
+ href="https://tanstack.com/start"
90
+ target="_blank"
91
+ rel="noopener noreferrer"
92
+ class="px-8 py-3 bg-cyan-500 hover:bg-cyan-600 text-white font-semibold rounded-lg transition-colors shadow-lg shadow-cyan-500/50"
93
+ >
94
+ Documentation
95
+ </a>
96
+ <p class="text-gray-400 text-sm mt-2">
97
+ Begin your TanStack Start journey by editing{" "}
98
+ <code class="px-2 py-1 bg-slate-700 rounded text-cyan-400">
99
+ /src/routes/index.tsx
100
+ </code>
101
+ </p>
102
+ </div>
103
+ </div>
104
+ </section>
105
+
106
+ <section class="py-16 px-6 max-w-7xl mx-auto">
107
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
108
+ {features.map((feature, index) => (
109
+ <div
110
+ key={index}
111
+ class="bg-slate-800/50 backdrop-blur-sm border border-slate-700 rounded-xl p-6 hover:border-cyan-500/50 transition-all duration-300 hover:shadow-lg hover:shadow-cyan-500/10"
112
+ >
113
+ <div class="mb-4">{feature.icon}</div>
114
+ <h3 class="text-xl font-semibold text-white mb-3">
115
+ {feature.title}
116
+ </h3>
117
+ <p class="text-gray-400 leading-relaxed">
118
+ {feature.description}
119
+ </p>
120
+ </div>
121
+ ))}
122
+ </div>
123
+ </section>
124
+ </div>
125
+ );
126
+ <% } else { %>
127
+ return (
128
+ <div class="App">
129
+ <header class="App-header">
130
+ <img src={logo} class="App-logo" alt="logo" />
131
+ <p>
132
+ Edit <code>src/routes/index.tsx</code> and save to reload.
133
+ </p>
134
+ <a
135
+ class="App-link"
136
+ href="https://www.solidjs.com/"
137
+ target="_blank"
138
+ rel="noopener noreferrer"
139
+ >
140
+ Learn Solid
141
+ </a>
142
+ <a
143
+ class="App-link"
144
+ href="https://tanstack.com"
145
+ target="_blank"
146
+ rel="noopener noreferrer"
147
+ >
148
+ Learn TanStack
149
+ </a>
150
+ </header>
151
+ </div>
152
+ );
153
+ <% } %>
154
+ }
@@ -7,6 +7,7 @@
7
7
  "dependencies": {
8
8
  "@tanstack/solid-start": "^1.132.25",
9
9
  "vite": "^7.1.7",
10
- "vite-tsconfig-paths": "^5.1.4"
10
+ "vite-tsconfig-paths": "^5.1.4",
11
+ "lucide-solid": "^0.544.0"
11
12
  }
12
- }
13
+ }
@@ -0,0 +1,14 @@
1
+ ## Setting up Strapi
2
+
3
+ The current setup shows an example of how to use Strapi with an articles collection which is part of the example structure & data.
4
+
5
+ - Create a local running copy of the strapi admin
6
+
7
+ ```bash
8
+ pnpx create-strapi@latest my-strapi-project
9
+ cd my-strapi-project
10
+ pnpm dev
11
+ ```
12
+
13
+ - Login and publish the example articles to see them on the strapi demo page.
14
+ - Set the `VITE_STRAPI_URL` environment variable in your `.env.local`. (For local it should be http://localhost:1337/api)
@@ -0,0 +1,2 @@
1
+ # Strapi configuration
2
+ VITE_STRAPI_URL="http://localhost:1337/api"
@@ -0,0 +1,7 @@
1
+ import { strapi } from "@strapi/client";
2
+
3
+ export const strapiClient = strapi({
4
+ baseURL: import.meta.env.VITE_STRAPI_URL,
5
+ });
6
+
7
+ export const articles = strapiClient.collection("articles");
@@ -0,0 +1,69 @@
1
+ import { articles } from '../../lib/strapiClient'
2
+ import { createFileRoute, Link } from '@tanstack/solid-router'
3
+ import { Show, For } from 'solid-js'
4
+
5
+ export const Route = createFileRoute('/demo/strapi')({
6
+ component: RouteComponent,
7
+ loader: async () => {
8
+ const { data: strapiArticles } = await articles.find()
9
+ return strapiArticles
10
+ },
11
+ })
12
+
13
+ function RouteComponent() {
14
+ const strapiArticles = Route.useLoaderData()
15
+
16
+ return (
17
+ <div class="min-h-screen bg-gradient-to-b from-slate-900 via-slate-800 to-slate-900 p-8">
18
+ <div class="max-w-7xl mx-auto">
19
+ <h1 class="text-4xl font-bold mb-8 text-white">
20
+ <span class="bg-gradient-to-r from-cyan-400 to-blue-400 bg-clip-text text-transparent">
21
+ Strapi
22
+ </span>{' '}
23
+ <span class="text-gray-300">Articles</span>
24
+ </h1>
25
+
26
+ <Show
27
+ when={strapiArticles() && strapiArticles().length > 0}
28
+ fallback={<p class="text-gray-400">No articles found.</p>}
29
+ >
30
+ <div class="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
31
+ <For each={strapiArticles()}>
32
+ {(article) => (
33
+ <Link
34
+ to="/demo/strapi/$articleId"
35
+ params={{ articleId: article.documentId }}
36
+ class="block"
37
+ >
38
+ <article class="bg-slate-800/50 backdrop-blur-sm border border-slate-700 rounded-xl p-6 hover:border-cyan-500/50 transition-all duration-300 hover:shadow-lg hover:shadow-cyan-500/10 cursor-pointer h-full">
39
+ <h2 class="text-xl font-semibold text-white mb-3">
40
+ {article.title || 'Untitled'}
41
+ </h2>
42
+
43
+ {article.description && (
44
+ <p class="text-gray-400 mb-4 leading-relaxed">
45
+ {article.description}
46
+ </p>
47
+ )}
48
+
49
+ {article.content && (
50
+ <p class="text-gray-400 line-clamp-3 leading-relaxed">
51
+ {article.content}
52
+ </p>
53
+ )}
54
+
55
+ {article.createdAt && (
56
+ <p class="text-sm text-cyan-400/70 mt-4">
57
+ {new Date(article.createdAt).toLocaleDateString()}
58
+ </p>
59
+ )}
60
+ </article>
61
+ </Link>
62
+ )}
63
+ </For>
64
+ </div>
65
+ </Show>
66
+ </div>
67
+ </div>
68
+ )
69
+ }