aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--frontend/.gitignore140
-rwxr-xr-xfrontend/bun.lockbbin144232 -> 150472 bytes
-rw-r--r--frontend/package.json5
-rw-r--r--frontend/public/logo.svg14
-rw-r--r--frontend/src/app/api/auth/[auth0]/route.ts3
-rw-r--r--frontend/src/app/dashboard/page.tsx15
-rw-r--r--frontend/src/app/globals.css30
-rw-r--r--frontend/src/app/layout.tsx29
-rw-r--r--frontend/src/app/page.tsx134
9 files changed, 219 insertions, 151 deletions
diff --git a/frontend/.gitignore b/frontend/.gitignore
index fd3dbb5..b184158 100644
--- a/frontend/.gitignore
+++ b/frontend/.gitignore
@@ -34,3 +34,143 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts
+# Created by https://www.toptal.com/developers/gitignore/api/intellij
+# Edit at https://www.toptal.com/developers/gitignore?templates=intellij
+
+### Intellij ###
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+
+# User-specific stuff
+.idea/**/workspace.xml
+.idea/**/tasks.xml
+.idea/**/usage.statistics.xml
+.idea/**/dictionaries
+.idea/**/shelf
+
+# AWS User-specific
+.idea/**/aws.xml
+
+# Generated files
+.idea/**/contentModel.xml
+
+# Sensitive or high-churn files
+.idea/**/dataSources/
+.idea/**/dataSources.ids
+.idea/**/dataSources.local.xml
+.idea/**/sqlDataSources.xml
+.idea/**/dynamic.xml
+.idea/**/uiDesigner.xml
+.idea/**/dbnavigator.xml
+
+# Gradle
+.idea/**/gradle.xml
+.idea/**/libraries
+
+# Gradle and Maven with auto-import
+# When using Gradle or Maven with auto-import, you should exclude module files,
+# since they will be recreated, and may cause churn. Uncomment if using
+# auto-import.
+# .idea/artifacts
+# .idea/compiler.xml
+# .idea/jarRepositories.xml
+# .idea/modules.xml
+# .idea/*.iml
+# .idea/modules
+# *.iml
+# *.ipr
+
+# CMake
+cmake-build-*/
+
+# Mongo Explorer plugin
+.idea/**/mongoSettings.xml
+
+# File-based project format
+*.iws
+
+# IntelliJ
+out/
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Cursive Clojure plugin
+.idea/replstate.xml
+
+# SonarLint plugin
+.idea/sonarlint/
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+
+# Editor-based Rest Client
+.idea/httpRequests
+
+# Android studio 3.1+ serialized cache file
+.idea/caches/build_file_checksums.ser
+
+### Intellij Patch ###
+# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
+
+# *.iml
+# modules.xml
+# .idea/misc.xml
+# *.ipr
+
+# Sonarlint plugin
+# https://plugins.jetbrains.com/plugin/7973-sonarlint
+.idea/**/sonarlint/
+
+# SonarQube Plugin
+# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
+.idea/**/sonarIssues.xml
+
+# Markdown Navigator plugin
+# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
+.idea/**/markdown-navigator.xml
+.idea/**/markdown-navigator-enh.xml
+.idea/**/markdown-navigator/
+
+# Cache file creation bug
+# See https://youtrack.jetbrains.com/issue/JBR-2257
+.idea/$CACHE_FILE$
+
+# CodeStream plugin
+# https://plugins.jetbrains.com/plugin/12206-codestream
+.idea/codestream.xml
+
+# Azure Toolkit for IntelliJ plugin
+# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij
+.idea/**/azureSettings.xml
+
+# End of https://www.toptal.com/developers/gitignore/api/intellij
+# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode
+# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode
+
+### VisualStudioCode ###
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+!.vscode/*.code-snippets
+
+# Local History for Visual Studio Code
+.history/
+
+# Built Visual Studio Code Extensions
+*.vsix
+
+### VisualStudioCode Patch ###
+# Ignore all local history of files
+.history
+.ionide
+
+# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode
diff --git a/frontend/bun.lockb b/frontend/bun.lockb
index 91cec61..8495d62 100755
--- a/frontend/bun.lockb
+++ b/frontend/bun.lockb
Binary files differ
diff --git a/frontend/package.json b/frontend/package.json
index c8e26ec..d353672 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -9,9 +9,10 @@
"lint": "next lint"
},
"dependencies": {
+ "@auth0/nextjs-auth0": "^3.5.0",
+ "next": "14.2.5",
"react": "^18",
- "react-dom": "^18",
- "next": "14.2.5"
+ "react-dom": "^18"
},
"devDependencies": {
"typescript": "^5",
diff --git a/frontend/public/logo.svg b/frontend/public/logo.svg
new file mode 100644
index 0000000..cbee702
--- /dev/null
+++ b/frontend/public/logo.svg
@@ -0,0 +1,14 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Layer_1" x="0px" y="0px" viewBox="0 0 895.26 510.7" style="enable-background:new 0 0 895.26 510.7;" xml:space="preserve">
+<style type="text/css">
+ .st0{fill:#004099;}
+ .st1{fill:#505050;}
+</style>
+<g>
+ <path class="st0" d="M40.17,461.15l36.23-50.95V74.07L40.17,23.13h141.28l-36.25,50.94v336.14l36.25,50.95H40.17z"></path>
+ <path class="st0" d="M358.27,460.42H210.68l34.14-47.79V70.18l-34.14-47.79h150.74c88.76,0,128.67,51.99,128.67,107.66 c0,55.15-27.84,89.29-62.5,99.27c42.54,9.97,79.83,52.51,79.83,105.03C507.43,413.14,459.12,460.42,358.27,460.42z M359.32,72.81 h-47.79v136.03h39.4c45.16,0,72.48-29.41,72.48-75.11C423.4,102.22,402.91,72.81,359.32,72.81z M369.83,261.88h-58.3v145.49h52.52 c49.36,0,76.14-29.94,76.14-70.9C440.2,293.39,412.36,261.88,369.83,261.88z"></path>
+ <path class="st0" d="M661.59,458.13H512.96l33.09-49.36V68.95L512.96,20.1h141.81c127.63,0,187.5,80.88,187.5,210.08 C842.27,378.82,779.77,458.13,661.59,458.13z M650.03,72.09H615.9v332.46h39.92c71.95,0,113.97-49.89,113.97-168.06 C769.79,130.4,732.5,72.09,650.03,72.09z"></path>
+</g>
+<g>
+ <path class="st1" d="M839.29,76.09c-15.49,0-26.13-10.75-26.13-26.83c0-15.95,10.87-26.94,26.24-26.94 c15.38,0,26.13,10.87,26.13,26.94C865.53,65.23,854.55,76.09,839.29,76.09z M839.4,25.45c-12.6,0-22.54,8.56-22.54,23.82 c0,15.15,10.06,23.7,22.43,23.7c12.6,0,22.54-8.55,22.54-23.7C861.83,34.01,851.77,25.45,839.4,25.45z M847.03,63.61l-8.91-12.72 h-2.89v12.25h-4.97V33.43h8.9c6.25,0,10.41,3.12,10.41,8.67c0,4.28-2.31,7.05-6.01,8.21l8.67,12.14L847.03,63.61z M839.17,38.05 h-3.93v8.78h3.7c3.35,0,5.44-1.38,5.44-4.39C844.37,39.56,842.53,38.05,839.17,38.05z"></path>
+</g>
+</svg> \ No newline at end of file
diff --git a/frontend/src/app/api/auth/[auth0]/route.ts b/frontend/src/app/api/auth/[auth0]/route.ts
new file mode 100644
index 0000000..fc08676
--- /dev/null
+++ b/frontend/src/app/api/auth/[auth0]/route.ts
@@ -0,0 +1,3 @@
+import {handleAuth} from '@auth0/nextjs-auth0';
+
+export const GET = handleAuth();
diff --git a/frontend/src/app/dashboard/page.tsx b/frontend/src/app/dashboard/page.tsx
new file mode 100644
index 0000000..910ccc7
--- /dev/null
+++ b/frontend/src/app/dashboard/page.tsx
@@ -0,0 +1,15 @@
+import {Metadata} from "next";
+import Link from "next/link";
+
+export const metadata: Metadata = {
+ title: "IBD Trader Dashboard",
+}
+
+export default function Dashboard() {
+ return (
+ <div>
+ <h1>Dashboard</h1>
+ <Link href="/api/auth/logout">Logout</Link>
+ </div>
+ )
+}
diff --git a/frontend/src/app/globals.css b/frontend/src/app/globals.css
index 875c01e..79008c2 100644
--- a/frontend/src/app/globals.css
+++ b/frontend/src/app/globals.css
@@ -2,32 +2,8 @@
@tailwind components;
@tailwind utilities;
-:root {
- --foreground-rgb: 0, 0, 0;
- --background-start-rgb: 214, 219, 220;
- --background-end-rgb: 255, 255, 255;
-}
-
-@media (prefers-color-scheme: dark) {
- :root {
- --foreground-rgb: 255, 255, 255;
- --background-start-rgb: 0, 0, 0;
- --background-end-rgb: 0, 0, 0;
- }
-}
-
-body {
- color: rgb(var(--foreground-rgb));
- background: linear-gradient(
- to bottom,
- transparent,
- rgb(var(--background-end-rgb))
- )
- rgb(var(--background-start-rgb));
-}
-
@layer utilities {
- .text-balance {
- text-wrap: balance;
- }
+ .text-balance {
+ text-wrap: balance;
+ }
}
diff --git a/frontend/src/app/layout.tsx b/frontend/src/app/layout.tsx
index 3314e47..00da3a9 100644
--- a/frontend/src/app/layout.tsx
+++ b/frontend/src/app/layout.tsx
@@ -1,22 +1,21 @@
-import type { Metadata } from "next";
-import { Inter } from "next/font/google";
+import type {Metadata} from "next";
+import {Inter} from "next/font/google";
import "./globals.css";
+import {UserProvider} from "@auth0/nextjs-auth0/client";
-const inter = Inter({ subsets: ["latin"] });
+const inter = Inter({subsets: ["latin"]});
export const metadata: Metadata = {
- title: "Create Next App",
- description: "Generated by create next app",
+ title: "Create Next App",
+ description: "Generated by create next app",
};
-export default function RootLayout({
- children,
-}: Readonly<{
- children: React.ReactNode;
-}>) {
- return (
- <html lang="en">
- <body className={inter.className}>{children}</body>
- </html>
- );
+export default function RootLayout({children,}: Readonly<{ children: React.ReactNode; }>) {
+ return (
+ <html lang="en">
+ <UserProvider>
+ <body className={inter.className}>{children}</body>
+ </UserProvider>
+ </html>
+ );
}
diff --git a/frontend/src/app/page.tsx b/frontend/src/app/page.tsx
index 2acfd44..9f42d3a 100644
--- a/frontend/src/app/page.tsx
+++ b/frontend/src/app/page.tsx
@@ -1,113 +1,33 @@
import Image from "next/image";
+import {Metadata} from "next";
+import Link from "next/link";
+import {getSession} from "@auth0/nextjs-auth0";
+import {redirect} from "next/navigation";
-export default function Home() {
- return (
- <main className="flex min-h-screen flex-col items-center justify-between p-24">
- <div className="z-10 w-full max-w-5xl items-center justify-between font-mono text-sm lg:flex">
- <p className="fixed left-0 top-0 flex w-full justify-center border-b border-gray-300 bg-gradient-to-b from-zinc-200 pb-6 pt-8 backdrop-blur-2xl dark:border-neutral-800 dark:bg-zinc-800/30 dark:from-inherit lg:static lg:w-auto lg:rounded-xl lg:border lg:bg-gray-200 lg:p-4 lg:dark:bg-zinc-800/30">
- Get started by editing&nbsp;
- <code className="font-mono font-bold">src/app/page.tsx</code>
- </p>
- <div className="fixed bottom-0 left-0 flex h-48 w-full items-end justify-center bg-gradient-to-t from-white via-white dark:from-black dark:via-black lg:static lg:size-auto lg:bg-none">
- <a
- className="pointer-events-none flex place-items-center gap-2 p-8 lg:pointer-events-auto lg:p-0"
- href="https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
- target="_blank"
- rel="noopener noreferrer"
- >
- By{" "}
- <Image
- src="/vercel.svg"
- alt="Vercel Logo"
- className="dark:invert"
- width={100}
- height={24}
- priority
- />
- </a>
- </div>
- </div>
-
- <div className="relative z-[-1] flex place-items-center before:absolute before:h-[300px] before:w-full before:-translate-x-1/2 before:rounded-full before:bg-gradient-radial before:from-white before:to-transparent before:blur-2xl before:content-[''] after:absolute after:-z-20 after:h-[180px] after:w-full after:translate-x-1/3 after:bg-gradient-conic after:from-sky-200 after:via-blue-200 after:blur-2xl after:content-[''] before:dark:bg-gradient-to-br before:dark:from-transparent before:dark:to-blue-700 before:dark:opacity-10 after:dark:from-sky-900 after:dark:via-[#0141ff] after:dark:opacity-40 sm:before:w-[480px] sm:after:w-[240px] before:lg:h-[360px]">
- <Image
- className="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert"
- src="/next.svg"
- alt="Next.js Logo"
- width={180}
- height={37}
- priority
- />
- </div>
-
- <div className="mb-32 grid text-center lg:mb-0 lg:w-full lg:max-w-5xl lg:grid-cols-4 lg:text-left">
- <a
- href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
- className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
- target="_blank"
- rel="noopener noreferrer"
- >
- <h2 className="mb-3 text-2xl font-semibold">
- Docs{" "}
- <span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
- -&gt;
- </span>
- </h2>
- <p className="m-0 max-w-[30ch] text-sm opacity-50">
- Find in-depth information about Next.js features and API.
- </p>
- </a>
+export const metadata: Metadata = {
+ title: "IBD Trader",
+}
- <a
- href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
- className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
- target="_blank"
- rel="noopener noreferrer"
- >
- <h2 className="mb-3 text-2xl font-semibold">
- Learn{" "}
- <span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
- -&gt;
- </span>
- </h2>
- <p className="m-0 max-w-[30ch] text-sm opacity-50">
- Learn about Next.js in an interactive course with&nbsp;quizzes!
- </p>
- </a>
+export default async function Home() {
+ const user = await getSession();
- <a
- href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
- className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
- target="_blank"
- rel="noopener noreferrer"
- >
- <h2 className="mb-3 text-2xl font-semibold">
- Templates{" "}
- <span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
- -&gt;
- </span>
- </h2>
- <p className="m-0 max-w-[30ch] text-sm opacity-50">
- Explore starter templates for Next.js.
- </p>
- </a>
+ if (user) {
+ redirect("/dashboard")
+ }
- <a
- href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
- className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
- target="_blank"
- rel="noopener noreferrer"
- >
- <h2 className="mb-3 text-2xl font-semibold">
- Deploy{" "}
- <span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
- -&gt;
- </span>
- </h2>
- <p className="m-0 max-w-[30ch] text-balance text-sm opacity-50">
- Instantly deploy your Next.js site to a shareable URL with Vercel.
- </p>
- </a>
- </div>
- </main>
- );
+ return (
+ <div className="min-h-screen flex flex-col items-center justify-center bg-gray-100">
+ <main className="flex flex-col items-center justify-center w-full flex-1 px-20 text-center">
+ <div className="flex justify-center">
+ <Image src="/logo.svg" alt="IBD Trader" width={200} height={200}/>
+ </div>
+ <h1 className="text-6xl font-bold mt-4">Trader</h1>
+ <button className="mt-16 px-6 py-3 bg-blue-500 text-white rounded-md hover:bg-blue-600">
+ <Link href="/api/auth/login">
+ Login
+ </Link>
+ </button>
+ </main>
+ </div>
+ );
}