Skip to content

Commit

Permalink
WEEE WORKING DEMO
Browse files Browse the repository at this point in the history
  • Loading branch information
lryanle committed Nov 10, 2023
1 parent fe9feeb commit cfceb74
Show file tree
Hide file tree
Showing 88 changed files with 10,884 additions and 8,519 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/metrics.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Metrics
on:
# Schedule daily updates
schedule: [{cron: "0 0 * * *"}]
# schedule: [{cron: "0 0 * * *"}]
# (optional) Run workflow manually
workflow_dispatch:
# (optional) Run workflow when pushing on master/main
Expand Down
19 changes: 0 additions & 19 deletions frontend/app/404.tsx

This file was deleted.

80 changes: 0 additions & 80 deletions frontend/app/[username].tsx

This file was deleted.

17 changes: 0 additions & 17 deletions frontend/app/_app.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/* eslint-disable new-cap */
import clientPromise from "@/lib/mongodb";
import { MongoDBAdapter } from "@auth/mongodb-adapter";
import NextAuth, { NextAuthOptions } from "next-auth";
import prisma from "@/lib/prisma";
import { PrismaAdapter } from "@next-auth/prisma-adapter";
import { NextAuthOptions } from "next-auth";
import DiscordProvider from "next-auth/providers/discord";
import GitHubProvider from "next-auth/providers/github";
import GoogleProvider from "next-auth/providers/google";
import LinkedInProvider from "next-auth/providers/linkedin";

export const authOptions: NextAuthOptions = {
adapter: MongoDBAdapter(clientPromise),
adapter: PrismaAdapter(prisma),
providers: [
GitHubProvider({
clientId: process.env.GITHUB_CLIENT_ID as string,
Expand Down Expand Up @@ -142,7 +142,4 @@ export const authOptions: NextAuthOptions = {
return session;
},
},
};

const handler = NextAuth(authOptions);
export default handler;
};
7 changes: 7 additions & 0 deletions frontend/app/api/auth/[...nextauth]/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* eslint-disable new-cap */
import NextAuth from "next-auth";
import { authOptions } from "./authOptions";

const handler = NextAuth(authOptions);
export { handler as GET, handler as POST };

43 changes: 0 additions & 43 deletions frontend/app/api/user.ts

This file was deleted.

40 changes: 40 additions & 0 deletions frontend/app/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
'use client' // Error components must be Client Components

import Meta, { defaultMetaProps } from "@/components/layout/meta";
import { useEffect } from "react";

export default function Error({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) {
useEffect(() => {
// Log the error to an error reporting service
console.error(error);
}, [error]);

return (
<div className="h-screen w-full flex justify-center items-center bg-black">
<Meta
props={{
...defaultMetaProps,
title: "404 | Statefarm SMARE",
ogUrl: "https://smare.lryanle.com/404",
}}
/>
<h1 className="text-2xl font-light text-white">
404 <span className="mx-3 text-4xl">|</span> User Not Found
</h1>
<button
onClick={
// Attempt to recover by trying to re-render the segment
() => reset()
}
>
Try again
</button>
</div>
);
}
Binary file added frontend/app/fonts/SF-Pro-Display-Medium.otf
Binary file not shown.
13 changes: 13 additions & 0 deletions frontend/app/fonts/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Inter } from "next/font/google";
import localFont from "next/font/local";

export const sfPro = localFont({
src: "./SF-Pro-Display-Medium.otf",
variable: "--font-sf",
});

// eslint-disable-next-line new-cap
export const inter = Inter({
variable: "--font-inter",
subsets: ["latin"],
});
46 changes: 0 additions & 46 deletions frontend/app/index.tsx

This file was deleted.

37 changes: 37 additions & 0 deletions frontend/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import Footer from "@/layouts/footer";
import Nav from "@/layouts/nav";
import { Analytics } from "@vercel/analytics/react";
import cx from "classnames";
import { Suspense } from "react";
import { inter, sfPro } from "./fonts";
import "./globals.css";

export const metadata = {
title: "SMARE - Social Marketplace Automotive Risk Engine",
description:
"Statefarm SMARE: A University of Texas at Arlington Senior Design Project in collaboration with Statefarm.",
metadataBase: new URL("https://smare.lryanle.com"),
// themeColor: "#FFF",
};

export default async function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body className={cx(sfPro.variable, inter.variable)}>
<div className="fixed h-screen w-full bg-gradient-to-br from-indigo-50 via-white to-red-100" />
<Suspense fallback="...">
<Nav />
</Suspense>
<main className="flex min-h-screen w-full flex-col items-center justify-center py-32">
{children}
</main>
<Footer />
<Analytics />
</body>
</html>
);
}
9 changes: 4 additions & 5 deletions frontend/app/500.tsx → frontend/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import Meta, { defaultMetaProps } from "@/components/layout/meta";
export { getStaticProps } from ".";

export default function Custom500() {
export default function NotFound() {
return (
<div className="h-screen w-full flex justify-center items-center bg-black">
<Meta
props={{
...defaultMetaProps,
title: "500 | Statefarm SMARE",
title: "Not Found | Statefarm SMARE",
ogUrl: "https://smare.lryanle.com/500",
}}
/>
<h1 className="text-2xl font-light text-white">
500 <span className="mx-3 text-4xl">|</span> Internal Server Occured
Not Found <span className="mx-3 text-4xl">|</span> Could not find requested resource
</h1>
</div>
</div>
);
}
Loading

0 comments on commit cfceb74

Please sign in to comment.