This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
env: { | |
browser: true, | |
es2021: true, | |
node: true, | |
}, | |
extends: [ | |
'eslint:recommended', | |
'plugin:react/recommended', | |
'plugin:@typescript-eslint/recommended', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is your Prisma schema file, | |
// learn more about it in the docs: https://pris.ly/d/prisma-schema | |
generator client { | |
provider = "prisma-client-js" | |
} | |
datasource db { | |
provider = "sqlite" | |
url = env("DATABASE_URL") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PrismaClient } from "@prisma/client"; | |
let db: PrismaClient; | |
declare global { | |
var __db: PrismaClient | undefined; | |
} | |
// this is needed because in development we don't want to restart | |
// the server with every change, but we want to make sure we don't |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Task } from '.prisma/client'; | |
import { BriefcaseIcon, PlusCircleIcon } from '@heroicons/react/solid'; | |
import { Form, useActionData, useLoaderData, useTransition } from 'remix'; | |
import { action as NewTaskAction, NewTaskActionData } from './api/task/new'; | |
import { loader as TaskLoader } from './api/task/get'; | |
import { useEffect, useRef } from 'react'; | |
export const loader = TaskLoader; | |
export const action = NewTaskAction; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ActionFunction, json, redirect } from 'remix'; | |
import { db } from '~/utils/db.server'; | |
// return type of this action | |
export type DeleteTaskActionData = { | |
formError?: string; | |
fieldErrors?: { | |
taskId?: string; | |
}; | |
fields?: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ActionFunction, json } from 'remix'; | |
import { db } from '~/utils/db.server'; | |
// return type of this action | |
export type NewTaskActionData = { | |
formError?: string; | |
fieldErrors?: { | |
task?: string; | |
}; | |
fields?: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LoaderFunction } from '@remix-run/server-runtime'; | |
import { db } from '~/utils/db.server'; | |
export const loader: LoaderFunction = async () => { | |
return db.task.findMany(); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
content: ["./app/**/*.{ts,tsx}"], | |
theme: { | |
extend: {}, | |
}, | |
variants: { | |
extend: {}, | |
}, | |
plugins: [], | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import stylesUrl from "~/styles/tailwind.css"; | |
import type { LinksFunction } from "remix"; | |
export const links: LinksFunction = () => { | |
return [{ rel: "stylesheet", href: stylesUrl }]; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "tailwindcss/base"; | |
@import "tailwindcss/components"; | |
@import "tailwindcss/utilities"; | |
@import "./components/button.css"; |