+ Hello World
+ Hello world!
+
+
+ Visit{" "}
+
+ start.solidjs.com
+ {" "}
+ to learn how to build SolidStart apps.
+
+
+ {JSON.stringify(hello(), null, 2)}
+
+
+ );
+}
diff --git a/redux/src/server/api/root.ts b/redux/src/server/api/root.ts
new file mode 100644
index 0000000..944f4ef
--- /dev/null
+++ b/redux/src/server/api/root.ts
@@ -0,0 +1,8 @@
+import { exampleRouter } from "./routers/example";
+import { createTRPCRouter } from "./utils";
+
+export const appRouter = createTRPCRouter({
+ example: exampleRouter
+});
+
+export type AppRouter = typeof appRouter;
diff --git a/redux/src/server/api/routers/example.ts b/redux/src/server/api/routers/example.ts
new file mode 100644
index 0000000..4e171b9
--- /dev/null
+++ b/redux/src/server/api/routers/example.ts
@@ -0,0 +1,11 @@
+import { wrap } from "@typeschema/valibot";
+import { string } from "valibot";
+import { createTRPCRouter, publicProcedure } from "../utils";
+
+export const exampleRouter = createTRPCRouter({
+ hello: publicProcedure
+ .input(wrap(string()))
+ .query(({ input }) => {
+ return `Hello ${input}!`;
+ })
+});
diff --git a/redux/src/server/api/utils.ts b/redux/src/server/api/utils.ts
new file mode 100644
index 0000000..c082886
--- /dev/null
+++ b/redux/src/server/api/utils.ts
@@ -0,0 +1,6 @@
+import { initTRPC } from "@trpc/server";
+
+export const t = initTRPC.create();
+
+export const createTRPCRouter = t.router;
+export const publicProcedure = t.procedure;
diff --git a/redux/src/server/db/index.ts b/redux/src/server/db/index.ts
new file mode 100644
index 0000000..ee8c1da
--- /dev/null
+++ b/redux/src/server/db/index.ts
@@ -0,0 +1,11 @@
+import { createClient } from "@libsql/client";
+import { drizzle } from "drizzle-orm/libsql";
+
+import * as schema from "./schema";
+
+const client = createClient({
+ url: process.env.DATABASE_URL ?? "file:local.db",
+ authToken: process.env.DATABASE_AUTH_TOKEN,
+});
+
+export const db = drizzle(client, { schema });
diff --git a/redux/src/server/db/schema.ts b/redux/src/server/db/schema.ts
new file mode 100644
index 0000000..4d820e1
--- /dev/null
+++ b/redux/src/server/db/schema.ts
@@ -0,0 +1,10 @@
+import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
+
+export const users = sqliteTable("users", {
+ id: integer("id").primaryKey({ autoIncrement: true }),
+ name: text("name").notNull(),
+ email: text("email").notNull().unique(),
+ createdAt: integer("created_at", { mode: "timestamp" })
+ .notNull()
+ .$defaultFn(() => new Date()),
+});
diff --git a/redux/tsconfig.json b/redux/tsconfig.json
new file mode 100644
index 0000000..7692957
--- /dev/null
+++ b/redux/tsconfig.json
@@ -0,0 +1,19 @@
+{
+ "compilerOptions": {
+ "target": "ESNext",
+ "module": "ESNext",
+ "moduleResolution": "bundler",
+ "allowSyntheticDefaultImports": true,
+ "esModuleInterop": true,
+ "jsx": "preserve",
+ "jsxImportSource": "solid-js",
+ "allowJs": true,
+ "strict": true,
+ "noEmit": true,
+ "types": ["vite/client"],
+ "isolatedModules": true,
+ "paths": {
+ "~/*": ["./src/*"]
+ }
+ }
+}
diff --git a/redux/vite.config.ts b/redux/vite.config.ts
new file mode 100644
index 0000000..95798d4
--- /dev/null
+++ b/redux/vite.config.ts
@@ -0,0 +1,12 @@
+import { defineConfig } from "vite";
+import { nitroV2Plugin as nitro } from "@solidjs/vite-plugin-nitro-2";
+import tailwindcss from "@tailwindcss/vite";
+
+import { solidStart } from "@solidjs/start/config";
+
+export default defineConfig({
+ plugins: [solidStart(),
+ tailwindcss(),
+ nitro()
+ ]
+});