diff --git a/components/public/Loading.vue b/components/public/Loading.vue
new file mode 100644
index 0000000..4f146cd
--- /dev/null
+++ b/components/public/Loading.vue
@@ -0,0 +1,16 @@
+
+
+
\ No newline at end of file
diff --git a/pages/search.vue b/pages/search.vue
new file mode 100644
index 0000000..3d36e44
--- /dev/null
+++ b/pages/search.vue
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
diff --git a/server/trpc/routers/module.ts b/server/trpc/routers/module.ts
index 0280d67..e8377a0 100644
--- a/server/trpc/routers/module.ts
+++ b/server/trpc/routers/module.ts
@@ -16,4 +16,22 @@ export default router({
where: { id },
})
}),
+ search: publicProcedure
+ .input(
+ z.object({
+ query: z.string(),
+ }),
+ )
+ .query(async ({ ctx, input }) => {
+ const prisma = ctx.prisma
+ const { query } = input
+ return prisma.module.findMany({
+ where: {
+ OR: [
+ { title: { contains: query } },
+ { content: { contains: query } },
+ ],
+ },
+ })
+ }),
})