diff --git a/bun.lockb b/bun.lockb
index ecc15ec..335734e 100755
Binary files a/bun.lockb and b/bun.lockb differ
diff --git a/package.json b/package.json
index fb326f9..7ef8a63 100644
--- a/package.json
+++ b/package.json
@@ -3,15 +3,19 @@
"module": "src/main.ts",
"type": "module",
"scripts": {
- "dev": "bun run --hot src/main.tsx",
- "start": "bun run src/main.tsx",
+ "dev": "concurrently \"bun run --hot src/main.tsx\" \"bun run uno:dev\"",
+ "start": "bun run uno && bun run src/main.tsx",
"db:push": "bunx drizzle-kit push:sqlite",
"db:studio": "bunx drizzle-kit studio",
- "db:seed": "bun run src/model/store/seed.ts"
+ "db:seed": "bun run src/model/store/seed.ts",
+ "uno": "bunx unocss",
+ "uno:dev": "bunx unocss --watch"
},
"devDependencies": {
"bun-types": "latest",
- "drizzle-kit": "^0.19.13"
+ "concurrently": "^8.2.1",
+ "drizzle-kit": "^0.19.13",
+ "unocss": "^0.55.7"
},
"peerDependencies": {
"typescript": "^5.0.0"
diff --git a/public/example.txt b/public/example.txt
deleted file mode 100644
index e69de29..0000000
diff --git a/src/views/base.tsx b/src/components/base.tsx
similarity index 87%
rename from src/views/base.tsx
rename to src/components/base.tsx
index 6c1549f..2c0effa 100644
--- a/src/views/base.tsx
+++ b/src/components/base.tsx
@@ -10,8 +10,8 @@ export const BaseHtml = ({ children }: Html.PropsWithChildren) => `
THE BETH STACK
-
+
${children}
diff --git a/src/views/todos.tsx b/src/components/todos.tsx
similarity index 96%
rename from src/views/todos.tsx
rename to src/components/todos.tsx
index ec83cba..7d912bf 100644
--- a/src/views/todos.tsx
+++ b/src/components/todos.tsx
@@ -1,4 +1,4 @@
-import type { Todo } from "../model/todo";
+import type { Todo } from "../db/todo";
import Html from "@kitajs/html";
export function TodoItem({ content, completed, id }: Todo) {
diff --git a/src/context/index.ts b/src/context/index.ts
index 216dfb6..37382c5 100644
--- a/src/context/index.ts
+++ b/src/context/index.ts
@@ -2,7 +2,7 @@ import { Elysia } from "elysia";
import { logger } from "@bogeychan/elysia-logger";
import pretty from "pino-pretty";
import { config } from "../config";
-import { db } from "../model/store";
+import { db } from "../db";
import "@kitajs/html/htmx";
const stream = pretty({
diff --git a/src/model/store/index.ts b/src/db/index.ts
similarity index 77%
rename from src/model/store/index.ts
rename to src/db/index.ts
index c157797..d39739b 100644
--- a/src/model/store/index.ts
+++ b/src/db/index.ts
@@ -1,7 +1,7 @@
import { drizzle } from "drizzle-orm/libsql";
import { createClient } from "@libsql/client";
-import * as schema from "../schema";
-import { config } from "../../config";
+import * as schema from "./schemas";
+import { config } from "../config";
const client = createClient({
url: config.env.DATABASE_URL!,
diff --git a/src/db/schemas/index.ts b/src/db/schemas/index.ts
new file mode 100644
index 0000000..c97aa6b
--- /dev/null
+++ b/src/db/schemas/index.ts
@@ -0,0 +1 @@
+export { todos } from "./todos";
diff --git a/src/model/todo.ts b/src/db/schemas/todos.ts
similarity index 100%
rename from src/model/todo.ts
rename to src/db/schemas/todos.ts
diff --git a/src/model/store/seed.ts b/src/db/seed.ts
similarity index 100%
rename from src/model/store/seed.ts
rename to src/db/seed.ts
diff --git a/src/main.tsx b/src/main.tsx
index 308c88e..7a7b205 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -1,15 +1,15 @@
import { Elysia } from "elysia";
import { swagger } from "@elysiajs/swagger";
import { staticPlugin } from "@elysiajs/static";
-import { todosController } from "./controllers/todos";
-import { BaseHtml } from "./views/base";
+import { todosController } from "./services/todos";
+import { BaseHtml } from "./components/base";
import Html from "@kitajs/html";
const app = new Elysia({
name: "@app/main",
})
// .use(swagger())
- // .use(staticPlugin())
+ .use(staticPlugin())
.use(todosController)
.get("/", ({ html }) =>
html(
diff --git a/src/model/schema.ts b/src/model/schema.ts
deleted file mode 100644
index 2c98c6d..0000000
--- a/src/model/schema.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { todos } from "./todo";
diff --git a/src/controllers/todos.tsx b/src/services/todos.tsx
similarity index 92%
rename from src/controllers/todos.tsx
rename to src/services/todos.tsx
index ed0f9ac..4f6df12 100644
--- a/src/controllers/todos.tsx
+++ b/src/services/todos.tsx
@@ -1,9 +1,9 @@
import Elysia, { t } from "elysia";
import { ctx } from "../context";
-import { insertTodoSchema, todos } from "../model/todo";
-import { TodoItem, TodoForm, TodoList } from "../views/todos";
+import { insertTodoSchema, todos } from "../db/schemas/todos";
+import { TodoItem, TodoForm, TodoList } from "../components/todos";
import Html from "@kitajs/html";
-import { db } from "../model/store";
+import { db } from "../db";
import { eq } from "drizzle-orm";
export const todosController = new Elysia({
diff --git a/src/lib/index.ts b/src/utils/index.ts
similarity index 100%
rename from src/lib/index.ts
rename to src/utils/index.ts
diff --git a/uno.config.ts b/uno.config.ts
new file mode 100644
index 0000000..f84f4a4
--- /dev/null
+++ b/uno.config.ts
@@ -0,0 +1,10 @@
+import { defineConfig } from "unocss";
+
+export default defineConfig({
+ cli: {
+ entry: {
+ patterns: ["src/**/*.{ts,tsx}"],
+ outFile: "public/dist/unocss.css",
+ },
+ },
+});