Skip to content

Commit

Permalink
scaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
awtkns committed Dec 3, 2023
1 parent 310676f commit 899641f
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 46 deletions.
5 changes: 3 additions & 2 deletions next/src/app/api/rest/upload/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ export async function POST(req: Request) {

const result = await TestSuiteSchema.safeParseAsync(testSuite);
if (!result.success) {
NextResponse.json(result.error, {
return NextResponse.json(result.error, {
status: 422,
});
} else {
await caller.evaluations.create(result.data);
}

await caller.evaluations.create(result.data);
return NextResponse.json("ok");
}
8 changes: 2 additions & 6 deletions next/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Inter } from "next/font/google";
import { cookies } from "next/headers";

import { TRPCReactProvider } from "~/trpc/react";
import type {ReactNode} from "react";
import type { ReactNode } from "react";

const inter = Inter({
subsets: ["latin"],
Expand All @@ -17,11 +17,7 @@ export const metadata = {
icons: [{ rel: "icon", url: "/favicon.ico" }],
};

export default function RootLayout({
children,
}: {
children: ReactNode;
}) {
export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="en">
<body className={`font-sans ${inter.variable}`}>
Expand Down
27 changes: 23 additions & 4 deletions next/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,42 @@
import { db } from "~/server/db";
import { Card, Grid, Metric, Tab, TabGroup, TabList, TabPanel, TabPanels, Text, Title } from "@tremor/react";
import {
Card,
Grid,
Metric,
Tab,
TabGroup,
TabList,
TabPanel,
TabPanels,
Text,
Title,
} from "@tremor/react";
import TestSuitesTable from "~/app/_components/test-suites-table";
import { getServerAuthSession } from "~/server/auth";
import Link from "next/link";

export default async function Home() {
// const hello = await api.post.hello.query({ text: "from tRPC" });
// const session = await getServerAuthSession();
const session = await getServerAuthSession();

return (
<main className="min-h-screen p-10">
<Title className="font-medium text-2xl">Bananalytics 🍌</Title>
<Title className="text-2xl font-medium">Bananalytics 🍌</Title>
<Text>Full stack Banalyses observability</Text>
<Link
href={session ? "/api/auth/signout" : "/api/auth/signin"}
className="rounded-full bg-white/10 px-10 py-3 font-semibold no-underline transition hover:bg-white/20"
>
{session ? "Sign out" : "Sign in"}
</Link>
<TabGroup className="mt-6">
<TabList>
<Tab>Dashboard</Tab>
<Tab>Runs</Tab>
</TabList>
<TabPanels>
<TabPanel>
<Grid numItemsMd={2} numItemsLg={3} className="gap-6 mt-6">
<Grid numItemsMd={2} numItemsLg={3} className="mt-6 gap-6">
<Card>
{/* Placeholder to set height */}
<div className="h-28" />
Expand Down
42 changes: 8 additions & 34 deletions next/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,46 +42,20 @@ export default {
inverted: "#ffffff", // white
},
},
// dark mode
"dark-tremor": {
brand: {
faint: "#0B1229", // custom
muted: "#172554", // blue-950
subtle: "#1e40af", // blue-800
DEFAULT: "#3b82f6", // blue-500
emphasis: "#60a5fa", // blue-400
inverted: "#030712", // gray-950
},
background: {
muted: "#131A2B", // custom
subtle: "#1f2937", // gray-800
DEFAULT: "#111827", // gray-900
emphasis: "#d1d5db", // gray-300
},
border: {
DEFAULT: "#1f2937", // gray-800
},
ring: {
DEFAULT: "#1f2937", // gray-800
},
content: {
subtle: "#4b5563", // gray-600
DEFAULT: "#6b7280", // gray-500
emphasis: "#e5e7eb", // gray-200
strong: "#f9fafb", // gray-50
inverted: "#000000", // black
},
},
},
boxShadow: {
// light
"tremor-input": "0 1px 2px 0 rgb(0 0 0 / 0.05)",
"tremor-card": "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
"tremor-dropdown": "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
"tremor-card":
"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
"tremor-dropdown":
"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
// dark
"dark-tremor-input": "0 1px 2px 0 rgb(0 0 0 / 0.05)",
"dark-tremor-card": "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
"dark-tremor-dropdown": "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
"dark-tremor-card":
"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
"dark-tremor-dropdown":
"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
},
borderRadius: {
"tremor-small": "0.375rem",
Expand Down

0 comments on commit 899641f

Please sign in to comment.