Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions backend/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import spacy

# Load spaCy model
nlp = spacy.load("en_core_web_sm")

# List of valid domains
valid_domains = [
"web development", "data science", "data analytics",
"cybersecurity", "game development", "blockchain", "machine learning"
]

# Function to find the best match
def find_best_match_spacy(user_input):
input_doc = nlp(user_input)
domain_docs = [nlp(domain) for domain in valid_domains]

# Compute similarity scores
similarities = [input_doc.similarity(domain_doc) for domain_doc in domain_docs]

# Get the top 3 matches
sorted_indices = sorted(range(len(similarities)), key=lambda i: similarities[i], reverse=True)
suggestions = [(valid_domains[i], similarities[i]) for i in sorted_indices[:3]]
return suggestions

# Main script
user_input = input("Enter your domain of interest: ").strip().lower()
suggestions = find_best_match_spacy(user_input)

print(f"Did you mean one of these?")
for i, (suggestion, score) in enumerate(suggestions, 1):
print(f"{i}. {suggestion} (Similarity: {score:.2f})")

choice = input("Enter the number of your choice (or type 'none' to re-enter): ").strip().lower()
if choice.isdigit() and 1 <= int(choice) <= len(suggestions):
corrected_input = suggestions[int(choice) - 1][0]
print(f"You selected: {corrected_input}")
else:
print("Please re-enter your domain of interest.")
16 changes: 16 additions & 0 deletions frontend/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ body {
--chart-4: 43 74% 66%;
--chart-5: 27 87% 67%;
--radius: 0.5rem;
--sidebar-background: 0 0% 98%;
--sidebar-foreground: 240 5.3% 26.1%;
--sidebar-primary: 240 5.9% 10%;
--sidebar-primary-foreground: 0 0% 98%;
--sidebar-accent: 240 4.8% 95.9%;
--sidebar-accent-foreground: 240 5.9% 10%;
--sidebar-border: 220 13% 91%;
--sidebar-ring: 217.2 91.2% 59.8%;
}
.dark {
--background: 240 10% 3.9%;
Expand All @@ -65,6 +73,14 @@ body {
--chart-3: 30 80% 55%;
--chart-4: 280 65% 60%;
--chart-5: 340 75% 55%;
--sidebar-background: 240 5.9% 10%;
--sidebar-foreground: 240 4.8% 95.9%;
--sidebar-primary: 224.3 76.3% 48%;
--sidebar-primary-foreground: 0 0% 100%;
--sidebar-accent: 240 3.7% 15.9%;
--sidebar-accent-foreground: 240 4.8% 95.9%;
--sidebar-border: 240 3.7% 15.9%;
--sidebar-ring: 217.2 91.2% 59.8%;
}
}

Expand Down
12 changes: 10 additions & 2 deletions frontend/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { SidebarProvider } from '@/components/ui/sidebar'
import { AppSidebar } from '@/components/sidebar'
import type { Metadata } from "next";
import localFont from "next/font/local";
import "./globals.css";

export const metadata: Metadata = {
Expand All @@ -15,7 +16,14 @@ export default function RootLayout({
return (
<html lang="en">
<body>
{children}
<SidebarProvider>
<div className="flex h-screen">
<AppSidebar />
<main className="flex-1 overflow-y-auto">
{children}
</main>
</div>
</SidebarProvider>
</body>
</html>
);
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/onboarding_quiz/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type QuizData = {
questions: Question[]
}

export function TechnicalInterviewQuiz() {
export default function TechnicalInterviewQuiz() {
const [currentQuestionIndex, setCurrentQuestionIndex] = useState(0)
const [answers, setAnswers] = useState<Record<string, string>>({})
const [quizCompleted, setQuizCompleted] = useState(false)
Expand Down Expand Up @@ -152,7 +152,7 @@ export function TechnicalInterviewQuiz() {

if (!quizStarted) {
return (
<Card className="w-full max-w-3xl mx-auto">
<Card className="w-full max-w-3xl mx-auto ml-10">
<CardHeader>
<CardTitle>Technical Interview Preparation</CardTitle>
<CardDescription>Please fill in your details to start the quiz</CardDescription>
Expand Down
18 changes: 11 additions & 7 deletions frontend/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import Image from "next/image";
import VideoConferencing from "./meet/page";
import PeerMessaging from "./peer-messaging/page";
import { TechnicalInterviewQuiz } from "./onboarding_quiz/page";
import Link from 'next/link'

export default function Home() {
return (
<div>
<TechnicalInterviewQuiz/>
<div className="space-y-4">
<h1 className="text-2xl font-bold">Welcome to the Interview Platform</h1>
<p>Please select a feature from the sidebar to get started:</p>
<ul className="list-disc list-inside space-y-2">
<li><Link href="/meet" className="text-blue-500 hover:underline">Video Conferencing</Link></li>
<li><Link href="/onboarding_quiz" className="text-blue-500 hover:underline">Technical Interview Quiz</Link></li>
<li><Link href="/peer-messaging" className="text-blue-500 hover:underline">Peer Messaging</Link></li>
</ul>
</div>
);
)
}

9 changes: 9 additions & 0 deletions frontend/components/peer-messaging.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default function PeerMessaging() {
return (
<div className="space-y-4">
<h1 className="text-2xl font-bold">Peer Messaging</h1>
<p>Peer messaging component content goes here.</p>
</div>
)
}

57 changes: 57 additions & 0 deletions frontend/components/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
"use client"

import Link from 'next/link'
import { usePathname } from 'next/navigation'
import { Video, FileQuestion, MessageSquare } from 'lucide-react'

import {
Sidebar,
SidebarContent,
SidebarGroup,
SidebarGroupContent,
SidebarGroupLabel,
SidebarHeader,
SidebarMenu,
SidebarMenuButton,
SidebarMenuItem,
SidebarRail,
} from '@/components/ui/sidebar'

const menuItems = [
{ name: 'Video Conferencing', icon: Video, href: '/meet' },
{ name: 'Technical Interview Quiz', icon: FileQuestion, href: '/onboarding_quiz' },
{ name: 'Peer Messaging', icon: MessageSquare, href: '/peer-messaging' },
]

export function AppSidebar() {
const pathname = usePathname()

return (
<Sidebar>
<SidebarHeader>
<h2 className="text-lg font-semibold px-4 py-2">Interview Platform</h2>
</SidebarHeader>
<SidebarContent>
<SidebarGroup>
<SidebarGroupLabel>Features</SidebarGroupLabel>
<SidebarGroupContent>
<SidebarMenu>
{menuItems.map((item) => (
<SidebarMenuItem key={item.name}>
<SidebarMenuButton asChild isActive={pathname === item.href}>
<Link href={item.href}>
<item.icon className="mr-2 h-4 w-4" />
<span>{item.name}</span>
</Link>
</SidebarMenuButton>
</SidebarMenuItem>
))}
</SidebarMenu>
</SidebarGroupContent>
</SidebarGroup>
</SidebarContent>
<SidebarRail />
</Sidebar>
)
}

9 changes: 9 additions & 0 deletions frontend/components/technical-interview-quiz.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default function TechnicalInterviewQuiz() {
return (
<div className="space-y-4">
<h1 className="text-2xl font-bold">Technical Interview Quiz</h1>
<p>Technical interview quiz component content goes here.</p>
</div>
)
}

31 changes: 31 additions & 0 deletions frontend/components/ui/separator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"use client"

import * as React from "react"
import * as SeparatorPrimitive from "@radix-ui/react-separator"

import { cn } from "@/lib/utils"

const Separator = React.forwardRef<
React.ElementRef<typeof SeparatorPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
>(
(
{ className, orientation = "horizontal", decorative = true, ...props },
ref
) => (
<SeparatorPrimitive.Root
ref={ref}
decorative={decorative}
orientation={orientation}
className={cn(
"shrink-0 bg-border",
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
className
)}
{...props}
/>
)
)
Separator.displayName = SeparatorPrimitive.Root.displayName

export { Separator }
140 changes: 140 additions & 0 deletions frontend/components/ui/sheet.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
"use client"

import * as React from "react"
import * as SheetPrimitive from "@radix-ui/react-dialog"
import { cva, type VariantProps } from "class-variance-authority"
import { X } from "lucide-react"

import { cn } from "@/lib/utils"

const Sheet = SheetPrimitive.Root

const SheetTrigger = SheetPrimitive.Trigger

const SheetClose = SheetPrimitive.Close

const SheetPortal = SheetPrimitive.Portal

const SheetOverlay = React.forwardRef<
React.ElementRef<typeof SheetPrimitive.Overlay>,
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>
>(({ className, ...props }, ref) => (
<SheetPrimitive.Overlay
className={cn(
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
className
)}
{...props}
ref={ref}
/>
))
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName

const sheetVariants = cva(
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",
{
variants: {
side: {
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
bottom:
"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
right:
"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
},
},
defaultVariants: {
side: "right",
},
}
)

interface SheetContentProps
extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
VariantProps<typeof sheetVariants> {}

const SheetContent = React.forwardRef<
React.ElementRef<typeof SheetPrimitive.Content>,
SheetContentProps
>(({ side = "right", className, children, ...props }, ref) => (
<SheetPortal>
<SheetOverlay />
<SheetPrimitive.Content
ref={ref}
className={cn(sheetVariants({ side }), className)}
{...props}
>
<SheetPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary">
<X className="h-4 w-4" />
<span className="sr-only">Close</span>
</SheetPrimitive.Close>
{children}
</SheetPrimitive.Content>
</SheetPortal>
))
SheetContent.displayName = SheetPrimitive.Content.displayName

const SheetHeader = ({
className,
...props
}: React.HTMLAttributes<HTMLDivElement>) => (
<div
className={cn(
"flex flex-col space-y-2 text-center sm:text-left",
className
)}
{...props}
/>
)
SheetHeader.displayName = "SheetHeader"

const SheetFooter = ({
className,
...props
}: React.HTMLAttributes<HTMLDivElement>) => (
<div
className={cn(
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
className
)}
{...props}
/>
)
SheetFooter.displayName = "SheetFooter"

const SheetTitle = React.forwardRef<
React.ElementRef<typeof SheetPrimitive.Title>,
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>
>(({ className, ...props }, ref) => (
<SheetPrimitive.Title
ref={ref}
className={cn("text-lg font-semibold text-foreground", className)}
{...props}
/>
))
SheetTitle.displayName = SheetPrimitive.Title.displayName

const SheetDescription = React.forwardRef<
React.ElementRef<typeof SheetPrimitive.Description>,
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>
>(({ className, ...props }, ref) => (
<SheetPrimitive.Description
ref={ref}
className={cn("text-sm text-muted-foreground", className)}
{...props}
/>
))
SheetDescription.displayName = SheetPrimitive.Description.displayName

export {
Sheet,
SheetPortal,
SheetOverlay,
SheetTrigger,
SheetClose,
SheetContent,
SheetHeader,
SheetFooter,
SheetTitle,
SheetDescription,
}
Loading