diff --git a/app/assistant-config.ts b/app/assistant-config.ts index 471edfa1..6e204c1d 100644 --- a/app/assistant-config.ts +++ b/app/assistant-config.ts @@ -1,5 +1 @@ -export let assistantId = ""; // set your assistant ID here - -if (assistantId === "") { - assistantId = process.env.OPENAI_ASSISTANT_ID; -} +export const assistantId = "asst_G3YhFH5MCu6PKOhGHVefg4Qk"; diff --git a/app/components/DashboardLayout.tsx b/app/components/DashboardLayout.tsx new file mode 100644 index 00000000..70f28487 --- /dev/null +++ b/app/components/DashboardLayout.tsx @@ -0,0 +1,22 @@ +'use client'; +import Link from 'next/link'; + +export default function DashboardLayout({ children }: { children: React.ReactNode }) { + return ( +
+ + +
+ {children} +
+
+ ); +} diff --git a/app/components/StockPrice.tsx b/app/components/StockPrice.tsx new file mode 100644 index 00000000..a6b6cbc1 --- /dev/null +++ b/app/components/StockPrice.tsx @@ -0,0 +1,19 @@ +'use client'; + +import { useEffect, useState } from 'react'; + +export default function StockPrice({ ticker }) { + const [price, setPrice] = useState(null); + + useEffect(() => { + fetch(`/api/tiingo?ticker=${ticker}`) + .then(res => res.json()) + .then(data => setPrice(data.price)); + }, [ticker]); + + return ( +
+

{ticker} current price: ${price || 'Loading...'}

+
+ ); +} diff --git a/app/layout.tsx b/app/layout.tsx index c60736ec..e707a63f 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,23 +1,16 @@ -import { Inter } from "next/font/google"; -import "./globals.css"; -import Warnings from "./components/warnings"; -import { assistantId } from "./assistant-config"; -const inter = Inter({ subsets: ["latin"] }); +import DashboardLayout from './components/DashboardLayout'; +import './globals.css'; export const metadata = { - title: "Assistants API Quickstart", - description: "A quickstart template using the Assistants API with OpenAI", - icons: { - icon: "/openai.svg", - }, + title: 'AlphaGPT Trading App', + description: 'Advanced Trading Dashboard powered by AlphaGPT', }; export default function RootLayout({ children }) { return ( - - {assistantId ? children : } - OpenAI Logo + + {children} ); diff --git a/app/page.tsx b/app/page.tsx index 60c34a3b..34717d04 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,30 +1,8 @@ -"use client"; - -import React from "react"; -import styles from "./page.module.css"; - -const Home = () => { - const categories = { - "Basic chat": "basic-chat", - "Function calling": "function-calling", - "File search": "file-search", - All: "all", - }; - +export default function Home() { return ( -
-
- Explore sample apps built with Assistants API -
-
- {Object.entries(categories).map(([name, url]) => ( - - {name} - - ))} -
+
+

🚀 AlphaGPT Trading Assistant 🚀

+

Your all-in-one, powerful trading dashboard.

); -}; - -export default Home; +}