diff --git a/.gitignore b/.gitignore index f7b07d5..0e25bd2 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,6 @@ node_modules /public/build .env -app/tailwind.css \ No newline at end of file +app/tailwind.css + +prisma/dev.db \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f9b5bd8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM node:alpine + +COPY . /src + +WORKDIR /src + +RUN npm install && npm run build + +CMD ["npm", "run", "start"] \ No newline at end of file diff --git a/app/models/posts.server.ts b/app/models/posts.server.ts new file mode 100644 index 0000000..3056dbd --- /dev/null +++ b/app/models/posts.server.ts @@ -0,0 +1,23 @@ +import { db } from "~/utils/db.server"; + +export const findPosts = async () => { + return db.post.findMany({ + select: { + id: true, + title: true, + description: true, + createdAt: true, + }, + orderBy: { + createdAt: "desc", + }, + }); +}; + +export const findPost = async (id: string) => { + return db.post.findUnique({ + where: { + id, + }, + }); +}; diff --git a/app/root.tsx b/app/root.tsx index b8893b7..3a22eae 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -1,3 +1,4 @@ +import codeHikeStyle from "@code-hike/mdx/dist/index.css"; import type { LinksFunction, MetaFunction } from "@remix-run/node"; import { Link, @@ -12,6 +13,7 @@ import stylesheet from "~/tailwind.css"; export const links: LinksFunction = () => [ { rel: "stylesheet", href: stylesheet }, + { rel: "stylesheet", href: codeHikeStyle }, ]; export const meta: MetaFunction = () => ({ diff --git a/app/routes/_index.tsx b/app/routes/_index.tsx index 6881955..9cf9159 100644 --- a/app/routes/_index.tsx +++ b/app/routes/_index.tsx @@ -8,6 +8,7 @@ import { FaTelegramPlane, FaTwitter, } from "react-icons/fa"; +import { IconContext } from "react-icons/lib"; import { MdEmail } from "react-icons/md"; export default function Index() { @@ -18,37 +19,35 @@ export default function Index() { $ echo "Hello, world!" | -