diff --git a/frontend/src/NewApp/BackstoryApp.css b/frontend/src/BackstoryApp.css similarity index 100% rename from frontend/src/NewApp/BackstoryApp.css rename to frontend/src/BackstoryApp.css diff --git a/frontend/src/NewApp/BackstoryApp.tsx b/frontend/src/BackstoryApp.tsx similarity index 93% rename from frontend/src/NewApp/BackstoryApp.tsx rename to frontend/src/BackstoryApp.tsx index 39f6c84..de1278e 100644 --- a/frontend/src/NewApp/BackstoryApp.tsx +++ b/frontend/src/BackstoryApp.tsx @@ -2,15 +2,15 @@ import React, { useEffect, useState, useRef, useCallback } from 'react'; import { Route, Routes, useLocation, useNavigate } from 'react-router-dom'; import { ThemeProvider } from '@mui/material/styles'; -import { backstoryTheme } from '../BackstoryTheme'; +import { backstoryTheme } from './BackstoryTheme'; -import { SeverityType } from '../Components/Snack'; -import { Query } from '../types/types'; -import { ConversationHandle } from './Components/Conversation'; -import { UserProvider } from './Components/UserContext'; -import { BetaPage } from './Pages/BetaPage'; +import { SeverityType } from './components/Snack'; +import { Query } from './types/types'; +import { ConversationHandle } from './components/Conversation'; +import { UserProvider } from './components/UserContext'; +import { BetaPage } from './pages/BetaPage'; import { UserRoute } from './routes/UserRoute'; -import { BackstoryLayout } from './Components/BackstoryLayout'; +import { BackstoryLayout } from './components/BackstoryLayout'; import './BackstoryApp.css'; import '@fontsource/roboto/300.css'; @@ -18,7 +18,7 @@ import '@fontsource/roboto/400.css'; import '@fontsource/roboto/500.css'; import '@fontsource/roboto/700.css'; -import { connectionBase } from '../Global'; +import { connectionBase } from './Global'; // Cookie handling functions const getCookie = (name: string) => { diff --git a/frontend/src/BackstoryTheme.tsx b/frontend/src/BackstoryTheme.tsx index c44aeb2..5132439 100644 --- a/frontend/src/BackstoryTheme.tsx +++ b/frontend/src/BackstoryTheme.tsx @@ -12,7 +12,7 @@ const backstoryTheme = createTheme({ }, text: { primary: '#2E2E2E', // Charcoal Black - secondary: '#1A2536',//D3CDBF', // Warm Gray + secondary: '#1A2536', // Midnight Blue }, background: { default: '#D3CDBF', // Warm Gray @@ -34,9 +34,32 @@ const backstoryTheme = createTheme({ fontWeight: 500, color: '#2E2E2E', // Charcoal Black }, + h2: { + fontSize: '1.75rem', + fontWeight: 500, + color: '#2E2E2E', // Charcoal Black + marginBottom: '1rem', + }, + h3: { + fontSize: '1.5rem', + fontWeight: 500, + color: '#2E2E2E', // Charcoal Black + marginBottom: '0.75rem', + }, + h4: { + fontSize: '1.25rem', + fontWeight: 500, + color: '#2E2E2E', // Charcoal Black + marginBottom: '0.5rem', + }, body1: { fontSize: '1rem', color: '#2E2E2E', // Charcoal Black + marginBottom: '0.5rem', + }, + body2: { + fontSize: '0.875rem', + color: '#2E2E2E', // Charcoal Black }, }, components: { @@ -69,6 +92,31 @@ const backstoryTheme = createTheme({ }, }, }, + MuiPaper: { + styleOverrides: { + root: { + padding: '2rem', + borderRadius: '8px', + }, + }, + }, + MuiList: { + styleOverrides: { + root: { + padding: '0.5rem', + }, + }, + }, + MuiListItem: { + styleOverrides: { + root: { + borderRadius: '4px', + '&:hover': { + backgroundColor: 'rgba(212, 160, 23, 0.1)', // Golden Ochre with opacity + }, + }, + }, + }, }, }); diff --git a/frontend/src/Components/ChatBubble.tsx b/frontend/src/Components/ChatBubble.tsx deleted file mode 100644 index bbf7a7a..0000000 --- a/frontend/src/Components/ChatBubble.tsx +++ /dev/null @@ -1,227 +0,0 @@ -import React from 'react'; -import { Box } from '@mui/material'; -import { useTheme } from '@mui/material/styles'; -import { SxProps, Theme } from '@mui/material'; -import Accordion from '@mui/material/Accordion'; -import AccordionSummary from '@mui/material/AccordionSummary'; -import AccordionDetails from '@mui/material/AccordionDetails'; -import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; -import LocationSearchingIcon from '@mui/icons-material/LocationSearching'; - -import { MessageRoles } from './Message'; -import { ErrorOutline, InfoOutline, Memory, Psychology, /* Stream, */ } from '@mui/icons-material'; - -interface ChatBubbleProps { - role: MessageRoles, - isInfo?: boolean; - children: React.ReactNode; - sx?: SxProps; - className?: string; - title?: string; - expanded?: boolean; - expandable?: boolean; - onExpand?: (open: boolean) => void; -} - -function ChatBubble(props: ChatBubbleProps) { - const { role, children, sx, className, title, onExpand, expandable, expanded } = props; - - const theme = useTheme(); - - const defaultRadius = '16px'; - const defaultStyle = { - padding: theme.spacing(1, 2), - fontSize: '0.875rem', - alignSelf: 'flex-start', - maxWidth: '100%', - minWidth: '100%', - height: 'fit-content', - '& > *': { - color: 'inherit', - overflow: 'hidden', - m: 0, - }, - '& > :last-child': { - mb: 0, - m: 0, - p: 0, - }, - }; - - const styles: any = { - assistant: { - ...defaultStyle, - backgroundColor: theme.palette.primary.main, - border: `1px solid ${theme.palette.secondary.main}`, - borderRadius: `${defaultRadius} ${defaultRadius} ${defaultRadius} 0`, - color: theme.palette.primary.contrastText, - }, - content: { - ...defaultStyle, - backgroundColor: '#F5F2EA', - border: `1px solid ${theme.palette.custom.highlight}`, - borderRadius: 0, - alignSelf: 'center', - color: theme.palette.text.primary, - padding: '8px 8px', - marginBottom: '0px', - boxShadow: '0 2px 4px rgba(0, 0, 0, 0.05)', - fontSize: '0.9rem', - lineHeight: '1.3', - fontFamily: theme.typography.fontFamily, - }, - error: { - ...defaultStyle, - backgroundColor: '#F8E7E7', - border: `1px solid #D83A3A`, - borderRadius: defaultRadius, - maxWidth: '90%', - minWidth: '90%', - alignSelf: 'center', - color: '#8B2525', - padding: '10px 16px', - boxShadow: '0 1px 3px rgba(216, 58, 58, 0.15)', - }, - 'fact-check': 'qualifications', - 'job-description': 'content', - 'job-requirements': 'qualifications', - info: { - ...defaultStyle, - backgroundColor: '#BFD8D8', - border: `1px solid ${theme.palette.secondary.main}`, - borderRadius: defaultRadius, - color: theme.palette.text.primary, - opacity: 0.95, - }, - processing: 'status', - qualifications: { - ...defaultStyle, - backgroundColor: theme.palette.primary.light, - border: `1px solid ${theme.palette.secondary.main}`, - borderRadius: `${defaultRadius} ${defaultRadius} ${defaultRadius} 0`, - color: theme.palette.primary.contrastText, - }, - resume: 'content', - searching: 'status', - status: { - ...defaultStyle, - backgroundColor: 'rgba(74, 122, 125, 0.15)', - border: `1px solid ${theme.palette.secondary.light}`, - borderRadius: '4px', - maxWidth: '75%', - minWidth: '75%', - alignSelf: 'center', - color: theme.palette.secondary.dark, - fontWeight: 500, - fontSize: '0.95rem', - padding: '8px 12px', - opacity: 0.9, - transition: 'opacity 0.3s ease-in-out', - }, - streaming: 'assistant', - system: { - ...defaultStyle, - backgroundColor: '#EDEAE0', - border: `1px dashed ${theme.palette.custom.highlight}`, - borderRadius: defaultRadius, - maxWidth: '90%', - minWidth: '90%', - alignSelf: 'center', - color: theme.palette.text.primary, - fontStyle: 'italic', - }, - thinking: 'status', - user: { - ...defaultStyle, - backgroundColor: theme.palette.background.default, - border: `1px solid ${theme.palette.custom.highlight}`, - borderRadius: `${defaultRadius} ${defaultRadius} 0 ${defaultRadius}`, - alignSelf: 'flex-end', - color: theme.palette.primary.main, - }, - }; - - // Resolve string references in styles - for (const [key, value] of Object.entries(styles)) { - if (typeof value === 'string') { - styles[key] = styles[value]; - } - } - - const icons: any = { - error: , - info: , - processing: , - searching: , - thinking: , - tooling: , - }; - - // Render Accordion for expandable content - if (expandable || title) { - // Determine if Accordion is controlled - const isControlled = typeof expanded === 'boolean' && typeof onExpand === 'function'; - return ( - { - if (isControlled && onExpand) { - onExpand(newExpanded); // Call onExpand with new state - } - }} - sx={{ ...styles[role], ...sx }} - > - } - slotProps={{ - content: { - sx: { - fontWeight: 'bold', - fontSize: '1.1rem', - m: 0, - p: 0, - display: 'flex', - justifyItems: 'center', - }, - }, - }} - > - {title || ''} - - - {children} - - - ); - } - - // Render non-expandable content - return ( - - {icons[role] !== undefined && icons[role]} - - {children} - - - ); -} - -export type { - ChatBubbleProps -}; - -export { - ChatBubble -}; - diff --git a/frontend/src/Components/ContextStatus.tsx b/frontend/src/Components/ContextStatus.tsx deleted file mode 100644 index b4f8464..0000000 --- a/frontend/src/Components/ContextStatus.tsx +++ /dev/null @@ -1,8 +0,0 @@ -type ContextStatus = { - context_used: number, - max_context: number -}; - -export type { - ContextStatus -}; \ No newline at end of file diff --git a/frontend/src/Components/Document.tsx b/frontend/src/Components/Document.tsx deleted file mode 100644 index 00f6306..0000000 --- a/frontend/src/Components/Document.tsx +++ /dev/null @@ -1,99 +0,0 @@ -import React, { useState, useEffect } from 'react'; -import { Box } from '@mui/material'; - -import { Message } from './Message'; -import { ChatBubble } from '../Components/ChatBubble'; -import { BackstoryElementProps } from './BackstoryTab'; - -interface DocumentProps extends BackstoryElementProps { - title: string; - expanded?: boolean; - filepath?: string; - content?: string; - disableCopy?: boolean; - children?: React.ReactNode; - onExpand?: (open: boolean) => void; -} - -const Document = (props: DocumentProps) => { - const { sessionId, setSnack, submitQuery, filepath, content, title, expanded, disableCopy, onExpand, children } = props; - const backstoryProps = { - submitQuery, - setSnack, - sessionId - } - - const [document, setDocument] = useState(""); - - // Get the markdown - useEffect(() => { - if (document !== "" || !filepath) { - return; - } - const fetchDocument = async () => { - try { - const response = await fetch(filepath, { - method: 'GET', - headers: { - 'Content-Type': 'application/json', - }, - }); - if (!response.ok) { - throw Error(`${filepath} not found.`); - } - const data = await response.text(); - setDocument(data); - } catch (error: any) { - console.error('Error obtaining About content information:', error); - setDocument(`${filepath} not found.`); - }; - }; - - fetchDocument(); - }, [document, setDocument, filepath]) - - return ( - - {children !== undefined && {children}} - {children === undefined && - } - - ); -}; - -export { - Document -}; \ No newline at end of file diff --git a/frontend/src/NewApp/BackstoryTheme.tsx b/frontend/src/NewApp/BackstoryTheme.tsx deleted file mode 100644 index 5132439..0000000 --- a/frontend/src/NewApp/BackstoryTheme.tsx +++ /dev/null @@ -1,123 +0,0 @@ -import { createTheme } from '@mui/material/styles'; - -const backstoryTheme = createTheme({ - palette: { - primary: { - main: '#1A2536', // Midnight Blue - contrastText: '#D3CDBF', // Warm Gray - }, - secondary: { - main: '#4A7A7D', // Dusty Teal - contrastText: '#FFFFFF', // White - }, - text: { - primary: '#2E2E2E', // Charcoal Black - secondary: '#1A2536', // Midnight Blue - }, - background: { - default: '#D3CDBF', // Warm Gray - paper: '#FFFFFF', // White - }, - action: { - active: '#D4A017', // Golden Ochre - hover: 'rgba(212, 160, 23, 0.1)', // Golden Ochre with opacity - }, - custom: { - highlight: '#D4A017', // Golden Ochre - contrast: '#2E2E2E', // Charcoal Black - }, - }, - typography: { - fontFamily: "'Roboto', sans-serif", - h1: { - fontSize: '2rem', - fontWeight: 500, - color: '#2E2E2E', // Charcoal Black - }, - h2: { - fontSize: '1.75rem', - fontWeight: 500, - color: '#2E2E2E', // Charcoal Black - marginBottom: '1rem', - }, - h3: { - fontSize: '1.5rem', - fontWeight: 500, - color: '#2E2E2E', // Charcoal Black - marginBottom: '0.75rem', - }, - h4: { - fontSize: '1.25rem', - fontWeight: 500, - color: '#2E2E2E', // Charcoal Black - marginBottom: '0.5rem', - }, - body1: { - fontSize: '1rem', - color: '#2E2E2E', // Charcoal Black - marginBottom: '0.5rem', - }, - body2: { - fontSize: '0.875rem', - color: '#2E2E2E', // Charcoal Black - }, - }, - components: { - MuiLink: { - styleOverrides: { - root: { - color: '#4A7A7D', // Dusty Teal (your secondary color) - textDecoration: 'none', - '&:hover': { - color: '#D4A017', // Golden Ochre on hover - textDecoration: 'underline', - }, - }, - }, - }, - MuiButton: { - styleOverrides: { - root: { - textTransform: 'none', - '&:hover': { - backgroundColor: 'rgba(212, 160, 23, 0.2)', // Golden Ochre hover - }, - }, - }, - }, - MuiAppBar: { - styleOverrides: { - root: { - backgroundColor: '#1A2536', // Midnight Blue - }, - }, - }, - MuiPaper: { - styleOverrides: { - root: { - padding: '2rem', - borderRadius: '8px', - }, - }, - }, - MuiList: { - styleOverrides: { - root: { - padding: '0.5rem', - }, - }, - }, - MuiListItem: { - styleOverrides: { - root: { - borderRadius: '4px', - '&:hover': { - backgroundColor: 'rgba(212, 160, 23, 0.1)', // Golden Ochre with opacity - }, - }, - }, - }, - }, -}); - -export { backstoryTheme }; \ No newline at end of file diff --git a/frontend/src/Pages/AboutPage.tsx b/frontend/src/Pages/AboutPage.tsx deleted file mode 100644 index 5ab81fc..0000000 --- a/frontend/src/Pages/AboutPage.tsx +++ /dev/null @@ -1,111 +0,0 @@ -import React, { useState, useEffect } from 'react'; - -import { Scrollable } from '../Components/Scrollable'; -import { BackstoryPageProps } from '../Components/BackstoryTab'; -import { Document } from '../Components/Document'; - -const AboutPage = (props: BackstoryPageProps) => { - const { sessionId, submitQuery, setSnack, route, setRoute } = props; - const [subRoute, setSubRoute] = useState(""); - const [page, setPage] = useState(""); - - useEffect(() => { - if (route === undefined) { return; } - const parts = route.split("/"); - setPage(parts[0]); - parts.shift(); - setSubRoute(parts.join("/")); - }, [route]); - - useEffect(() => { - console.log(`AboutPage: ${page} - sub-route - ${subRoute}`); - }, [page, subRoute]); - - useEffect(() => { - if (route) { - const parts = route.split("/"); - if (parts[0] !== page) { - parts.shift(); - const incomingSubRoute = parts.join("/"); - if (incomingSubRoute !== subRoute) { - setSubRoute(incomingSubRoute); - } - } - } else if (subRoute) { - setRoute && setRoute(subRoute); - } - }, [page, route, setRoute, subRoute]); - - useEffect(() => { - let newRoute = page; - if (subRoute) { - newRoute += '/' + subRoute; - } - if (route !== newRoute && setRoute) { - setRoute(newRoute); - } - }, [route, page, subRoute, setRoute]); - - const onDocumentExpand = (document: string, open: boolean) => { - console.log("Document expanded:", document, open); - if (open) { - setSubRoute(""); - setPage(document); - } else { - setSubRoute(""); - setPage(""); - } - } - - return - { onDocumentExpand('about', open); }, - expanded: page === 'about', - sessionId, - submitQuery: submitQuery, - setSnack, - }} /> - { onDocumentExpand('beta', open); }, - expanded: page === 'beta', - sessionId, - submitQuery: submitQuery, - setSnack, - }} /> - { onDocumentExpand('resume-generation', open); }, - expanded: page === 'resume-generation', - sessionId, - submitQuery: submitQuery, - setSnack, - }} /> - { onDocumentExpand('about-app', open); }, - expanded: page === 'about-app', - sessionId, - submitQuery: submitQuery, - setSnack, - }} /> - ; -}; - -export { - AboutPage -}; \ No newline at end of file diff --git a/frontend/src/NewApp/PhoneInput.css b/frontend/src/PhoneInput.css similarity index 100% rename from frontend/src/NewApp/PhoneInput.css rename to frontend/src/PhoneInput.css diff --git a/frontend/src/NewApp/TestApp.tsx b/frontend/src/TestApp.tsx similarity index 99% rename from frontend/src/NewApp/TestApp.tsx rename to frontend/src/TestApp.tsx index 2c7d1bc..f2d7e3a 100644 --- a/frontend/src/NewApp/TestApp.tsx +++ b/frontend/src/TestApp.tsx @@ -33,12 +33,12 @@ import { isSuccessResponse, debugConversion, type ApiResponse -} from '../types/conversion'; +} from './types/conversion'; import { AuthResponse, BaseUser, Guest -} from '../types/types' - +} from './types/types' +import { connectionBase } from 'Global'; interface LoginRequest { login: string; @@ -54,7 +54,7 @@ interface RegisterRequest { phone?: string; } -const API_BASE_URL = 'https://backstory-beta.ketrenos.com/api/1.0'; +const API_BASE_URL = `${connectionBase}/api/1.0`; const BackstoryTestApp: React.FC = () => { const [currentUser, setCurrentUser] = useState(null); diff --git a/frontend/src/NewApp/Components/BackstoryLayout.tsx b/frontend/src/components/BackstoryLayout.tsx similarity index 96% rename from frontend/src/NewApp/Components/BackstoryLayout.tsx rename to frontend/src/components/BackstoryLayout.tsx index 41d2407..9820681 100644 --- a/frontend/src/NewApp/Components/BackstoryLayout.tsx +++ b/frontend/src/components/BackstoryLayout.tsx @@ -12,13 +12,13 @@ import { SxProps, Theme } from '@mui/material'; import {Header} from './Header'; -import { Scrollable } from '../../Components/Scrollable'; +import { Scrollable } from './Scrollable'; import { Footer } from './Footer'; -import { Snack, SetSnackType } from '../../Components/Snack'; +import { Snack, SetSnackType } from './Snack'; import { useUser } from './UserContext'; -import { User } from '../../types/types'; +import { User } from '../types/types'; import { getBackstoryDynamicRoutes } from './BackstoryRoutes'; -import { LoadingComponent } from "../Components/LoadingComponent"; +import { LoadingComponent } from "./LoadingComponent"; type NavigationLinkType = { name: string; diff --git a/frontend/src/NewApp/Components/BackstoryRoutes.tsx b/frontend/src/components/BackstoryRoutes.tsx similarity index 85% rename from frontend/src/NewApp/Components/BackstoryRoutes.tsx rename to frontend/src/components/BackstoryRoutes.tsx index 4a3f21f..1633d2b 100644 --- a/frontend/src/NewApp/Components/BackstoryRoutes.tsx +++ b/frontend/src/components/BackstoryRoutes.tsx @@ -3,22 +3,22 @@ import { Route } from "react-router-dom"; import { useUser } from "./UserContext"; import { Box, Typography, Container, Paper } from '@mui/material'; -import { BackstoryPageProps } from '../../Components/BackstoryTab'; +import { BackstoryPageProps } from './BackstoryTab'; import { ConversationHandle } from './Conversation'; -import { User } from '../../types/types'; +import { User } from '../types/types'; -import { ChatPage } from '../Pages/ChatPage'; -import { ResumeBuilderPage } from '../Pages/ResumeBuilderPage'; -import { DocsPage } from '../Pages/DocsPage'; -import { CreateProfilePage } from '../Pages/CreateProfilePage'; -import { VectorVisualizerPage } from 'Pages/VectorVisualizerPage'; -import { HomePage } from '../Pages/HomePage'; -import { BetaPage } from '../Pages/BetaPage'; -import { CandidateListingPage } from '../Pages/CandidateListingPage'; -import { JobAnalysisPage } from '../Pages/JobAnalysisPage'; -import { DemoComponent } from "NewApp/Pages/DemoComponent"; -import { GenerateCandidate } from "NewApp/Pages/GenerateCandidate"; -import { ControlsPage } from '../../Pages/ControlsPage'; +import { ChatPage } from '../pages/ChatPage'; +import { ResumeBuilderPage } from '../pages/ResumeBuilderPage'; +import { DocsPage } from '../pages/DocsPage'; +import { CreateProfilePage } from '../pages/CreateProfilePage'; +import { VectorVisualizerPage } from '../pages/VectorVisualizerPage'; +import { HomePage } from '../pages/HomePage'; +import { BetaPage } from '../pages/BetaPage'; +import { CandidateListingPage } from '../pages/CandidateListingPage'; +import { JobAnalysisPage } from '../pages/JobAnalysisPage'; +import { DemoComponent } from "pages/DemoComponent"; +import { GenerateCandidate } from "pages/GenerateCandidate"; +import { ControlsPage } from '../pages/ControlsPage'; const DashboardPage = () => (Dashboard); const ProfilePage = () => (Profile); diff --git a/frontend/src/Components/BackstoryTab.tsx b/frontend/src/components/BackstoryTab.tsx similarity index 94% rename from frontend/src/Components/BackstoryTab.tsx rename to frontend/src/components/BackstoryTab.tsx index a823621..22bcf51 100644 --- a/frontend/src/Components/BackstoryTab.tsx +++ b/frontend/src/components/BackstoryTab.tsx @@ -1,7 +1,7 @@ import React, { ReactElement, JSXElementConstructor } from 'react'; import Box from '@mui/material/Box'; import { SxProps, Theme } from '@mui/material'; -import { ChatSubmitQueryInterface } from '../NewApp/Components/ChatQuery'; +import { ChatSubmitQueryInterface } from './ChatQuery'; import { SetSnackType } from './Snack'; interface BackstoryElementProps { diff --git a/frontend/src/Components/BackstoryTextField.css b/frontend/src/components/BackstoryTextField.css similarity index 100% rename from frontend/src/Components/BackstoryTextField.css rename to frontend/src/components/BackstoryTextField.css diff --git a/frontend/src/Components/BackstoryTextField.tsx b/frontend/src/components/BackstoryTextField.tsx similarity index 100% rename from frontend/src/Components/BackstoryTextField.tsx rename to frontend/src/components/BackstoryTextField.tsx diff --git a/frontend/src/NewApp/Components/Beta.css b/frontend/src/components/Beta.css similarity index 100% rename from frontend/src/NewApp/Components/Beta.css rename to frontend/src/components/Beta.css diff --git a/frontend/src/NewApp/Components/Beta.tsx b/frontend/src/components/Beta.tsx similarity index 100% rename from frontend/src/NewApp/Components/Beta.tsx rename to frontend/src/components/Beta.tsx diff --git a/frontend/src/NewApp/Components/CandidateInfo.tsx b/frontend/src/components/CandidateInfo.tsx similarity index 97% rename from frontend/src/NewApp/Components/CandidateInfo.tsx rename to frontend/src/components/CandidateInfo.tsx index 5b270b2..9c4cd61 100644 --- a/frontend/src/NewApp/Components/CandidateInfo.tsx +++ b/frontend/src/components/CandidateInfo.tsx @@ -10,8 +10,8 @@ import { import { useMediaQuery } from '@mui/material'; import { useNavigate } from 'react-router-dom'; import { useUser } from "./UserContext"; -import { Candidate } from '../../types/types'; -import { CopyBubble } from "../../Components/CopyBubble"; +import { Candidate } from '../types/types'; +import { CopyBubble } from "./CopyBubble"; interface CandidateInfoProps { sessionId: string; diff --git a/frontend/src/NewApp/Components/ChatQuery.tsx b/frontend/src/components/ChatQuery.tsx similarity index 94% rename from frontend/src/NewApp/Components/ChatQuery.tsx rename to frontend/src/components/ChatQuery.tsx index fd571ce..ccf6511 100644 --- a/frontend/src/NewApp/Components/ChatQuery.tsx +++ b/frontend/src/components/ChatQuery.tsx @@ -1,7 +1,7 @@ import Box from '@mui/material/Box'; import Button from '@mui/material/Button'; -import { Query } from "../../types/types"; +import { Query } from "../types/types"; type ChatSubmitQueryInterface = (query: Query) => void; diff --git a/frontend/src/NewApp/Components/Conversation.css b/frontend/src/components/Conversation.css similarity index 100% rename from frontend/src/NewApp/Components/Conversation.css rename to frontend/src/components/Conversation.css diff --git a/frontend/src/NewApp/Components/Conversation.tsx b/frontend/src/components/Conversation.tsx similarity index 97% rename from frontend/src/NewApp/Components/Conversation.tsx rename to frontend/src/components/Conversation.tsx index 417ff59..3d9d701 100644 --- a/frontend/src/NewApp/Components/Conversation.tsx +++ b/frontend/src/components/Conversation.tsx @@ -9,13 +9,13 @@ import CancelIcon from '@mui/icons-material/Cancel'; import { SxProps, Theme } from '@mui/material'; import PropagateLoader from "react-spinners/PropagateLoader"; -import { Message, MessageList, BackstoryMessage, MessageRoles } from '../../Components/Message'; -import { DeleteConfirmation } from '../../Components/DeleteConfirmation'; -import { Query } from '../../types/types'; -import { BackstoryTextField, BackstoryTextFieldRef } from '../../Components/BackstoryTextField'; -import { BackstoryElementProps } from '../../Components/BackstoryTab'; -import { connectionBase } from '../../Global'; -import { useUser } from "../Components/UserContext"; +import { Message, MessageList, BackstoryMessage, MessageRoles } from './Message'; +import { DeleteConfirmation } from './DeleteConfirmation'; +import { Query } from '../types/types'; +import { BackstoryTextField, BackstoryTextFieldRef } from './BackstoryTextField'; +import { BackstoryElementProps } from './BackstoryTab'; +import { connectionBase } from '../Global'; +import { useUser } from "./UserContext"; import { streamQueryResponse, StreamQueryController } from './streamQueryResponse'; import './Conversation.css'; diff --git a/frontend/src/Components/CopyBubble.tsx b/frontend/src/components/CopyBubble.tsx similarity index 100% rename from frontend/src/Components/CopyBubble.tsx rename to frontend/src/components/CopyBubble.tsx diff --git a/frontend/src/Components/DeleteConfirmation.tsx b/frontend/src/components/DeleteConfirmation.tsx similarity index 100% rename from frontend/src/Components/DeleteConfirmation.tsx rename to frontend/src/components/DeleteConfirmation.tsx diff --git a/frontend/src/NewApp/Components/Document.tsx b/frontend/src/components/Document.tsx similarity index 84% rename from frontend/src/NewApp/Components/Document.tsx rename to frontend/src/components/Document.tsx index f06ff2d..1cc462e 100644 --- a/frontend/src/NewApp/Components/Document.tsx +++ b/frontend/src/components/Document.tsx @@ -1,9 +1,5 @@ import React, { useState, useEffect } from 'react'; -import { Box, Typography } from '@mui/material'; - -import { Message } from '../../Components/Message'; -import { ChatBubble } from '../../Components/ChatBubble'; -import { BackstoryElementProps } from '../../Components/BackstoryTab'; +import { BackstoryElementProps } from './BackstoryTab'; import { StyledMarkdown } from './StyledMarkdown'; interface DocumentProps extends BackstoryElementProps { diff --git a/frontend/src/Components/ExpandMore.tsx b/frontend/src/components/ExpandMore.tsx similarity index 100% rename from frontend/src/Components/ExpandMore.tsx rename to frontend/src/components/ExpandMore.tsx diff --git a/frontend/src/NewApp/Components/Footer.tsx b/frontend/src/components/Footer.tsx similarity index 100% rename from frontend/src/NewApp/Components/Footer.tsx rename to frontend/src/components/Footer.tsx diff --git a/frontend/src/NewApp/Components/GenerateImage.tsx b/frontend/src/components/GenerateImage.tsx similarity index 89% rename from frontend/src/NewApp/Components/GenerateImage.tsx rename to frontend/src/components/GenerateImage.tsx index 0f78a2d..1a96bbc 100644 --- a/frontend/src/NewApp/Components/GenerateImage.tsx +++ b/frontend/src/components/GenerateImage.tsx @@ -8,19 +8,19 @@ import IconButton from '@mui/material/IconButton'; import CancelIcon from '@mui/icons-material/Cancel'; import SendIcon from '@mui/icons-material/Send'; import PropagateLoader from 'react-spinners/PropagateLoader'; -import { CandidateInfo } from '../Components/CandidateInfo'; -import { Query } from '../../types/types' -import { Quote } from 'NewApp/Components/Quote'; -import { streamQueryResponse, StreamQueryController } from '../Components/streamQueryResponse'; +import { CandidateInfo } from './CandidateInfo'; +import { Query } from '../types/types' +import { Quote } from 'components/Quote'; +import { streamQueryResponse, StreamQueryController } from './streamQueryResponse'; import { connectionBase } from 'Global'; -import { User } from '../../types/types'; -import { BackstoryElementProps } from 'Components/BackstoryTab'; -import { BackstoryTextField, BackstoryTextFieldRef } from 'Components/BackstoryTextField'; +import { User } from '../types/types'; +import { BackstoryElementProps } from 'components/BackstoryTab'; +import { BackstoryTextField, BackstoryTextFieldRef } from 'components/BackstoryTextField'; import { jsonrepair } from 'jsonrepair'; -import { StyledMarkdown } from 'NewApp/Components/StyledMarkdown'; -import { Scrollable } from 'Components/Scrollable'; -import { Pulse } from 'NewApp/Components/Pulse'; -import { useUser } from '../Components/UserContext'; +import { StyledMarkdown } from 'components/StyledMarkdown'; +import { Scrollable } from './Scrollable'; +import { Pulse } from 'components/Pulse'; +import { useUser } from './UserContext'; interface GenerateImageProps extends BackstoryElementProps { prompt: string diff --git a/frontend/src/NewApp/Components/Header.css b/frontend/src/components/Header.css similarity index 100% rename from frontend/src/NewApp/Components/Header.css rename to frontend/src/components/Header.css diff --git a/frontend/src/NewApp/Components/Header.tsx b/frontend/src/components/Header.tsx similarity index 98% rename from frontend/src/NewApp/Components/Header.tsx rename to frontend/src/components/Header.tsx index 953e6d4..9c61da3 100644 --- a/frontend/src/NewApp/Components/Header.tsx +++ b/frontend/src/components/Header.tsx @@ -35,9 +35,9 @@ import { NavigationLinkType } from './BackstoryLayout'; import { Beta } from './Beta'; import './Header.css'; import { useUser } from './UserContext'; -import { Candidate, Employer } from '../../types/types'; -import { SetSnackType } from '../../Components/Snack'; -import { CopyBubble } from '../../Components/CopyBubble'; +import { Candidate, Employer } from '../types/types'; +import { SetSnackType } from './Snack'; +import { CopyBubble } from './CopyBubble'; // Styled components const StyledAppBar = styled(AppBar, { diff --git a/frontend/src/NewApp/Components/JobMatchAnalysis.tsx b/frontend/src/components/JobMatchAnalysis.tsx similarity index 100% rename from frontend/src/NewApp/Components/JobMatchAnalysis.tsx rename to frontend/src/components/JobMatchAnalysis.tsx diff --git a/frontend/src/NewApp/Components/LoadingComponent.tsx b/frontend/src/components/LoadingComponent.tsx similarity index 100% rename from frontend/src/NewApp/Components/LoadingComponent.tsx rename to frontend/src/components/LoadingComponent.tsx diff --git a/frontend/src/Components/Mermaid.tsx b/frontend/src/components/Mermaid.tsx similarity index 100% rename from frontend/src/Components/Mermaid.tsx rename to frontend/src/components/Mermaid.tsx diff --git a/frontend/src/Components/Message.tsx b/frontend/src/components/Message.tsx similarity index 65% rename from frontend/src/Components/Message.tsx rename to frontend/src/components/Message.tsx index ec05219..4106dc7 100644 --- a/frontend/src/Components/Message.tsx +++ b/frontend/src/components/Message.tsx @@ -10,18 +10,22 @@ import TableCell from '@mui/material/TableCell'; import TableContainer from '@mui/material/TableContainer'; import TableHead from '@mui/material/TableHead'; import TableRow from '@mui/material/TableRow'; -import Box from '@mui/material/Box'; import Button from '@mui/material/Button'; import CardContent from '@mui/material/CardContent'; import CardActions from '@mui/material/CardActions'; import Collapse from '@mui/material/Collapse'; -import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import { ExpandMore } from './ExpandMore'; -import { SxProps, Theme } from '@mui/material'; import JsonView from '@uiw/react-json-view'; +import React from 'react'; +import { Box } from '@mui/material'; +import { useTheme } from '@mui/material/styles'; +import { SxProps, Theme } from '@mui/material'; +import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; +import LocationSearchingIcon from '@mui/icons-material/LocationSearching'; -import { ChatBubble } from './ChatBubble'; -import { StyledMarkdown } from '../NewApp/Components/StyledMarkdown'; +import { ErrorOutline, InfoOutline, Memory, Psychology, /* Stream, */ } from '@mui/icons-material'; + +import { StyledMarkdown } from './StyledMarkdown'; import { VectorVisualizer } from './VectorVisualizer'; import { SetSnackType } from './Snack'; @@ -72,6 +76,213 @@ type BackstoryMessage = { expandable?: boolean, }; + +interface ChatBubbleProps { + role: MessageRoles, + isInfo?: boolean; + children: React.ReactNode; + sx?: SxProps; + className?: string; + title?: string; + expanded?: boolean; + expandable?: boolean; + onExpand?: (open: boolean) => void; +} + +function ChatBubble(props: ChatBubbleProps) { + const { role, children, sx, className, title, onExpand, expandable, expanded } = props; + + const theme = useTheme(); + + const defaultRadius = '16px'; + const defaultStyle = { + padding: theme.spacing(1, 2), + fontSize: '0.875rem', + alignSelf: 'flex-start', + maxWidth: '100%', + minWidth: '100%', + height: 'fit-content', + '& > *': { + color: 'inherit', + overflow: 'hidden', + m: 0, + }, + '& > :last-child': { + mb: 0, + m: 0, + p: 0, + }, + }; + + const styles: any = { + assistant: { + ...defaultStyle, + backgroundColor: theme.palette.primary.main, + border: `1px solid ${theme.palette.secondary.main}`, + borderRadius: `${defaultRadius} ${defaultRadius} ${defaultRadius} 0`, + color: theme.palette.primary.contrastText, + }, + content: { + ...defaultStyle, + backgroundColor: '#F5F2EA', + border: `1px solid ${theme.palette.custom.highlight}`, + borderRadius: 0, + alignSelf: 'center', + color: theme.palette.text.primary, + padding: '8px 8px', + marginBottom: '0px', + boxShadow: '0 2px 4px rgba(0, 0, 0, 0.05)', + fontSize: '0.9rem', + lineHeight: '1.3', + fontFamily: theme.typography.fontFamily, + }, + error: { + ...defaultStyle, + backgroundColor: '#F8E7E7', + border: `1px solid #D83A3A`, + borderRadius: defaultRadius, + maxWidth: '90%', + minWidth: '90%', + alignSelf: 'center', + color: '#8B2525', + padding: '10px 16px', + boxShadow: '0 1px 3px rgba(216, 58, 58, 0.15)', + }, + 'fact-check': 'qualifications', + 'job-description': 'content', + 'job-requirements': 'qualifications', + info: { + ...defaultStyle, + backgroundColor: '#BFD8D8', + border: `1px solid ${theme.palette.secondary.main}`, + borderRadius: defaultRadius, + color: theme.palette.text.primary, + opacity: 0.95, + }, + processing: 'status', + qualifications: { + ...defaultStyle, + backgroundColor: theme.palette.primary.light, + border: `1px solid ${theme.palette.secondary.main}`, + borderRadius: `${defaultRadius} ${defaultRadius} ${defaultRadius} 0`, + color: theme.palette.primary.contrastText, + }, + resume: 'content', + searching: 'status', + status: { + ...defaultStyle, + backgroundColor: 'rgba(74, 122, 125, 0.15)', + border: `1px solid ${theme.palette.secondary.light}`, + borderRadius: '4px', + maxWidth: '75%', + minWidth: '75%', + alignSelf: 'center', + color: theme.palette.secondary.dark, + fontWeight: 500, + fontSize: '0.95rem', + padding: '8px 12px', + opacity: 0.9, + transition: 'opacity 0.3s ease-in-out', + }, + streaming: 'assistant', + system: { + ...defaultStyle, + backgroundColor: '#EDEAE0', + border: `1px dashed ${theme.palette.custom.highlight}`, + borderRadius: defaultRadius, + maxWidth: '90%', + minWidth: '90%', + alignSelf: 'center', + color: theme.palette.text.primary, + fontStyle: 'italic', + }, + thinking: 'status', + user: { + ...defaultStyle, + backgroundColor: theme.palette.background.default, + border: `1px solid ${theme.palette.custom.highlight}`, + borderRadius: `${defaultRadius} ${defaultRadius} 0 ${defaultRadius}`, + alignSelf: 'flex-end', + color: theme.palette.primary.main, + }, + }; + + // Resolve string references in styles + for (const [key, value] of Object.entries(styles)) { + if (typeof value === 'string') { + styles[key] = styles[value]; + } + } + + const icons: any = { + error: , + info: , + processing: , + searching: , + thinking: , + tooling: , + }; + + // Render Accordion for expandable content + if (expandable || title) { + // Determine if Accordion is controlled + const isControlled = typeof expanded === 'boolean' && typeof onExpand === 'function'; + return ( + { + if (isControlled && onExpand) { + onExpand(newExpanded); // Call onExpand with new state + } + }} + sx={{ ...styles[role], ...sx }} + > + } + slotProps={{ + content: { + sx: { + fontWeight: 'bold', + fontSize: '1.1rem', + m: 0, + p: 0, + display: 'flex', + justifyItems: 'center', + }, + }, + }} + > + {title || ''} + + + {children} + + + ); + } + + // Render non-expandable content + return ( + + {icons[role] !== undefined && icons[role]} + + {children} + + + ); +} + interface MessageMetaData { query?: { query_embedding: number[]; diff --git a/frontend/src/NewApp/Components/Pulse.tsx b/frontend/src/components/Pulse.tsx similarity index 100% rename from frontend/src/NewApp/Components/Pulse.tsx rename to frontend/src/components/Pulse.tsx diff --git a/frontend/src/NewApp/Components/Quote.tsx b/frontend/src/components/Quote.tsx similarity index 100% rename from frontend/src/NewApp/Components/Quote.tsx rename to frontend/src/components/Quote.tsx diff --git a/frontend/src/Components/Scrollable.tsx b/frontend/src/components/Scrollable.tsx similarity index 100% rename from frontend/src/Components/Scrollable.tsx rename to frontend/src/components/Scrollable.tsx diff --git a/frontend/src/Components/Snack.css b/frontend/src/components/Snack.css similarity index 100% rename from frontend/src/Components/Snack.css rename to frontend/src/components/Snack.css diff --git a/frontend/src/Components/Snack.tsx b/frontend/src/components/Snack.tsx similarity index 100% rename from frontend/src/Components/Snack.tsx rename to frontend/src/components/Snack.tsx diff --git a/frontend/src/NewApp/Components/StyledMarkdown.css b/frontend/src/components/StyledMarkdown.css similarity index 100% rename from frontend/src/NewApp/Components/StyledMarkdown.css rename to frontend/src/components/StyledMarkdown.css diff --git a/frontend/src/NewApp/Components/StyledMarkdown.tsx b/frontend/src/components/StyledMarkdown.tsx similarity index 96% rename from frontend/src/NewApp/Components/StyledMarkdown.tsx rename to frontend/src/components/StyledMarkdown.tsx index 9c3fa78..4e0880a 100644 --- a/frontend/src/NewApp/Components/StyledMarkdown.tsx +++ b/frontend/src/components/StyledMarkdown.tsx @@ -6,13 +6,13 @@ import { ChatQuery } from './ChatQuery'; import Box from '@mui/material/Box'; import JsonView from '@uiw/react-json-view'; import { vscodeTheme } from '@uiw/react-json-view/vscode'; -import { Mermaid } from '../../Components/Mermaid'; -import { Scrollable } from '../../Components/Scrollable'; +import { Mermaid } from './Mermaid'; +import { Scrollable } from './Scrollable'; import { jsonrepair } from 'jsonrepair'; import { GenerateImage } from './GenerateImage'; import './StyledMarkdown.css'; -import { BackstoryElementProps } from '../../Components/BackstoryTab'; +import { BackstoryElementProps } from './BackstoryTab'; interface StyledMarkdownProps extends BackstoryElementProps { className?: string, diff --git a/frontend/src/NewApp/Components/UserContext.tsx b/frontend/src/components/UserContext.tsx similarity index 90% rename from frontend/src/NewApp/Components/UserContext.tsx rename to frontend/src/components/UserContext.tsx index 5bfacaf..4af85b1 100644 --- a/frontend/src/NewApp/Components/UserContext.tsx +++ b/frontend/src/components/UserContext.tsx @@ -1,8 +1,8 @@ import React, { createContext, useContext, useEffect, useState } from "react"; -import { Tunables } from '../../types/types'; -import { SetSnackType } from '../../Components/Snack'; -import { connectionBase } from '../../Global'; -import { User } from '../../types/types'; +import { Tunables } from '../types/types'; +import { SetSnackType } from './Snack'; +import { connectionBase } from '../Global'; +import { User } from '../types/types'; // Define the UserInfo interface for type safety interface UserQuestion { diff --git a/frontend/src/Components/VectorVisualizer.css b/frontend/src/components/VectorVisualizer.css similarity index 100% rename from frontend/src/Components/VectorVisualizer.css rename to frontend/src/components/VectorVisualizer.css diff --git a/frontend/src/Components/VectorVisualizer.tsx b/frontend/src/components/VectorVisualizer.tsx similarity index 99% rename from frontend/src/Components/VectorVisualizer.tsx rename to frontend/src/components/VectorVisualizer.tsx index 8c5e89b..8d89953 100644 --- a/frontend/src/Components/VectorVisualizer.tsx +++ b/frontend/src/components/VectorVisualizer.tsx @@ -20,7 +20,7 @@ import { Scrollable } from './Scrollable'; import { connectionBase } from '../Global'; import './VectorVisualizer.css'; -import { BackstoryPageProps } from './BackstoryTab'; +import { BackstoryPageProps } from '../NewApp/Components/BackstoryTab'; import { relative } from 'path'; interface VectorVisualizerProps extends BackstoryPageProps { diff --git a/frontend/src/NewApp/Components/streamQueryResponse.tsx b/frontend/src/components/streamQueryResponse.tsx similarity index 97% rename from frontend/src/NewApp/Components/streamQueryResponse.tsx rename to frontend/src/components/streamQueryResponse.tsx index f010d1d..d486c3b 100644 --- a/frontend/src/NewApp/Components/streamQueryResponse.tsx +++ b/frontend/src/components/streamQueryResponse.tsx @@ -1,5 +1,5 @@ -import { BackstoryMessage } from '../../Components/Message'; -import { Query } from '../../types/types'; +import { BackstoryMessage } from './Message'; +import { Query } from '../types/types'; import { jsonrepair } from 'jsonrepair'; type StreamQueryOptions = { diff --git a/frontend/src/Components/useAutoScrollToBottom.tsx b/frontend/src/components/useAutoScrollToBottom.tsx similarity index 100% rename from frontend/src/Components/useAutoScrollToBottom.tsx rename to frontend/src/components/useAutoScrollToBottom.tsx diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx index 32e64ee..565623d 100644 --- a/frontend/src/index.tsx +++ b/frontend/src/index.tsx @@ -3,8 +3,8 @@ import ReactDOM from 'react-dom/client'; import { ThemeProvider } from '@mui/material/styles'; import { backstoryTheme } from './BackstoryTheme'; import { BrowserRouter as Router } from "react-router-dom"; -import { BackstoryApp } from './NewApp/BackstoryApp'; -import { BackstoryTestApp } from 'NewApp/TestApp'; +import { BackstoryApp } from './BackstoryApp'; +import { BackstoryTestApp } from 'TestApp'; import './index.css'; diff --git a/frontend/src/NewApp/Pages/BetaPage.tsx b/frontend/src/pages/BetaPage.tsx similarity index 99% rename from frontend/src/NewApp/Pages/BetaPage.tsx rename to frontend/src/pages/BetaPage.tsx index c8025dd..a6ea654 100644 --- a/frontend/src/NewApp/Pages/BetaPage.tsx +++ b/frontend/src/pages/BetaPage.tsx @@ -14,7 +14,7 @@ import { import { useTheme } from '@mui/material/styles'; import ConstructionIcon from '@mui/icons-material/Construction'; import RocketLaunchIcon from '@mui/icons-material/RocketLaunch'; -import { Beta } from '../Components/Beta'; +import { Beta } from '../components/Beta'; interface BetaPageProps { children?: React.ReactNode; diff --git a/frontend/src/NewApp/Pages/CandidateListingPage.tsx b/frontend/src/pages/CandidateListingPage.tsx similarity index 92% rename from frontend/src/NewApp/Pages/CandidateListingPage.tsx rename to frontend/src/pages/CandidateListingPage.tsx index f696e24..6ad12d4 100644 --- a/frontend/src/NewApp/Pages/CandidateListingPage.tsx +++ b/frontend/src/pages/CandidateListingPage.tsx @@ -3,10 +3,10 @@ import { useNavigate } from "react-router-dom"; import Button from '@mui/material/Button'; import Box from '@mui/material/Box'; -import { BackstoryPageProps } from '../../Components/BackstoryTab'; -import { CandidateInfo } from 'NewApp/Components/CandidateInfo'; -import { connectionBase } from '../../Global'; -import { Candidate } from "../../types/types"; +import { BackstoryPageProps } from '../components/BackstoryTab'; +import { CandidateInfo } from 'components/CandidateInfo'; +import { connectionBase } from '../Global'; +import { Candidate } from "../types/types"; const CandidateListingPage = (props: BackstoryPageProps) => { const navigate = useNavigate(); diff --git a/frontend/src/NewApp/Pages/ChatPage.tsx b/frontend/src/pages/ChatPage.tsx similarity index 80% rename from frontend/src/NewApp/Pages/ChatPage.tsx rename to frontend/src/pages/ChatPage.tsx index 0d60bc3..b5e8c56 100644 --- a/frontend/src/NewApp/Pages/ChatPage.tsx +++ b/frontend/src/pages/ChatPage.tsx @@ -5,15 +5,15 @@ import Box from '@mui/material/Box'; import { useTheme } from '@mui/material/styles'; import MuiMarkdown from 'mui-markdown'; -import { BackstoryPageProps } from '../../Components/BackstoryTab'; -import { Conversation, ConversationHandle } from '../Components/Conversation'; -import { ChatQuery } from '../Components/ChatQuery'; -import { MessageList } from '../../Components/Message'; -import { CandidateInfo } from 'NewApp/Components/CandidateInfo'; -import { connectionBase } from '../../Global'; -import { LoadingComponent } from 'NewApp/Components/LoadingComponent'; -import { useUser } from "../Components/UserContext"; -import { Candidate, Tunables } from "../../types/types"; +import { BackstoryPageProps } from '../components/BackstoryTab'; +import { Conversation, ConversationHandle } from '../components/Conversation'; +import { ChatQuery } from '../components/ChatQuery'; +import { MessageList } from '../components/Message'; +import { CandidateInfo } from 'components/CandidateInfo'; +import { connectionBase } from '../Global'; +import { LoadingComponent } from 'components/LoadingComponent'; +import { useUser } from "../components/UserContext"; +import { Candidate, Tunables } from "../types/types"; import { Navigate } from 'react-router-dom'; const ChatPage = forwardRef((props: BackstoryPageProps, ref) => { diff --git a/frontend/src/Pages/ControlsPage.tsx b/frontend/src/pages/ControlsPage.tsx similarity index 99% rename from frontend/src/Pages/ControlsPage.tsx rename to frontend/src/pages/ControlsPage.tsx index 2c2d94a..495a0da 100644 --- a/frontend/src/Pages/ControlsPage.tsx +++ b/frontend/src/pages/ControlsPage.tsx @@ -15,7 +15,7 @@ import Typography from '@mui/material/Typography'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import { connectionBase } from '../Global'; -import { BackstoryPageProps } from '../Components/BackstoryTab'; +import { BackstoryPageProps } from '../components/BackstoryTab'; interface ServerTunables { system_prompt: string, diff --git a/frontend/src/NewApp/Pages/Conversation.png b/frontend/src/pages/Conversation.png similarity index 100% rename from frontend/src/NewApp/Pages/Conversation.png rename to frontend/src/pages/Conversation.png diff --git a/frontend/src/NewApp/Pages/Conversation.svg b/frontend/src/pages/Conversation.svg similarity index 100% rename from frontend/src/NewApp/Pages/Conversation.svg rename to frontend/src/pages/Conversation.svg diff --git a/frontend/src/NewApp/Pages/CreateProfilePage.tsx b/frontend/src/pages/CreateProfilePage.tsx similarity index 99% rename from frontend/src/NewApp/Pages/CreateProfilePage.tsx rename to frontend/src/pages/CreateProfilePage.tsx index e781c85..11175fb 100644 --- a/frontend/src/NewApp/Pages/CreateProfilePage.tsx +++ b/frontend/src/pages/CreateProfilePage.tsx @@ -21,7 +21,7 @@ import { import { styled } from '@mui/material/styles'; import { CloudUpload, PhotoCamera } from '@mui/icons-material'; import { useTheme } from '@mui/material/styles'; -import { Beta } from '../Components/Beta'; +import { Beta } from '../components/Beta'; // Interfaces interface ProfileFormData { diff --git a/frontend/src/NewApp/Pages/DemoComponent.tsx b/frontend/src/pages/DemoComponent.tsx similarity index 98% rename from frontend/src/NewApp/Pages/DemoComponent.tsx rename to frontend/src/pages/DemoComponent.tsx index 279ffaf..f0df690 100644 --- a/frontend/src/NewApp/Pages/DemoComponent.tsx +++ b/frontend/src/pages/DemoComponent.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import {JobMatchAnalysis} from '../Components/JobMatchAnalysis'; +import { JobMatchAnalysis } from '../components/JobMatchAnalysis'; // Mock data and functions to simulate your backend const mockRequirements = [ diff --git a/frontend/src/NewApp/Pages/DocsPage.tsx b/frontend/src/pages/DocsPage.tsx similarity index 99% rename from frontend/src/NewApp/Pages/DocsPage.tsx rename to frontend/src/pages/DocsPage.tsx index 4409183..56f25cf 100644 --- a/frontend/src/NewApp/Pages/DocsPage.tsx +++ b/frontend/src/pages/DocsPage.tsx @@ -32,8 +32,8 @@ import PaletteIcon from '@mui/icons-material/Palette'; import AnalyticsIcon from '@mui/icons-material/Analytics'; import ViewQuiltIcon from '@mui/icons-material/ViewQuilt'; -import { Document } from '../Components/Document'; -import { BackstoryPageProps } from '../../Components/BackstoryTab'; +import { Document } from '../components/Document'; +import { BackstoryPageProps } from '../components/BackstoryTab'; import { BackstoryUIOverviewPage } from './documents/BackstoryUIOverviewPage'; import { BackstoryAppAnalysisPage } from './documents/BackstoryAppAnalysisPage'; import { BackstoryThemeVisualizerPage } from './documents/BackstoryThemeVisualizerPage'; diff --git a/frontend/src/NewApp/Pages/GenerateCandidate.tsx b/frontend/src/pages/GenerateCandidate.tsx similarity index 96% rename from frontend/src/NewApp/Pages/GenerateCandidate.tsx rename to frontend/src/pages/GenerateCandidate.tsx index d20e78b..7070291 100644 --- a/frontend/src/NewApp/Pages/GenerateCandidate.tsx +++ b/frontend/src/pages/GenerateCandidate.tsx @@ -8,18 +8,18 @@ import IconButton from '@mui/material/IconButton'; import CancelIcon from '@mui/icons-material/Cancel'; import SendIcon from '@mui/icons-material/Send'; import PropagateLoader from 'react-spinners/PropagateLoader'; -import { CandidateInfo } from '../Components/CandidateInfo'; -import { Query } from '../../types/types' -import { Quote } from 'NewApp/Components/Quote'; -import { streamQueryResponse, StreamQueryController } from '../Components/streamQueryResponse'; +import { CandidateInfo } from '../components/CandidateInfo'; +import { Query } from '../types/types' +import { Quote } from 'components/Quote'; +import { streamQueryResponse, StreamQueryController } from '../components/streamQueryResponse'; import { connectionBase } from 'Global'; -import { Candidate } from '../../types/types'; -import { BackstoryElementProps } from 'Components/BackstoryTab'; -import { BackstoryTextField, BackstoryTextFieldRef } from 'Components/BackstoryTextField'; +import { Candidate } from '../types/types'; +import { BackstoryElementProps } from 'components/BackstoryTab'; +import { BackstoryTextField, BackstoryTextFieldRef } from 'components/BackstoryTextField'; import { jsonrepair } from 'jsonrepair'; -import { StyledMarkdown } from 'NewApp/Components/StyledMarkdown'; -import { Scrollable } from 'Components/Scrollable'; -import { Pulse } from 'NewApp/Components/Pulse'; +import { StyledMarkdown } from 'components/StyledMarkdown'; +import { Scrollable } from '../components/Scrollable'; +import { Pulse } from 'components/Pulse'; const emptyUser: Candidate = { description: "[blank]", diff --git a/frontend/src/NewApp/Pages/HomePage.tsx b/frontend/src/pages/HomePage.tsx similarity index 100% rename from frontend/src/NewApp/Pages/HomePage.tsx rename to frontend/src/pages/HomePage.tsx diff --git a/frontend/src/NewApp/Pages/JobAnalysisPage.tsx b/frontend/src/pages/JobAnalysisPage.tsx similarity index 99% rename from frontend/src/NewApp/Pages/JobAnalysisPage.tsx rename to frontend/src/pages/JobAnalysisPage.tsx index 7ae2be1..9832a9e 100644 --- a/frontend/src/NewApp/Pages/JobAnalysisPage.tsx +++ b/frontend/src/pages/JobAnalysisPage.tsx @@ -33,7 +33,7 @@ import WorkIcon from '@mui/icons-material/Work'; import AssessmentIcon from '@mui/icons-material/Assessment'; import DescriptionIcon from '@mui/icons-material/Description'; import FileUploadIcon from '@mui/icons-material/FileUpload'; -import {JobMatchAnalysis} from '../Components/JobMatchAnalysis'; +import { JobMatchAnalysis } from '../components/JobMatchAnalysis'; // Mock types for our application interface Candidate { diff --git a/frontend/src/Pages/LoadingPage.tsx b/frontend/src/pages/LoadingPage.tsx similarity index 79% rename from frontend/src/Pages/LoadingPage.tsx rename to frontend/src/pages/LoadingPage.tsx index c768aed..6c69d06 100644 --- a/frontend/src/Pages/LoadingPage.tsx +++ b/frontend/src/pages/LoadingPage.tsx @@ -1,6 +1,6 @@ import Box from '@mui/material/Box'; -import { BackstoryPageProps } from '../Components/BackstoryTab'; -import { BackstoryMessage, Message } from '../Components/Message'; +import { BackstoryPageProps } from '../components/BackstoryTab'; +import { BackstoryMessage, Message } from '../components/Message'; const LoadingPage = (props: BackstoryPageProps) => { const backstoryPreamble: BackstoryMessage = { diff --git a/frontend/src/NewApp/Pages/RegisterPage.tsx b/frontend/src/pages/RegisterPage.tsx similarity index 100% rename from frontend/src/NewApp/Pages/RegisterPage.tsx rename to frontend/src/pages/RegisterPage.tsx diff --git a/frontend/src/NewApp/Pages/ResumeBuilderPage.css b/frontend/src/pages/ResumeBuilderPage.css similarity index 100% rename from frontend/src/NewApp/Pages/ResumeBuilderPage.css rename to frontend/src/pages/ResumeBuilderPage.css diff --git a/frontend/src/NewApp/Pages/ResumeBuilderPage.tsx b/frontend/src/pages/ResumeBuilderPage.tsx similarity index 97% rename from frontend/src/NewApp/Pages/ResumeBuilderPage.tsx rename to frontend/src/pages/ResumeBuilderPage.tsx index c2b8ffa..e5b02ec 100644 --- a/frontend/src/NewApp/Pages/ResumeBuilderPage.tsx +++ b/frontend/src/pages/ResumeBuilderPage.tsx @@ -6,11 +6,11 @@ import { } from '@mui/material'; import { SxProps } from '@mui/material'; -import { ChatQuery } from '../Components/ChatQuery'; -import { MessageList, BackstoryMessage } from '../../Components/Message'; -import { Conversation } from '../Components/Conversation'; -import { BackstoryPageProps } from '../../Components/BackstoryTab'; -import { Query } from "../../types/types"; +import { ChatQuery } from '../components/ChatQuery'; +import { MessageList, BackstoryMessage } from '../components/Message'; +import { Conversation } from '../components/Conversation'; +import { BackstoryPageProps } from '../components/BackstoryTab'; +import { Query } from "../types/types"; import './ResumeBuilderPage.css'; diff --git a/frontend/src/Pages/VectorVisualizerPage.css b/frontend/src/pages/VectorVisualizerPage.css similarity index 100% rename from frontend/src/Pages/VectorVisualizerPage.css rename to frontend/src/pages/VectorVisualizerPage.css diff --git a/frontend/src/Pages/VectorVisualizerPage.tsx b/frontend/src/pages/VectorVisualizerPage.tsx similarity index 75% rename from frontend/src/Pages/VectorVisualizerPage.tsx rename to frontend/src/pages/VectorVisualizerPage.tsx index 1a025f4..5694107 100644 --- a/frontend/src/Pages/VectorVisualizerPage.tsx +++ b/frontend/src/pages/VectorVisualizerPage.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import { VectorVisualizer } from '../Components/VectorVisualizer'; -import { BackstoryPageProps } from '../Components/BackstoryTab'; +import { VectorVisualizer } from '../components/VectorVisualizer'; +import { BackstoryPageProps } from '../components/BackstoryTab'; import './VectorVisualizerPage.css'; diff --git a/frontend/src/NewApp/Pages/documents/BackstoryAppAnalysisPage.tsx b/frontend/src/pages/documents/BackstoryAppAnalysisPage.tsx similarity index 100% rename from frontend/src/NewApp/Pages/documents/BackstoryAppAnalysisPage.tsx rename to frontend/src/pages/documents/BackstoryAppAnalysisPage.tsx diff --git a/frontend/src/NewApp/Pages/documents/BackstoryThemeVisualizerPage.tsx b/frontend/src/pages/documents/BackstoryThemeVisualizerPage.tsx similarity index 100% rename from frontend/src/NewApp/Pages/documents/BackstoryThemeVisualizerPage.tsx rename to frontend/src/pages/documents/BackstoryThemeVisualizerPage.tsx diff --git a/frontend/src/NewApp/Pages/documents/BackstoryUIOverviewPage.tsx b/frontend/src/pages/documents/BackstoryUIOverviewPage.tsx similarity index 100% rename from frontend/src/NewApp/Pages/documents/BackstoryUIOverviewPage.tsx rename to frontend/src/pages/documents/BackstoryUIOverviewPage.tsx diff --git a/frontend/src/NewApp/Pages/documents/MockupPage.tsx b/frontend/src/pages/documents/MockupPage.tsx similarity index 100% rename from frontend/src/NewApp/Pages/documents/MockupPage.tsx rename to frontend/src/pages/documents/MockupPage.tsx diff --git a/frontend/src/NewApp/Pages/documents/UserManagement.tsx b/frontend/src/pages/documents/UserManagement.tsx similarity index 100% rename from frontend/src/NewApp/Pages/documents/UserManagement.tsx rename to frontend/src/pages/documents/UserManagement.tsx diff --git a/frontend/src/NewApp/routes/UserRoute.tsx b/frontend/src/routes/UserRoute.tsx similarity index 87% rename from frontend/src/NewApp/routes/UserRoute.tsx rename to frontend/src/routes/UserRoute.tsx index 4a012ec..1284ad9 100644 --- a/frontend/src/NewApp/routes/UserRoute.tsx +++ b/frontend/src/routes/UserRoute.tsx @@ -1,11 +1,11 @@ import React, { useEffect } from "react"; import { Navigate, useParams, useNavigate, useLocation } from "react-router-dom"; -import { useUser } from "../Components/UserContext"; -import { User } from "../../types/types"; +import { useUser } from "../components/UserContext"; +import { User } from "../types/types"; import { Box } from "@mui/material"; -import { connectionBase } from "../../Global"; -import { SetSnackType } from '../../Components/Snack'; -import { LoadingComponent } from "../Components/LoadingComponent"; +import { connectionBase } from "../Global"; +import { SetSnackType } from '../components/Snack'; +import { LoadingComponent } from "../components/LoadingComponent"; interface UserRouteProps { sessionId?: string | null; diff --git a/src/server.py b/src/server.py index 1264352..1ea088e 100644 --- a/src/server.py +++ b/src/server.py @@ -983,6 +983,7 @@ class WebServer: except Exception as e: raise HTTPException(status_code=503, detail=f"Redis connection failed: {e}") + @self.app.get("/api/redis/stats") async def redis_stats(redis_client: redis.Redis = Depends(self.get_redis)): try: