diff --git a/Team116-EduQuest/CourseController.java b/Team116-EduQuest/CourseController.java new file mode 100644 index 00000000..222f241e --- /dev/null +++ b/Team116-EduQuest/CourseController.java @@ -0,0 +1,105 @@ +package com.example.demo.controller; + +import com.example.demo.service.CourseSearcher; +import com.example.demo.model.CourseInfo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.example.demo.service.CourseService; + +import java.util.List; + +@RestController +@RequestMapping("/api/courses") + + +public class CourseController { + @Autowired + private CourseService courseService; + + @Autowired + private CourseSearcher courseSearcher; + + + + // Endpoint to get all courses + @GetMapping("/all") + public List getAllCourses() { + return courseSearcher.getAllCourses(); + } + + // Endpoint to search courses by name using Trie + + + // Endpoint to get ranked courses by rating (Ranking) + @GetMapping("/ranked") + public List getRankedCourses() { + return courseSearcher.getRankedCourses(); + } + + // Endpoint to get sorted courses by duration (Sorting) + @GetMapping("/sorted") + public List getSortedCoursesByDuration() { + return courseSearcher.getSortedCoursesByDuration(); + } + + // Endpoint to get courses that have prerequisites + @GetMapping("/prerequisites") + public List getCoursesWithPrerequisites() { + return courseSearcher.getCoursesWithPrerequisites(); + } + + // Endpoint to add prerequisites for a course + @PostMapping("/prerequisite") + public String addPrerequisite(@RequestParam String courseId, @RequestParam String prerequisiteId) { + courseSearcher.addPrerequisite(courseId, prerequisiteId); + return "Prerequisite added!"; + } + + // Admin Endpoint to add a new course + @PostMapping("/add") + public String addCourse(@RequestBody CourseInfo course) { + boolean success = courseSearcher.addCourse(course); + if(success) { + return "Course added successfully!"; + } else { + return "Error adding course!"; + } + } + + // Admin Endpoint to update an existing course + @PutMapping("/update/{courseId}") + public String updateCourse(@PathVariable String courseId, @RequestBody CourseInfo course) { + boolean success = courseSearcher.updateCourse(courseId, course); + if(success) { + return "Course updated successfully!"; + } else { + return "Error updating course!"; + } + } + + // Admin Endpoint to delete a course + @DeleteMapping("/delete/{courseId}") + public String deleteCourse(@PathVariable String courseId) { + boolean success = courseSearcher.deleteCourse(courseId); + if(success) { + return "Course deleted successfully!"; + } else { + return "Error deleting course!"; + } + } + + // Endpoint to get courses sorted by duration + @GetMapping("/sortedByDuration") + public List getCoursegetSortedCoursesByDuration() { + return courseSearcher.getSortedCoursesByDuration(); + } + + @GetMapping("/search") + public List search( + @RequestParam(required = false) String title, + @RequestParam(required = false) String minRating, + @RequestParam(required = false) String maxRating + ) { + return courseService.searchAndFilterCourses(title, minRating, maxRating); + } +} diff --git a/Team116-EduQuest/CourseMatchApplication.java b/Team116-EduQuest/CourseMatchApplication.java new file mode 100644 index 00000000..2065258f --- /dev/null +++ b/Team116-EduQuest/CourseMatchApplication.java @@ -0,0 +1,12 @@ +package com.example.demo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication // This annotation marks the main entry point of the Spring Boot application +public class CourseMatchApplication { + + public static void main(String[] args) { + SpringApplication.run(CourseMatchApplication.class, args); // This starts the Spring Boot application + } +} diff --git a/Team116-EduQuest/CourseSearcher.java b/Team116-EduQuest/CourseSearcher.java new file mode 100644 index 00000000..2ac203eb --- /dev/null +++ b/Team116-EduQuest/CourseSearcher.java @@ -0,0 +1,290 @@ +package com.example.demo.service; + +import com.example.demo.model.CourseInfo; +import java.util.*; +import java.util.stream.Collectors; +import org.springframework.stereotype.Service; + +// Trie Data Structure +class TrieNode { + TrieNode[] children = new TrieNode[26]; // for each letter a-z + boolean isEndOfWord; + List courseInfos = new ArrayList<>(); // Store courses at this node +} + +@Service +public class CourseSearcher { + private static Trie courseTrie = new Trie(); + private static Map> prerequisitesMap = new HashMap<>(); + + private static List courseList = List.of( + new CourseInfo("C101", "Java for Beginners", "6 weeks", "1 year", "Free", "Basic", true, 4.5, "Great for newbies!"), + new CourseInfo("C102", "Advanced DSA", "8 weeks", "1 year", "Paid (Rs. 999)", "Advanced", true, 4.7, "Challenging but worth it"), + new CourseInfo("C103", "Web Dev Bootcamp", "10 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.8, "Best full-stack course"), + new CourseInfo("C104", "UI/UX Design Fundamentals", "4 weeks", "6 months", "Free", "Basic", true, 4.6, "Good start for designers"), + new CourseInfo("C105", "Python for Data Science", "7 weeks", "1 year", "Paid (Rs. 799)", "Intermediate", true, 4.7, "Very informative and practical"), + new CourseInfo("C106", "Machine Learning A-Z", "12 weeks", "Lifetime", "Paid (Rs. 1999)", "Advanced", true, 4.9, "Hands-on and in-depth"), + new CourseInfo("C107", "DBMS Essentials", "5 weeks", "1 year", "Free", "Intermediate", true, 4.4, "Clear explanations with examples"), + new CourseInfo("C108", "Operating Systems", "6 weeks", "6 months", "Free", "Advanced", true, 4.3, "Great for CS students"), + new CourseInfo("C109", "Cybersecurity Basics", "4 weeks", "1 year", "Free", "Basic", false, 4.2, "Short and secure!"), + new CourseInfo("C110", "React Frontend Mastery", "9 weeks", "Lifetime", "Paid (Rs. 1299)", "Advanced", true, 4.8, "Modern UI development explained well"), + new CourseInfo("C111", "Agile & Scrum Training", "3 weeks", "3 months", "Free", "Intermediate", true, 4.5, "Very helpful for team leads"), + new CourseInfo("C112", "Cloud Computing with AWS", "6 weeks", "1 year", "Paid (Rs. 1599)", "Advanced", true, 4.6, "Well structured and real-world use cases"), + new CourseInfo("C113", "AI for Everyone", "5 weeks", "6 months", "Free", "Basic", true, 4.5, "Perfect for non-tech learners curious about AI"), + new CourseInfo("C114", "Kotlin for Android Development", "8 weeks", "1 year", "Paid (Rs. 1099)", "Intermediate", true, 4.6, "Covers all Android fundamentals"), + new CourseInfo("C115", "DevOps Masterclass", "10 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.8, "Great for CI/CD & deployment"), + new CourseInfo("C116", "Soft Skills & Communication", "3 weeks", "3 months", "Free", "Basic", false, 4.3, "Helpful for interviews and teamwork"), + new CourseInfo("C117", "Blockchain Basics", "6 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.4, "Clear and conceptual course"), + new CourseInfo("C118", "Intro to Git & GitHub", "2 weeks", "1 year", "Free", "Basic", true, 4.6, "Essential for developers"), + new CourseInfo("C119", "Data Visualization with Tableau", "5 weeks", "6 months", "Paid (Rs. 899)", "Intermediate", true, 4.5, "Clean dashboards and use cases"), + new CourseInfo("C120", "Natural Language Processing", "8 weeks", "1 year", "Paid (Rs. 1499)", "Advanced", true, 4.7, "Very hands-on with real NLP tasks"), + new CourseInfo("C121", "Intro to Game Development", "6 weeks", "6 months", "Paid (Rs. 999)", "Basic", false, 4.2, "Fun and creative starting point"), + new CourseInfo("C122", "Excel & Google Sheets Mastery", "4 weeks", "1 year", "Free", "Basic", true, 4.4, "Very practical and work-friendly"), + new CourseInfo("C123", "Core Java Essentials", "5 weeks", "6 months", "Free", "Basic", true, 4.4, "Concise and beginner-friendly"), + new CourseInfo("C124", "Learn Java with Projects", "7 weeks", "1 year", "Paid (Rs. 799)", "Basic", true, 4.6, "Good hands-on experience"), + new CourseInfo("C125", "Mastering DSA in Java", "10 weeks", "Lifetime", "Paid (Rs. 1199)", "Advanced", true, 4.9, "Best for interviews"), + new CourseInfo("C126", "Competitive Programming Bootcamp", "9 weeks", "1 year", "Free", "Advanced", false, 4.3, "Great for contests"), + new CourseInfo("C127", "Full-Stack Web Development", "12 weeks", "Lifetime", "Paid (Rs. 1599)", "Intermediate", true, 4.8, "Covers frontend + backend thoroughly"), + new CourseInfo("C128", "Responsive Web Design", "6 weeks", "1 year", "Free", "Intermediate", true, 4.5, "Excellent for UI/UX lovers"), + new CourseInfo("C129", "AI Foundations", "4 weeks", "6 months", "Free", "Basic", true, 4.4, "Simple explanations and case studies"), + new CourseInfo("C130", "Beginner’s Guide to Machine Learning", "6 weeks", "1 year", "Paid (Rs. 999)", "Basic", true, 4.6, "Visual approach to ML"), + new CourseInfo("C131", "CI/CD Pipeline with Jenkins", "8 weeks", "1 year", "Paid (Rs. 1399)", "Advanced", true, 4.7, "Practical DevOps guide"), + new CourseInfo("C132", "Docker & Kubernetes Bootcamp", "10 weeks", "Lifetime", "Paid (Rs. 1699)", "Advanced", true, 4.9, "Excellent for real-world DevOps"), + new CourseInfo("C133", "Git Essentials", "2 weeks", "6 months", "Free", "Basic", false, 4.3, "Short and effective"), + new CourseInfo("C134", "Version Control using Git", "3 weeks", "1 year", "Paid (Rs. 499)", "Basic", true, 4.5, "Perfect for beginners"), + new CourseInfo("C135", "Applied NLP with Python", "8 weeks", "1 year", "Paid (Rs. 1499)", "Advanced", true, 4.7, "Real-world use cases"), + new CourseInfo("C136", "NLP for Beginners", "5 weeks", "6 months", "Free", "Intermediate", true, 4.4, "Clear introduction to NLP techniques"), + new CourseInfo("C137", "Business Communication Skills", "4 weeks", "3 months", "Free", "Basic", true, 4.2, "Good for workplace etiquette"), + new CourseInfo("C138", "Public Speaking Mastery", "6 weeks", "1 year", "Paid (Rs. 599)", "Intermediate", true, 4.6, "Builds confidence and clarity"), + new CourseInfo("C139", "Java OOP Mastery", "6 weeks", "1 year", "Paid (Rs. 899)", "Intermediate", true, 4.6, "Solid OOP concepts in Java"), + new CourseInfo("C140", "Java Multithreading & Concurrency", "5 weeks", "6 months", "Free", "Advanced", false, 4.4, "In-depth and hands-on"), + new CourseInfo("C141", "DSA Crash Course", "4 weeks", "3 months", "Free", "Intermediate", false, 4.3, "Quick revision for interviews"), + new CourseInfo("C142", "DSA with C++", "8 weeks", "1 year", "Paid (Rs. 1199)", "Advanced", true, 4.7, "Perfect for competitive programmers"), + new CourseInfo("C143", "React for Beginners", "6 weeks", "1 year", "Free", "Intermediate", true, 4.6, "Simple UI building blocks"), + new CourseInfo("C144", "Backend with Node.js", "7 weeks", "Lifetime", "Paid (Rs. 1399)", "Intermediate", true, 4.8, "Practical REST API creation"), + new CourseInfo("C145", "Deep Learning with TensorFlow", "9 weeks", "1 year", "Paid (Rs. 1599)", "Advanced", true, 4.9, "In-depth neural networks training"), + new CourseInfo("C146", "Intro to Web Scraping with Python", "5 weeks", "6 months", "Free", "Basic", false, 4.4, "Scrape real-time data!"), + new CourseInfo("C147", "Python for Automation", "6 weeks", "Lifetime", "Free", "Intermediate", true, 4.5, "Automate your daily tasks"), + new CourseInfo("C148", "Data Science with R", "8 weeks", "1 year", "Paid (Rs. 1199)", "Intermediate", true, 4.7, "Great for stats & analysis"), + new CourseInfo("C149", "Swift for iOS Development", "7 weeks", "6 months", "Paid (Rs. 1099)", "Intermediate", true, 4.8, "Create amazing iOS apps"), + new CourseInfo("C150", "Introduction to Data Science", "10 weeks", "Lifetime", "Free", "Basic", true, 4.6, "Good starter for aspiring data scientists"), + new CourseInfo("C151", "C++ for Beginners", "5 weeks", "6 months", "Free", "Basic", true, 4.5, "Master basic C++ concepts"), + new CourseInfo("C152", "Advanced SQL Queries", "6 weeks", "1 year", "Paid (Rs. 999)", "Advanced", true, 4.7, "Master complex queries"), + new CourseInfo("C153", "Web App Security", "6 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.8, "Focus on security best practices"), + new CourseInfo("C154", "Intro to Swift Programming", "5 weeks", "1 year", "Paid (Rs. 799)", "Intermediate", true, 4.6, "Great for iOS development"), + new CourseInfo("C155", "SQL for Data Science", "8 weeks", "1 year", "Free", "Basic", true, 4.5, "Strong foundation in SQL"), + new CourseInfo("C156", "Digital Marketing Fundamentals", "5 weeks", "Lifetime", "Paid (Rs. 1299)", "Basic", false, 4.4, "Introduction to digital strategies"), + new CourseInfo("C157", "SEO for Beginners", "4 weeks", "1 year", "Free", "Basic", true, 4.5, "Optimize your website for Google"), + new CourseInfo("C158", "Introduction to Docker", "5 weeks", "Lifetime", "Free", "Basic", true, 4.6, "Perfect for containerizing apps"), + new CourseInfo("C159", "Introduction to Cloud Computing", "7 weeks", "1 year", "Paid (Rs. 999)", "Basic", true, 4.7, "Understand cloud fundamentals"), + new CourseInfo("C160", "Networking Basics", "6 weeks", "1 year", "Free", "Basic", true, 4.4, "Learn about network protocols"), + new CourseInfo("C161", "JavaScript: The Definitive Guide", "8 weeks", "Lifetime", "Paid (Rs. 1399)", "Intermediate", true, 4.9, "Master the JavaScript language"), + new CourseInfo("C162", "React Native Basics", "7 weeks", "6 months", "Free", "Intermediate", true, 4.6, "Mobile app development with React Native"), + new CourseInfo("C163", "Advanced CSS Techniques", "6 weeks", "1 year", "Paid (Rs. 999)", "Advanced", true, 4.7, "CSS mastery for modern websites"), + new CourseInfo("C164", "Advanced Data Science with Python", "9 weeks", "Lifetime", "Paid (Rs. 1999)", "Advanced", true, 4.8, "Work on complex data problems"), + new CourseInfo("C165", "Intro to Mobile Game Development", "8 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.5, "Start building games for mobile"), + new CourseInfo("C166", "GraphQL Masterclass", "5 weeks", "Lifetime", "Paid (Rs. 999)", "Advanced", true, 4.6, "Master the modern query language"), + new CourseInfo("C167", "Building APIs with Flask", "6 weeks", "Lifetime", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Flask for building REST APIs"), + new CourseInfo("C168", "Python for Cybersecurity", "8 weeks", "1 year", "Paid (Rs. 1599)", "Intermediate", true, 4.9, "Learn cybersecurity with Python"), + new CourseInfo("C169", "Android App Development", "10 weeks", "Lifetime", "Paid (Rs. 1399)", "Intermediate", true, 4.8, "Build Android apps from scratch"), + new CourseInfo("C170", "Intro to Augmented Reality", "6 weeks", "Lifetime", "Paid (Rs. 1799)", "Intermediate", true, 4.6, "Get hands-on with AR development"),new CourseInfo("C170", "Intro to Augmented Reality", "6 weeks", "Lifetime", "Paid (Rs. 1799)", "Intermediate", true, 4.6, "Get hands-on with AR development"), + new CourseInfo("C171", "Introduction to Quantum Computing", "7 weeks", "1 year", "Free", "Advanced", true, 4.8, "Cutting-edge technology for future computing"), + new CourseInfo("C172", "Building Chatbots with Python", "8 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.7, "Create your own conversational agents"), + new CourseInfo("C173", "Intro to Data Structures with Python", "6 weeks", "1 year", "Free", "Basic", true, 4.5, "Understanding basic data structures"), + new CourseInfo("C174", "Intro to Deep Learning with Python", "7 weeks", "Lifetime", "Paid (Rs. 1699)", "Intermediate", true, 4.8, "Deep dive into neural networks"), + new CourseInfo("C175", "UI/UX Design with Figma", "8 weeks", "1 year", "Paid (Rs. 999)", "Intermediate", true, 4.6, "Create beautiful UI/UX designs"), + new CourseInfo("C176", "Responsive Web Design with CSS Grid", "6 weeks", "Lifetime", "Free", "Intermediate", true, 4.7, "Master responsive layouts with Grid"), + new CourseInfo("C177", "R for Data Science", "8 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.8, "A hands-on approach to data science with R"), + new CourseInfo("C178", "iOS Development with Swift", "10 weeks", "Lifetime", "Paid (Rs. 1999)", "Advanced", true, 4.9, "Build iOS apps from scratch using Swift"), + new CourseInfo("C179", "Blockchain for Developers", "7 weeks", "1 year", "Paid (Rs. 1499)", "Intermediate", true, 4.7, "Learn to build blockchain applications"), + new CourseInfo("C180", "React Native with Expo", "6 weeks", "Lifetime", "Paid (Rs. 1199)", "Intermediate", true, 4.6, "Cross-platform app development with React Native"), + new CourseInfo("C181", "Advanced CSS Layouts", "5 weeks", "6 months", "Paid (Rs. 999)", "Advanced", true, 4.8, "Master layouts using Flexbox and Grid"), + new CourseInfo("C182", "Intro to Functional Programming in JavaScript", "6 weeks", "1 year", "Free", "Intermediate", true, 4.5, "Get started with functional programming"), + new CourseInfo("C183", "Digital Illustration with Adobe Illustrator", "8 weeks", "Lifetime", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Learn how to create vector art and illustrations"), + new CourseInfo("C184", "Intro to Python for Data Science", "7 weeks", "1 year", "Free", "Basic", true, 4.6, "Start your journey with Python in Data Science"), + new CourseInfo("C185", "Automated Testing with Selenium", "6 weeks", "1 year", "Paid (Rs. 1499)", "Intermediate", true, 4.8, "Learn to automate web app testing with Selenium"), + new CourseInfo("C186", "Advanced Git Techniques", "5 weeks", "6 months", "Free", "Advanced", true, 4.7, "Master Git for version control"), + new CourseInfo("C187", "Intro to Software Engineering", "9 weeks", "1 year", "Paid (Rs. 1499)", "Intermediate", true, 4.6, "Learn software development best practices"), + new CourseInfo("C188", "Advanced Python Programming", "8 weeks", "1 year", "Paid (Rs. 1599)", "Advanced", true, 4.8, "Become a Python expert with advanced concepts"), + new CourseInfo("C189", "Intro to Ethical Hacking", "7 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.7, "Learn ethical hacking and cybersecurity practices"), + new CourseInfo("C190", "TensorFlow for Deep Learning", "9 weeks", "1 year", "Paid (Rs. 1799)", "Advanced", true, 4.9, "Deep dive into TensorFlow for deep learning models"), + new CourseInfo("C191", "Intro to Game Design", "5 weeks", "Lifetime", "Free", "Basic", true, 4.6, "Understand the basics of game mechanics and design"), + new CourseInfo("C192", "Web Performance Optimization", "6 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Speed up your websites for better performance"), + new CourseInfo("C193", "Graph Databases with Neo4j", "7 weeks", "Lifetime", "Paid (Rs. 1399)", "Advanced", true, 4.8, "Learn graph databases with Neo4j"), + new CourseInfo("C194", "Angular Advanced Techniques", "9 weeks", "Lifetime", "Paid (Rs. 1599)", "Advanced", true, 4.9, "Master Angular with advanced features"), + new CourseInfo("C195", "Data Science with SQL", "6 weeks", "1 year", "Paid (Rs. 999)", "Intermediate", true, 4.7, "Combine SQL with data science techniques"), + new CourseInfo("C196", "Creating APIs with Django", "8 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.8, "Learn API development with Django framework"), + new CourseInfo("C197", "Python for Web Development", "7 weeks", "1 year", "Free", "Intermediate", true, 4.6, "Build dynamic web apps using Python"), + new CourseInfo("C198", "Cloud Engineering with Google Cloud", "10 weeks", "1 year", "Paid (Rs. 1999)", "Advanced", true, 4.9, "Learn how to build and manage cloud applications"), + new CourseInfo("C199", "Machine Learning with Scikit-Learn", "8 weeks", "Lifetime", "Paid (Rs. 1399)", "Intermediate", true, 4.8, "Learn machine learning techniques using Scikit-learn"), + new CourseInfo("C200", "Building Scalable Web Applications", "9 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.9, "Learn to scale and optimize your web apps"), + new CourseInfo("C201", "Complete Digital Marketing", "12 weeks", "Lifetime", "Paid (Rs. 1499)", "Basic", false, 4.7, "Covering all aspects of digital marketing strategies"), + new CourseInfo("C202", "Advanced SQL for Data Analysis", "7 weeks", "1 year", "Paid (Rs. 1299)", "Advanced", true, 4.8, "Deep dive into SQL for data analysis"), + new CourseInfo("C203", "Intro to Cloud-Native Development", "8 weeks", "Lifetime", "Paid (Rs. 1599)", "Intermediate", true, 4.6, "Develop cloud-native apps using modern frameworks"), + new CourseInfo("C204", "Intro to Kubernetes", "5 weeks", "Lifetime", "Free", "Intermediate", true, 4.7, "Learn container orchestration with Kubernetes"), + new CourseInfo("C205", "AI-Powered Data Analytics", "10 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.9, "Learn AI and analytics for advanced business insights"), + new CourseInfo("C206", "Vue.js Essentials", "6 weeks", "1 year", "Paid (Rs. 1199)", "Intermediate", true, 4.7, "A complete guide to mastering Vue.js framework"), + new CourseInfo("C207", "Creating Web Applications with Flask", "7 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.8, "Build scalable web apps with Flask"), + new CourseInfo("C208", "Advanced JavaScript ES6+", "6 weeks", "1 year", "Paid (Rs. 1299)", "Advanced", true, 4.9, "Master the latest features of JavaScript"), + new CourseInfo("C209", "Data Engineering with Python", "8 weeks", "Lifetime", "Paid (Rs. 1599)", "Advanced", true, 4.8, "Learn how to manage and process large data sets"), + new CourseInfo("C210", "DevOps Automation with Ansible", "9 weeks", "1 year", "Paid (Rs. 1799)", "Advanced", true, 4.7, "Automate your infrastructure management with Ansible"), + new CourseInfo("C211", "Design Thinking for Developers", "6 weeks", "Lifetime", "Free", "Intermediate", true, 4.7, "Learn how to approach problem-solving like a designer"), + new CourseInfo("C212", "Deep Learning with Keras", "8 weeks", "1 year", "Paid (Rs. 1699)", "Advanced", true, 4.9, "Create neural networks with Keras and TensorFlow"), + new CourseInfo("C213", "Introduction to 3D Modeling", "7 weeks", "Lifetime", "Paid (Rs. 1399)", "Basic", true, 4.5, "Learn the basics of 3D design and modeling"), + new CourseInfo("C214", "Augmented Reality with Unity", "10 weeks", "1 year", "Paid (Rs. 1999)", "Intermediate", true, 4.8, "Create AR experiences using Unity"), + new CourseInfo("C215", "Docker for Developers", "6 weeks", "Lifetime", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Learn to containerize your applications with Docker"), + new CourseInfo("C216", "Natural Language Processing with Python", "8 weeks", "1 year", "Paid (Rs. 1599)", "Intermediate", true, 4.8, "Work on real-world NLP problems using Python"), + new CourseInfo("C217", "Advanced React Concepts", "6 weeks", "Lifetime", "Paid (Rs. 1399)", "Advanced", true, 4.9, "Level up your React skills with advanced concepts"), + new CourseInfo("C218", "Python for Data Visualization", "5 weeks", "Lifetime", "Free", "Intermediate", true, 4.6, "Visualize data using libraries like Matplotlib"), + new CourseInfo("C219", "Introduction to Financial Modeling", "7 weeks", "1 year", "Paid (Rs. 1499)", "Intermediate", true, 4.7, "Learn financial modeling techniques for business"), + new CourseInfo("C220", "Advanced Ethical Hacking", "8 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.8, "Dive deep into penetration testing and security"), + new CourseInfo("C221", "Intro to Mobile Web Development", "6 weeks", "1 year", "Free", "Intermediate", true, 4.6, "Develop mobile-friendly websites with modern techniques"), + new CourseInfo("C222", "Building Scalable Databases with MongoDB", "8 weeks", "Lifetime", "Paid (Rs. 1599)", "Intermediate", true, 4.8, "Learn how to design and scale MongoDB databases"), + new CourseInfo("C223", "AWS Certified Solutions Architect", "10 weeks", "Lifetime", "Paid (Rs. 1999)", "Advanced", true, 4.9, "Prepare for AWS Solutions Architect certification"), + new CourseInfo("C224", "API Development with Node.js", "7 weeks", "Lifetime", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Learn how to build APIs using Node.js and Express"), + new CourseInfo("C225", "Creating Cross-Platform Apps with Flutter", "8 weeks", "Lifetime", "Paid (Rs. 1699)", "Intermediate", true, 4.8, "Develop native cross-platform apps with Flutter"), + new CourseInfo("C226", "Mastering Python for Machine Learning", "9 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.9, "Deep dive into Python for advanced machine learning"), + new CourseInfo("C227", "Deep Learning with PyTorch", "8 weeks", "1 year", "Paid (Rs. 1599)", "Advanced", true, 4.8, "Work on real-world deep learning projects using PyTorch"), + new CourseInfo("C228", "Understanding Big Data", "6 weeks", "Lifetime", "Paid (Rs. 999)", "Intermediate", true, 4.7, "Learn how to handle and process big data systems"), + new CourseInfo("C229", "UX/UI Research and Testing", "6 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.6, "Conduct research and usability testing for UI/UX"), + new CourseInfo("C230", "Advanced Node.js", "7 weeks", "Lifetime", "Paid (Rs. 1599)", "Advanced", true, 4.9, "Master Node.js and build scalable applications"), + new CourseInfo("C231", "Building Mobile Apps with Kotlin", "9 weeks", "Lifetime", "Paid (Rs. 1799)", "Intermediate", true, 4.8, "Learn Android development with Kotlin"), + new CourseInfo("C232", "Intro to WebAssembly", "6 weeks", "1 year", "Paid (Rs. 1199)", "Intermediate", true, 4.7, "Explore high-performance applications with WebAssembly"), + new CourseInfo("C233", "Intro to Digital Art Creation", "5 weeks", "Lifetime", "Paid (Rs. 999)", "Basic", true, 4.6, "Start creating digital art and illustrations"), + new CourseInfo("C234", "Developing with Angular", "8 weeks", "Lifetime", "Paid (Rs. 1399)", "Intermediate", true, 4.8, "Learn Angular for modern web applications"), + new CourseInfo("C235", "Intro to Data Visualization with D3.js", "7 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.7, "Master data visualization techniques with D3.js"), + new CourseInfo("C236", "Introduction to Scala for Data Science", "6 weeks", "1 year", "Free", "Intermediate", true, 4.6, "Leverage Scala for data science applications"), + new CourseInfo("C237", "Getting Started with SwiftUI", "8 weeks", "Lifetime", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Learn modern iOS development with SwiftUI"), + new CourseInfo("C238", "AI in Healthcare", "9 weeks", "1 year", "Paid (Rs. 1599)", "Advanced", true, 4.8, "Explore AI applications in the healthcare industry"), + new CourseInfo("C239", "Intro to Arduino Programming", "6 weeks", "Lifetime", "Free", "Basic", true, 4.6, "Learn how to create hardware projects with Arduino"), + new CourseInfo("C240", "Automation with Python Scripts", "7 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.8, "Automate tasks and processes with Python scripting"), + new CourseInfo("C241", "Security for Web Developers", "6 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.7, "Understand security concepts for web applications"), + new CourseInfo("C242", "Deep Learning for NLP", "8 weeks", "Lifetime", "Paid (Rs. 1599)", "Advanced", true, 4.9, "Build deep learning models for NLP tasks"), + new CourseInfo("C243", "React Redux for State Management", "6 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.8, "Master state management with Redux in React"), + new CourseInfo("C244", "Mastering GitHub for Developers", "5 weeks", "Lifetime", "Free", "Basic", true, 4.7, "Learn version control and collaboration with GitHub"), + new CourseInfo("C245", "Introduction to Web Design with HTML & CSS", "5 weeks", "Lifetime", "Free", "Basic", true, 4.5, "Learn the fundamentals of web design with HTML & CSS"), + new CourseInfo("C246", "Serverless Architecture with AWS Lambda", "8 weeks", "Lifetime", "Paid (Rs. 1499)", "Advanced", true, 4.8, "Build scalable serverless applications with AWS Lambda"), + new CourseInfo("C247", "Mastering API Security", "9 weeks", "1 year", "Paid (Rs. 1699)", "Advanced", true, 4.9, "Learn to secure your APIs with modern techniques"), + new CourseInfo("C248", "Building Real-time Applications with Node.js", "8 weeks", "Lifetime", "Paid (Rs. 1599)", "Intermediate", true, 4.8, "Learn to build real-time apps using Node.js"), + new CourseInfo("C249", "Business Intelligence with Power BI", "7 weeks", "1 year", "Paid (Rs. 1399)", "Intermediate", true, 4.7, "Leverage Power BI for creating business intelligence solutions"), + new CourseInfo("C250", "Deep Learning for Computer Vision", "10 weeks", "Lifetime", "Paid (Rs. 1999)", "Advanced", true, 4.9, "Create advanced computer vision models with deep learning") + ); + + static { + // Insert all courses into the Trie for efficient search + for (CourseInfo course : courseList) { + courseTrie.insert(course.getCourseName(), course); + } + } + + // Get all courses + public List getAllCourses() { + return courseList; + } + + // Search courses by name using Trie + public List searchCourses(String courseName) { + return courseTrie.search(courseName); + } + + // Get courses ranked by rating (Ranking) + public List getRankedCourses() { + return courseList.stream() + .sorted(Comparator.comparingDouble(CourseInfo::getRating).reversed()) + .collect(Collectors.toList()); + } + + // Get courses sorted by duration (Sorting) + public List getSortedCoursesByDuration() { + return courseList.stream() + .sorted(Comparator.comparingInt(course -> Integer.parseInt(course.getDuration().split(" ")[0]))) // Sorting by numeric value of duration + .collect(Collectors.toList()); + } + + + // Get courses with prerequisites + public List getCoursesWithPrerequisites() { + List coursesWithPrerequisites = new ArrayList<>(); + for (CourseInfo course : courseList) { + if (prerequisitesMap.containsKey(course.getCourseId())) { + coursesWithPrerequisites.add(course); + } + } + return coursesWithPrerequisites; + } + + // Add prerequisites to a course + public void addPrerequisite(String courseId, String prerequisiteId) { + prerequisitesMap.computeIfAbsent(courseId, k -> new ArrayList<>()).add(prerequisiteId); + } + + // Add a course + public boolean addCourse(CourseInfo course) { + return courseList.add(course); + } + + // Update an existing course + public boolean updateCourse(String courseId, CourseInfo updatedCourse) { + for (int i = 0; i < courseList.size(); i++) { + CourseInfo course = courseList.get(i); + if (course.getCourseId().equals(courseId)) { + courseList.set(i, updatedCourse); + return true; + } + } + return false; + } + + // Delete a course + public boolean deleteCourse(String courseId) { + return courseList.removeIf(course -> course.getCourseId().equals(courseId)); + } + + // Trie class for efficient course search + static class Trie { + private TrieNode root; + + public Trie() { + root = new TrieNode(); + } + + public void insert(String courseName, CourseInfo courseInfo) { + TrieNode node = root; + for (char c : courseName.toLowerCase().toCharArray()) { + if (Character.isAlphabetic(c)) { // Only process alphabetic characters + int index = c - 'a'; // Calculate index for alphabetic characters + if (node.children[index] == null) { + node.children[index] = new TrieNode(); + } + node = node.children[index]; + } + } + node.isEndOfWord = true; + node.courseInfos.add(courseInfo); + } + + public List search(String prefix) { + TrieNode node = root; + for (char c : prefix.toLowerCase().toCharArray()) { + if (node.children[c - 'a'] == null) { + return new ArrayList<>(); // Return empty if no match + } + node = node.children[c - 'a']; + } + return collectCourses(node); + } + + private List collectCourses(TrieNode node) { + List courses = new ArrayList<>(); + if (node.isEndOfWord) { + courses.addAll(node.courseInfos); + } + for (TrieNode child : node.children) { + if (child != null) { + courses.addAll(collectCourses(child)); + } + } + return courses; + } + } +} diff --git a/Team116-EduQuest/CourseService.java b/Team116-EduQuest/CourseService.java new file mode 100644 index 00000000..f9bb41fd --- /dev/null +++ b/Team116-EduQuest/CourseService.java @@ -0,0 +1,129 @@ +package com.example.demo.service; + +import com.example.demo.model.CourseInfo; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +@Service +public class CourseService { + + // Fetch courses from the CourseSearcher class + + List allCourses = getAllCourses(); + // Method to search and filter courses + + // Method to search and filter courses + public List searchAndFilterCourses(String name, String minDuration, String maxDuration) { + List filteredCourses = new ArrayList<>(); + + // If the user provided no filters, return all courses + if ((minDuration == null || minDuration.isEmpty() || Integer.parseInt(minDuration) == 0) && + (maxDuration == null || maxDuration.isEmpty() || Integer.parseInt(maxDuration) == 0)) { + + // If no valid duration filters, just filter by name if given + return searchAndFilterCourses(name); + } + + // Filter based on name and duration if provided + for (CourseInfo course : allCourses) { + boolean matches = true; + + // Filter by course name if provided + if (name != null && !name.isEmpty() && !course.getCourseName().toLowerCase().contains(name.toLowerCase())) { + matches = false; + } + + // If minDuration is provided and valid, filter by duration + if (minDuration != null && !minDuration.isEmpty() && Integer.parseInt(minDuration) > 0) { + try { + int minDur = Integer.parseInt(minDuration); + if (Integer.parseInt(course.getDuration()) < minDur) { + matches = false; + } + } catch (NumberFormatException e) { + matches = false; + } + } + + // If maxDuration is provided and valid, filter by duration + if (maxDuration != null && !maxDuration.isEmpty() && Integer.parseInt(maxDuration) > 0) { + try { + int maxDur = Integer.parseInt(maxDuration); + if (Integer.parseInt(course.getDuration()) > maxDur) { + matches = false; + } + } catch (NumberFormatException e) { + matches = false; + } + } + + // If the course matches all filters, add it to the result + if (matches) { + filteredCourses.add(course); + } + } + + return filteredCourses; + } + + // Function to handle searching only by name (overloading) + public List searchAndFilterCourses(String name) { + List filteredCourses = new ArrayList<>(); + for (CourseInfo course : allCourses) { + if (name != null && !name.isEmpty() && course.getCourseName().toLowerCase().contains(name.toLowerCase())) { + filteredCourses.add(course); + } + } + return filteredCourses; + } + + + + private List courseList = new ArrayList<>(); + + // Fetch all courses + public List getAllCourses() { + return courseList; + } + + // Add a new course + public void addCourse(CourseInfo course) { + courseList.add(course); + } + + // Update an existing course + public void updateCourse(CourseInfo updatedCourse) { + for (CourseInfo course : courseList) { + if (course.getCourseId().equals(updatedCourse.getCourseId())) { + course.setCourseName(updatedCourse.getCourseName()); + course.setDuration(updatedCourse.getDuration()); + course.setCostStatus(updatedCourse.getCostStatus()); + course.setLevel(updatedCourse.getLevel()); + course.setRating(updatedCourse.getRating()); + course.setReview(updatedCourse.getReview()); + } + } + } + + // Delete a course by ID + public void deleteCourse(String courseId) { + courseList.removeIf(course -> course.getCourseId().equals(courseId)); + } + + // Rank courses by rating + public List getRankedCourses() { + return courseList.stream() + .sorted((course1, course2) -> Double.compare(course2.getRating(), course1.getRating())) // Sort by rating in descending order + .collect(Collectors.toList()); + } + + // Sort courses by duration + public List getCoursesSortedByDuration() { + return courseList.stream() + .sorted((course1, course2) -> Integer.compare(Integer.parseInt(course1.getDuration()), Integer.parseInt(course2.getDuration()))) + .collect(Collectors.toList()); + } +} diff --git a/Team116-EduQuest/CourseService.java.txt b/Team116-EduQuest/CourseService.java.txt new file mode 100644 index 00000000..e69de29b diff --git a/Team116-EduQuest/README.md b/Team116-EduQuest/README.md new file mode 100644 index 00000000..e78d9535 --- /dev/null +++ b/Team116-EduQuest/README.md @@ -0,0 +1,10 @@ +Problem Statement: With the growing demand for continuous learning and skill development, individuals often turn to online courses(MOOKs platforms) to advance their knowledge. However, the sheer volume of available courses makes it difficult to identify the ones that truly align with a learner’s specific needs. Traditional course discovery methods are often generic and lack personalization, resulting in time-consuming searches and courses that may not match the user’s goals, prior experience, available time, or budget. +To address this challenge,we have derived a solution that simplifies the course selection process by providing personalized recommendations. By considering user inputs such as time commitment, financial constraints, current knowledge level, and learning objectives, the platform can help optimize the learning journey and enhance overall user satisfaction. + +Data structures & Algorithms used: +1. List : Stores all courses for filtering, searching, and sorting operations. +2. HashMap: Maps each courseId to its corresponding CourseInfo object. +3. Priority queue : Maintains a priority-based ordering of courses by rating (highest to lowest) +4. Regex (Pattern & Matcher) Algorithm: Keyword highlighting + +Video link:https://drive.google.com/file/d/1fncFvNRGg9BiybZTaVhQWsYIbZ9OWqzg/view?usp=sharing diff --git a/Team116-EduQuest/UserController.java b/Team116-EduQuest/UserController.java new file mode 100644 index 00000000..20f01198 --- /dev/null +++ b/Team116-EduQuest/UserController.java @@ -0,0 +1,21 @@ +package com.example.demo.controller; + +import com.example.demo.model.User; // Import the User model +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/api/auth") +public class UserController { + + @PostMapping("/login") + public String login(@RequestBody User user) { + // Hardcoded credentials for student and admin (to be replaced with a database later) + if (user.getId().equals("student") && user.getPassword().equals("student123")) { + return "student"; // For student + } else if (user.getId().equals("admin") && user.getPassword().equals("admin123")) { + return "admin"; // For admin + } else { + return "invalid"; // Invalid login credentials + } + } +} diff --git a/Team116-EduQuest/admin_dashboard.html b/Team116-EduQuest/admin_dashboard.html new file mode 100644 index 00000000..45e44b15 --- /dev/null +++ b/Team116-EduQuest/admin_dashboard.html @@ -0,0 +1,68 @@ + + + + + + Admin Dashboard + + + +
+
+ +
+ +
+
+ + + +
+

Admin Overview

+
Admin-specific information will go here.
+
+
+ + + + + + diff --git a/Team116-EduQuest/app.js b/Team116-EduQuest/app.js new file mode 100644 index 00000000..8da153e4 --- /dev/null +++ b/Team116-EduQuest/app.js @@ -0,0 +1,92 @@ +let role = ''; // Track if the user is an 'admin' or 'student' + +document.addEventListener("DOMContentLoaded", function() { + setRole('student'); // Default to student view on page load +}); + +function setRole(selectedRole) { + role = selectedRole; + + if (role === 'student') { + // Show student view, hide admin view + document.getElementById('studentView').style.display = 'block'; + document.getElementById('adminView').style.display = 'none'; + loadCourses(); // Load courses for student view + } else if (role === 'admin') { + // Show admin view, hide student view + document.getElementById('studentView').style.display = 'none'; + document.getElementById('adminView').style.display = 'block'; + } +} + +function loadCourses() { + fetch('http://localhost:8081/api/courses/all') + .then(response => response.json()) + .then(courses => { + displayCourses(courses); + }) + .catch(error => console.error("Error loading courses:", error)); +} + +function displayCourses(courses) { + const courseList = document.getElementById('courseList'); + courseList.innerHTML = ''; // Clear previous list + + if (courses.length === 0) { + courseList.innerHTML = '

No courses available.

'; + return; + } + + courses.forEach(course => { + const courseCard = document.createElement('div'); + courseCard.classList.add('course-card'); + + courseCard.innerHTML = ` +

${course.courseName}

+

Duration: ${course.duration}

+

Validity: ${course.validity}

+

Cost: ${course.costStatus}

+

Level: ${course.level}

+

Rating: ${course.rating}

+

Review: ${course.review}

+ `; + + courseList.appendChild(courseCard); + }); +} + +function searchCourses() { + const query = document.getElementById('courseSearch').value; + + if (query.length < 3) { + loadCourses(); // If query is too short, load all courses + return; + } + + fetch(`http://localhost:8081/api/courses/search?courseName=${query}`) + .then(response => response.json()) + .then(courses => { + displayCourses(courses); + }) + .catch(error => console.error("Error searching courses:", error)); +} + +// Fetch ranked courses by rating +function getRankedCourses() { + fetch('http://localhost:8081/api/courses/ranked') + .then(response => response.json()) + .then(courses => { + displayCourses(courses); + }) + .catch(error => console.error("Error fetching ranked courses:", error)); +} + +// Fetch sorted courses by duration +function getSortedCourses() { + fetch('http://localhost:8081/api/courses/sorted') + .then(response => response.json()) + .then(courses => { + displayCourses(courses); + }) + .catch(error => console.error("Error fetching sorted courses:", error)); +} diff --git a/Team116-EduQuest/login.html b/Team116-EduQuest/login.html new file mode 100644 index 00000000..38a94792 --- /dev/null +++ b/Team116-EduQuest/login.html @@ -0,0 +1,97 @@ + + + + + + Login - Course Finder + + + + + + + + + + diff --git a/Team116-EduQuest/manage-courses.html b/Team116-EduQuest/manage-courses.html new file mode 100644 index 00000000..ceb1406f --- /dev/null +++ b/Team116-EduQuest/manage-courses.html @@ -0,0 +1,324 @@ + + + + + + Manage Courses - Admin Dashboard + + + + +
+ + + + +
+
+ +
+ +
+
+ +

Manage Courses

+ + + + + + + + + + + + + + + + + + +
Course NameDurationPriceRatingActions
+
+
+ + + + + + diff --git a/Team116-EduQuest/script.js b/Team116-EduQuest/script.js new file mode 100644 index 00000000..deec550c --- /dev/null +++ b/Team116-EduQuest/script.js @@ -0,0 +1,105 @@ +function login() { + const userId = document.getElementById('userId').value; + const password = document.getElementById('password').value; + + const loginData = { + id: userId, + password: password + }; + + fetch('http://localhost:8080/api/auth/login', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(loginData) + }) + .then(response => response.text()) + .then(data => { + if (data === 'student') { + localStorage.setItem('userType', 'student'); + window.location.href = "student_dashboard.html"; + } else if (data === 'admin') { + localStorage.setItem('userType', 'admin'); + window.location.href = "admin_dashboard.html"; + } else { + document.getElementById('error-msg').textContent = 'Invalid credentials, please try again.'; + } + }) + .catch(error => console.error('Error:', error)); +} + +function logout() { + localStorage.removeItem('userType'); + window.location.href = 'login.html'; +} + +window.onload = function() { + const userType = localStorage.getItem('userType'); + if (userType !== 'student' && userType !== 'admin') { + window.location.href = 'login.html'; + return; + } + + fetch(`http://localhost:8080/api/auth/courses?userType=${userType}`) + .then(response => response.json()) + .then(courses => { + const courseList = document.getElementById('course-list'); + courses.forEach(course => { + const courseCard = document.createElement('div'); + courseCard.classList.add('course-card'); + courseCard.innerHTML = ` +

${course.courseName}

+

${course.description}

+

Rating: ${course.rating}

+

Duration: ${course.duration}

+

Price: ${course.price}

+ `; + courseList.appendChild(courseCard); + }); + }) + .catch(error => console.error('Error:', error)); +} +function fetchCourses() { + fetch('/api/courses/all') + .then(response => response.json()) + .then(data => displayCourses(data)); +} + +function searchCourses() { + const courseName = document.getElementById('searchName').value; + const minDuration = parseInt(document.getElementById('minDuration').value); + const maxDuration = parseInt(document.getElementById('maxDuration').value); + const sortByRating = document.getElementById('sortByRating').checked ? 'yes' : 'no'; + + fetch(`/api/courses/search?courseName=${courseName}&minDuration=${minDuration}&maxDuration=${maxDuration}&sortByRating=${sortByRating}`) + .then(response => response.json()) + .then(data => displayCourses(data)); +} + +function getRankedCourses() { + fetch('/api/courses/ranked') + .then(response => response.json()) + .then(data => displayCourses(data)); +} + +function getSortedCourses() { + fetch('/api/courses/sorted') + .then(response => response.json()) + .then(data => displayCourses(data)); +} + +function displayCourses(courses) { + const tableBody = document.getElementById('courseTableBody'); + tableBody.innerHTML = ''; + + courses.forEach(course => { + const row = ` + ${course.courseName} + ${course.instructor} + ${course.duration} + ${course.rating} + `; + tableBody.innerHTML += row; + }); +}; diff --git a/Team116-EduQuest/student_dashboard.html b/Team116-EduQuest/student_dashboard.html new file mode 100644 index 00000000..f4222828 --- /dev/null +++ b/Team116-EduQuest/student_dashboard.html @@ -0,0 +1,209 @@ + + + + + + Course Dashboard + + + + + + + +
+ Student Course Dashboard +
+ +
+ + + + + + +
+ +
+ + + + + + diff --git a/Team116-EduQuest/style.css b/Team116-EduQuest/style.css new file mode 100644 index 00000000..f4d16e0c --- /dev/null +++ b/Team116-EduQuest/style.css @@ -0,0 +1,209 @@ +/* Global Reset */ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +/* Body styles */ +body { + font-family: 'Arial', sans-serif; + background-color: #f5f5f5; + color: #333; +} + +/* Main container */ +.dashboard-container { + display: flex; + min-height: 100vh; +} + +/* Header */ +.header { + width: 100%; + background-color: #4CAF50; + color: white; + padding: 20px; + display: flex; + justify-content: space-between; + align-items: center; +} + +.header-logo h1 { + margin-left: 20px; +} + +.header-nav button { + background-color: #45a049; + color: white; + border: none; + padding: 10px 20px; + border-radius: 5px; + cursor: pointer; + font-size: 16px; +} + +.header-nav button:hover { + background-color: #3e8e41; +} + +/* Sidebar */ +.sidebar { + width: 250px; + background-color: #2f4f4f; + color: white; + padding: 20px; + display: flex; + flex-direction: column; + justify-content: flex-start; + height: 100vh; +} + +.sidebar h3 { + margin-bottom: 20px; + font-size: 1.5rem; +} + +.sidebar button { + background-color: #4CAF50; + color: white; + border: none; + padding: 12px 20px; + margin: 10px 0; + border-radius: 5px; + font-size: 16px; + cursor: pointer; +} + +.sidebar button:hover { + background-color: #45a049; +} + +/* Course Section */ +.course-section { + flex: 1; + padding: 20px; + margin-left: 250px; + background-color: #fff; +} + +.course-section h2 { + font-size: 2rem; + color: #333; + margin-bottom: 20px; +} + +/* Course List */ +.course-list { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); + gap: 20px; +} + +.course-card { + background-color: #fff; + padding: 20px; + border-radius: 10px; + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); + transition: transform 0.3s ease; +} + +.course-card:hover { + transform: translateY(-10px); +} + +.course-card h4 { + font-size: 1.2rem; + color: #333; + margin-bottom: 10px; +} + +.course-card p { + font-size: 1rem; + color: #777; +} + +.course-card .rating { + color: #f39c12; + font-weight: bold; +} + +button { + background-color: #4CAF50; + color: white; + padding: 12px; + border: none; + border-radius: 5px; + cursor: pointer; + font-size: 16px; + margin-top: 20px; +} + +button:hover { + background-color: #45a049; +} + +/* Login Form */ +.login-container { + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + background-color: #e0f7fa; +} + +.login-box { + background-color: white; + padding: 30px; + border-radius: 15px; + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); + width: 100%; + max-width: 400px; + text-align: center; +} + +.login-box h2 { + color: #4CAF50; +} + +.login-box input { + width: 100%; + padding: 14px; + margin: 10px 0; + border-radius: 5px; + border: 1px solid #ccc; + font-size: 16px; +} + +.login-box button { + width: 100%; + padding: 14px; + background-color: #4CAF50; + color: white; + border: none; + border-radius: 5px; + cursor: pointer; +} + +.login-box button:hover { + background-color: #45a049; +} + +#error-msg { + color: red; + margin-top: 10px; +} + +/* Animations */ +@keyframes slideIn { + from { + transform: translateX(-100%); + } + to { + transform: translateX(0); + } +} + +.sidebar { + animation: slideIn 0.5s ease-out; +}