<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community</title>
    <description>The most recent home feed on DEV Community.</description>
    <link>https://dev.to</link>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed"/>
    <language>en</language>
    <item>
      <title>Key Steps to Prepare for a Software Engineer Interview</title>
      <dc:creator>Arslan Ahmad</dc:creator>
      <pubDate>Fri, 25 Aug 2023 23:23:17 +0000</pubDate>
      <link>https://dev.to/arslan_ah/key-steps-to-prepare-for-a-software-engineer-interview-52ll</link>
      <guid>https://dev.to/arslan_ah/key-steps-to-prepare-for-a-software-engineer-interview-52ll</guid>
      <description>&lt;h2&gt;
  
  
  1. Deciphering Software Engineering Interviews
&lt;/h2&gt;

&lt;p&gt;Before diving deep into coding exercises or system design preparation, it's vital to understand the essence of a software engineering interview. It’s not just about testing your coding skills, but also about understanding if you fit the company's culture and can contribute to its objectives.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Are Hiring Managers Looking For in a Software Engineer?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem-solving skills:&lt;/strong&gt; The crux of any software engineering role is to solve problems. Hiring managers are on the lookout for individuals who can break down a complex problem, approach it logically, and find a suitable solution. A 2020 survey conducted by LinkedIn highlighted that problem-solving topped the list of soft skills desired by employers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Technical prowess:&lt;/strong&gt; Employers wish to see a good command over programming languages and tools. They want candidates who can adapt to new technologies, as the tech landscape is ever-evolving. In a Stack Overflow Developer Survey, more than 75% of developers believed that learning new technologies is an essential part of their job.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Team Collaboration:&lt;/strong&gt; Software development is rarely a solo endeavor. Engineers frequently collaborate with different teams, from UI/UX designers to product managers. Hence, your ability to work in a team and communicate effectively can make you stand out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cultural fit:&lt;/strong&gt; Every company has its own culture and values. Hiring managers often gauge whether a candidate would fit into their work environment and resonate with the company’s ethos. &lt;/p&gt;

&lt;h3&gt;
  
  
  Types of Software Engineer Interviews
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Coding Interviews:&lt;/strong&gt; These assess your technical coding skills. You may be asked to write a piece of code, debug, or solve algorithms. Websites like &lt;a href="//leetcode.com"&gt;LeetCode&lt;/a&gt; and &lt;a href="//designgurus.io"&gt;Design Gurus&lt;/a&gt; have popularized such problems, preparing aspirants for FAANG and other top tech company interviews.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;System Design Interviews:&lt;/strong&gt; Here, you're usually posed with designing a system or architecture. It tests your broader understanding of system components and how they interact. Check the following article for a detailed discussion on system design interview: &lt;a href="https://www.designgurus.io/blog/system-design-interview-guide"&gt;Demystifying System Design Interviews: A Guide&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Behavioral Interviews:&lt;/strong&gt; This focuses on your past experiences, behavior in certain scenarios, and how you deal with challenges or conflicts. They gauge your soft skills and are a predictor of how you'd fit into the company's culture.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Technical Screening:&lt;/strong&gt; Before an in-depth interview, many companies have a technical screening round, usually over the phone or through platforms like Codility. This is a preliminary check to see if you possess the basic technical skills required.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Take-home Assignments:&lt;/strong&gt; Some companies provide assignments that you must complete at home. These give a more extended window (like a week) and are beneficial for employers to see how you approach real-world tasks.&lt;/p&gt;

&lt;p&gt;To conclude, while strong technical skills are a necessity, soft skills and a keen understanding of what hiring managers are looking for can provide the edge you need to stand out.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Preparing for the Technical Aspects of the Interview
&lt;/h2&gt;

&lt;p&gt;Understanding the technical intricacies is pivotal for any software engineer. The coding interview can be a battleground, and the right preparation is your armor. Let's simplify how to tackle this.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Long It Takes to Prepare For a Technical Engineering Interview
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Time is subjective:&lt;/strong&gt; On average, dedicated aspirants spend 2-4 months preparing for technical interviews at top-tier companies. However, remember, it's not about the number of hours but the quality of your preparation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Consistency is key:&lt;/strong&gt; Like any skill, consistent practice hones your coding acumen. Spending even an hour daily on platforms like LeetCode can help you grasp patterns and improve speed. A survey from 2019 on CodeSignal revealed that candidates who practiced regularly, even for short durations, had a 20% higher success rate in interviews compared to intermittent learners.&lt;/p&gt;

&lt;h3&gt;
  
  
  Choosing a Programming Language
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Stick to what you know:&lt;/strong&gt; For coding interviews, it's advisable to pick a language you’re most comfortable with. Most companies are language-agnostic in interviews, prioritizing logic and problem-solving over syntax.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Popular choices:&lt;/strong&gt; While it's about comfort, languages like Python, Java, and JavaScript often emerge as favorites. Python's readability and simplicity make it a go-to choice for many. In fact, according to the PYPL (PopularitY of Programming Language) Index, Python's popularity grew by 18.9% in 2020, showcasing its rising prominence.&lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding Key Concepts: Arrays, Linked Lists, Hash Tables, etc.
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Arrays:&lt;/strong&gt; They are fundamental data structures that store elements of the same type. Understanding their operations, such as insertion, deletion, and traversal, is critical. Did you know? Almost 25% of problems on LeetCode are array-based!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Linked Lists:&lt;/strong&gt; Unlike arrays, linked lists have nodes connected by pointers. Mastering their types (singly, doubly) and operations can set you on the right track.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hash Tables:&lt;/strong&gt; This data structure is vital for optimizing solutions. They store key-value pairs and provide quick access, making them indispensable for problems involving frequencies or grouping. A fun fact – Hash tables are so versatile that their use-cases span from database indexing to caching!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Regular Practice:&lt;/strong&gt; These are just a few key concepts, and the realm of data structures and algorithms is vast. Regularly practicing and internalizing these structures can dramatically improve your problem-solving skills. According to GeeksforGeeks, understanding these basic data structures can help in solving around 70% of the coding problems in interviews.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. System Design and Behavioral Interview Preparation
&lt;/h2&gt;

&lt;p&gt;Beyond algorithms and code, a comprehensive interview prep must address &lt;a href="https://www.designgurus.io/course/grokking-the-system-design-interview"&gt;system design&lt;/a&gt; and &lt;a href="https://www.designgurus.io/course/grokking-behavioral-interview"&gt;behavioral questions&lt;/a&gt;. Let's unpack these aspects to ensure you present a holistic version of yourself in the interview.&lt;/p&gt;

&lt;h3&gt;
  
  
  Preparing for Behavioral Questions: The STAR Format
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Why Behavioral Questions Matter:&lt;/strong&gt; &lt;a href="https://medium.com/javascript-in-plain-english/acing-behavioral-questions-in-tech-interviews-tips-and-techniques-a9d19cf76a06"&gt;Behavioral questions&lt;/a&gt; might feel less technical, but they're just as vital. Companies are keen on understanding your experiences, decision-making process, and how you handle challenges. After all, a great coder with poor interpersonal skills might not be an asset in team projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The STAR Technique:&lt;/strong&gt; This is your &lt;a href="https://www.designgurus.io/course-play/grokking-behavioral-interview/doc/6415b5807671427224ce4d1c"&gt;secret weapon&lt;/a&gt; to nail behavioral questions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0paoSld5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/slsjco21uuoqpefh0ou9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0paoSld5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/slsjco21uuoqpefh0ou9.png" alt="STAR method" width="645" height="485"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Situation:&lt;/strong&gt; Begin by describing the context or backdrop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Task:&lt;/strong&gt; What were you responsible for?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Action:&lt;/strong&gt; Detail the specific steps you took to address the task.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Result:&lt;/strong&gt; Conclude with the outcome of your actions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, when asked about a time you faced a tight deadline, you could discuss a project, explain your responsibility, describe how you prioritized tasks, and finally, share the successful completion or lessons learned. &lt;a href="https://www.designgurus.io/course-play/grokking-behavioral-interview/doc/6415b8187671427224ce4fdf"&gt;solution&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A CareerBuilder survey highlighted that 62% of employers are looking for candidates who can effectively communicate – and using the STAR format is an excellent method to demonstrate this ability.&lt;/p&gt;

&lt;h3&gt;
  
  
  On-Site Interview: Personality Questions and Skill Tests
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The All-Encompassing On-Site:&lt;/strong&gt; After initial rounds, many companies invite candidates for an on-site interview. This comprehensive round aims to assess both your technical prowess and personality fit. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Personality Questions:&lt;/strong&gt; Here, interviewers want to gauge how well you'd mesh with the company culture. They might ask about your preferred work environment, teamwork experiences, or how you handle criticism. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Skill Tests:&lt;/strong&gt; While earlier rounds test foundational skills, on-site rounds might involve deeper dives into specialized areas. For instance, if you're applying for a web developer role, you might be asked to critique a website's design or pinpoint performance bottlenecks.&lt;/p&gt;

&lt;p&gt;A tip to remember: on-site interviews can be draining. A study by Glassdoor indicated that software engineer interviews, especially at top tech companies, can last more than two hours. So, ensure you’re well-rested and hydrated!&lt;/p&gt;

&lt;p&gt;To sum up this section, while technical skills can get your foot in the door, your behavioral responses and on-site performance can seal the deal. Approach them with the same rigor as you would a coding challenge. The more holistic your preparation, the better equipped you are to impress potential employers!&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Commonly Asked Interview Questions for Software Engineers
&lt;/h2&gt;

&lt;p&gt;Cracking a software engineering interview often requires familiarity with frequently asked questions. While each interview can be unique, several core questions test foundational skills and thought processes. Let's unravel some of these typical questions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Technical Questions
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Algorithm Challenges:&lt;/strong&gt; 

&lt;ul&gt;
&lt;li&gt;"Given an array of integers, find two numbers such that they add up to a specific target number." &lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63dda46a2f02a9827daabd4c"&gt;solution&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;"Given a positive integer, check if it is a prime number or not." &lt;a href="https://www.designgurus.io/course-play/grokking-recursion/doc/64ab9a845bc16cae75bee262"&gt;solution&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;"Given a stair with 'n' steps, implement a method to count how many possible ways are there to reach the top of the staircase, given that, at every step you can either take 1 step, 2 steps, or 3 steps." &lt;a href="https://www.designgurus.io/course-play/grokking-dynamic-programming/doc/64c39bef6d1933f7dbc98177"&gt;solution&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Why they're asked:&lt;/strong&gt; These gauge your algorithmic thinking and problem-solving prowess. Such questions assess if you can develop efficient solutions to common coding challenges.&lt;/p&gt;

&lt;p&gt;Check &lt;a href="https://www.designgurus.io/course/grokking-the-coding-interview"&gt;Grokking the Coding Interview&lt;/a&gt; for top coding patterns for interviews.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sBkVHmf6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8iaewjxgp9xy5p5po5zu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sBkVHmf6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8iaewjxgp9xy5p5po5zu.png" alt="Grokking the Coding Interview" width="800" height="328"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Data Structures:&lt;/strong&gt; 

&lt;ul&gt;
&lt;li&gt;"Explain the difference between a stack and a queue."&lt;/li&gt;
&lt;li&gt;"How would you implement a hash table?"&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Insight:&lt;/strong&gt; Data structures are the backbone of software engineering. Employers want to ensure you have a firm grip on these concepts, as they play a pivotal role in real-world applications.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Databases:&lt;/strong&gt; 

&lt;ul&gt;
&lt;li&gt;"Can you explain the difference between SQL and NoSQL?"&lt;/li&gt;
&lt;li&gt;"How would you optimize a slow-performing query?"&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Takeaway:&lt;/strong&gt; As data drives decisions in today's digital age, knowledge of databases is imperative. These questions assess your understanding of data storage, retrieval, and optimization.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conceptual and Design Questions
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Software Design Patterns:&lt;/strong&gt; 

&lt;ul&gt;
&lt;li&gt;"Can you explain the Singleton pattern and its use cases?"&lt;/li&gt;
&lt;li&gt;"What’s the difference between MVC and MVVM patterns?"&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt; These questions aim to understand if you're aware of established patterns that streamline software development, ensuring consistency and efficiency.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;System Design:&lt;/strong&gt; 

&lt;ul&gt;
&lt;li&gt;"How would you design a scalable global chat system like WhatsApp or Facebook Messenger?" &lt;a href="https://www.designgurus.io/course-play/grokking-the-system-design-interview/doc/638c0b65ac93e7ae59a1afe5"&gt;solution&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;"Describe the architecture you'd suggest for an e-commerce platform." &lt;a href="https://www.designgurus.io/course-play/grokking-the-object-oriented-design-interview/doc/637e7b54a29bb837e0c029d6"&gt;solution&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Understanding:&lt;/strong&gt; &lt;a href="https://medium.com/gitconnected/10-system-design-interview-questions-with-answers-i-wished-i-knew-before-the-interview-31dcfc3cddef"&gt;System design questions&lt;/a&gt; evaluate your broader perspective on software. They're not just about writing code but about how different components interact in a system.&lt;/p&gt;

&lt;h3&gt;
  
  
  Soft Skill and Behavioral Questions
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Teamwork and Collaboration:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Describe a time when you disagreed with a team member. How did you resolve it?"&lt;/li&gt;
&lt;li&gt;"Tell me about a challenging team project and your role in it."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The Rationale:&lt;/strong&gt; Companies are keen on team players. These questions gauge your ability to collaborate, communicate, and sometimes, compromise for the greater good.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Motivation and Passion:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Why did you choose a career in software engineering?"&lt;/li&gt;
&lt;li&gt;"What coding project are you most proud of, and why?"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The Reason:&lt;/strong&gt; Passion often drives excellence. Interviewers want to see if you're genuinely enthusiastic about coding and if you'll bring that zest to the workplace.&lt;/p&gt;

&lt;p&gt;To sum up, while technical prowess is vital, a holistic approach to these questions can set you apart. It's not always about the right answer but the journey you take to arrive there. Stay informed, practice regularly, and always approach questions with a problem-solving mindset. Remember, each question is an opportunity to showcase your expertise and passion!&lt;/p&gt;

&lt;h2&gt;
  
  
  Acing the Coding and Whiteboard Exercises
&lt;/h2&gt;

&lt;p&gt;In the realm of software engineering interviews, coding challenges and whiteboard exercises are the ultimate proving ground. These hands-on tests assess your ability to translate abstract problems into tangible solutions. Let's delve into strategies to shine in these exercises.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conquering the Whiteboard Exercise
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Understand Before You Write:&lt;/strong&gt; Before diving in, clarify any ambiguities. Asking questions not only showcases your thoroughness but ensures you're on the right track. As stated by TechCrunch, nearly 45% of interviewers are impressed when candidates ask insightful questions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Start with a Brute Force Solution:&lt;/strong&gt; It's okay to begin with a simple solution. Once outlined, you can then refine for better efficiency.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Explain Your Thought Process:&lt;/strong&gt; Articulation is crucial. The whiteboard isn't just about the final solution, but the journey to get there. A LinkedIn survey emphasized that 92% of hiring professionals value soft skills, like communication, equally or more than technical abilities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Test with Real-World Examples:&lt;/strong&gt; After jotting down your approach, walk through a real-world example. This checks the feasibility of your solution and potentially uncovers any oversights.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Embrace Feedback:&lt;/strong&gt; Sometimes, interviewers might play devil's advocate or suggest modifications. Rather than being defensive, adapt and iterate. This shows resilience and a willingness to learn.&lt;/p&gt;

&lt;h3&gt;
  
  
  Navigating Coding Challenges
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Optimize Your Workspace:&lt;/strong&gt; Whether it's an online IDE or a platform specified by the company, ensure you're familiar with the environment. A clutter-free, familiar workspace can significantly reduce unnecessary stress.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Time Management:&lt;/strong&gt; Most coding challenges are timed. Break down your total time – a fraction for understanding, a chunk for coding, and the remainder for testing. According to a report by HackerRank, 70% of employers zero in on problem-solving skills during coding tests. Being systematic can help manifest this skill.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Edge Cases are Crucial:&lt;/strong&gt; It's not enough to just solve the problem. Ensure your solution caters to edge cases. This demonstrates thoroughness and deep understanding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Maintain Clean Code:&lt;/strong&gt; Remember, it's not just about getting the solution but the quality of your code. Consistent naming conventions, comments, and modular code reflect professionalism and attention to detail.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Stay Calm and Debug:&lt;/strong&gt; Bugs are inevitable. If something goes awry, stay composed. A structured approach to debugging showcases your problem-solving aptitude under pressure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Your Next Steps for Software Engineer Interview Success
&lt;/h2&gt;

&lt;p&gt;You've traversed the depths of interview preparation, from understanding the intricacies of the process to nailing whiteboard challenges. Yet, as we wrap up this guide, it's pivotal to remember that preparation is an evolving journey, not a destination. So, what should be your subsequent steps for ensuring success?&lt;/p&gt;

&lt;h3&gt;
  
  
  Continuous Learning
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The Tech Landscape is Dynamic:&lt;/strong&gt; Software engineering is perpetually evolving. Stay updated with emerging technologies, languages, and industry trends. A survey by Stack Overflow emphasizes that 75% of developers learn a new technology every year. Be part of that proactive majority.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mock Interviews
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Practice Makes Perfect:&lt;/strong&gt; Beyond solitary preparation, engage in mock interviews. Platforms like Pramp or &lt;a href="https://www.designgurus.io/mock-interviews"&gt;Design Gurus&lt;/a&gt; offer real-time practice with peers or industry professionals. This not only sharpens your skills but offers invaluable feedback from a third-person perspective.&lt;/p&gt;

&lt;h3&gt;
  
  
  Build and Reflect
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Your Portfolio Speaks Volumes:&lt;/strong&gt; Regularly update your GitHub or portfolio with projects that you're passionate about. But don't just build – reflect on what you've created. Understand the 'why' behind your choices. This introspection aids in articulating your decisions during interviews.&lt;/p&gt;

&lt;h3&gt;
  
  
  Network and Engage
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;You're Not Alone:&lt;/strong&gt; Join local or online tech communities. Engage in discussions, attend webinars, or even participate in hackathons. A study by LinkedIn suggests that 85% of jobs are filled via networking. So, don't underestimate the power of genuine connections.&lt;/p&gt;

&lt;h3&gt;
  
  
  Self-care
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;A Healthy Mind in a Healthy Body:&lt;/strong&gt; While technical prowess is vital, mental and physical well-being is paramount. Regular breaks, hobbies, and even meditation can significantly reduce stress. After all, a relaxed mind can think clearer and innovate better.&lt;/p&gt;

&lt;p&gt;In essence, your journey towards software engineering interview success is a blend of technical mastery, continuous learning, and holistic well-being. It's not about memorizing solutions but understanding and enjoying the process. So, embrace the journey, celebrate small victories, and remember that every interview, whether successful or not, is a stepping stone to your ultimate goal. Keep coding, keep learning, and most importantly, keep believing in yourself!&lt;/p&gt;

&lt;p&gt;Follow me on &lt;a href="https://www.linkedin.com/in/arslanahmad/"&gt;LinkedIn&lt;/a&gt; and &lt;a href="https://arslan-ahmad.medium.com/"&gt;medium&lt;/a&gt; to get more insights on tech interviews.&lt;/p&gt;

</description>
      <category>interview</category>
      <category>systemdesign</category>
      <category>leetcode</category>
      <category>programming</category>
    </item>
    <item>
      <title>Building a distributed workflow engine from scratch</title>
      <dc:creator>Arik</dc:creator>
      <pubDate>Fri, 25 Aug 2023 22:00:00 +0000</pubDate>
      <link>https://dev.to/acoh3n/building-a-distributed-workflow-engine-from-scratch-22kl</link>
      <guid>https://dev.to/acoh3n/building-a-distributed-workflow-engine-from-scratch-22kl</guid>
      <description>&lt;p&gt;I've been somewhat obsessed with creating workflow engines for the better part of a decade. The idea of constructing a 'mega' machine from an army of smaller machines never seems to get old for me.&lt;/p&gt;

&lt;p&gt;At their core, workflow engines are responsible for executing a series of tasks (typically referred to as a 'job',  'pipeline' or 'workflow') over a cluster of machines (typically referred to as 'workers' or nodes) as quickly and as efficiently as possible.&lt;/p&gt;

&lt;p&gt;Building a workflow engine comes with a bunch of interesting challenges. Here's a short and highly non-exhaustive list:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;What do you use to author workflows? Do you use a general-purpose programming language? a configuration-type language like JSON or YAML or do you roll your own DSL (Domain Specific Language)?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How do we decide which tasks go to which workers such that busy workers are not overloaded while others are idle?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How do we deal with the requirement to scale up or down the capacity in response to fluctuations in computational demand?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How do we deal with intermittent task failures?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How do we deal with worker crashes?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How do we deal with a situation where we have more tasks to execute than available capacity?&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Let's put some rubber on the road
&lt;/h2&gt;

&lt;p&gt;The first time I needed to actually build a workflow engine was while working for a video streaming startup. At the time, the company was outsourcing all its video processing needs to another company. &lt;/p&gt;

&lt;p&gt;The existing process was slow, expensive and brittle. The company was regularly getting new content (movies, trailers, bonus video material, closed captions etc.) and we needed a way to quickly process this content in order to get it up on the service for customers to enjoy.&lt;/p&gt;

&lt;p&gt;Moreover, the existing process was quite rigid and any changes to it (e.g. to introduce a new audio technology) took months or were simply not possible. I suggested to build a proof-of-concept that would allows us to bring the work in-house and luckily my managers were open to the idea.&lt;/p&gt;

&lt;p&gt;At this point, you're probably asking yourself why would you want to be build one when there are a million open-source and commercial options out there?&lt;/p&gt;

&lt;p&gt;True, there are &lt;a href="https://github.com/meirwah/awesome-workflow-engines"&gt;many options&lt;/a&gt; out there. And we looked at a good number before we made the decision to build one ourselves. But at least at the time (circa 2014), many of the existing options were either not designed for a distributed environment, were designed more particularly for data-processing use cases, were seemingly abandoned, or simply felt over-engineered to our taste.&lt;/p&gt;

&lt;p&gt;The initial iteration of the workflow engine allowed us to start processing 'low-risk' content such as trailers, and as we gained confidence in the new system we slowly phased out the old process completely. &lt;/p&gt;

&lt;p&gt;Later on, when a co-worker left to another media company that needed a similar system, he asked me if I'd like to come over and do it all over again from scratch. Naturally, I agreed. Our 2.0 was similar in spirit but a lot of the lessons learned from the old design were fixed in the new design. &lt;/p&gt;

&lt;h2&gt;
  
  
  Meet Tork
&lt;/h2&gt;

&lt;p&gt;After building two proprietary workflow engines for highly specialized use cases I had an itch to see if other companies - possibly with vastly different use cases - could also benefit from a similar system. So I decided to build an open-source version of it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fpO7vZV0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5lvh4fzqzlumhjnjbyxz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fpO7vZV0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5lvh4fzqzlumhjnjbyxz.png" alt="Architecture" width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Tork is a Golang-based implementation which is very similar in spirit to its closed-source predecessors. It can run in a 'standalone' mode on a laptop or deployed to a huge cluster of machines depending on your need.&lt;/p&gt;

&lt;p&gt;The main components of Tork are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Coordinator&lt;/strong&gt;: responsible for managing the lifecycle of jobs and tasks, routing tasks to the right workers and for dealing with task execution errors.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Worker&lt;/strong&gt;: responsible for executing tasks according to the instructions of the Coordinator. Workers are stateless so it's easy to add and remove them as demand for capacity changes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Broker&lt;/strong&gt;: the means of communication between the Coordinator and worker nodes. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Datastore&lt;/strong&gt;: holds the state for tasks and jobs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Runtime&lt;/strong&gt;: tasks are executed by means of a runtime which translates the task into actual executable. Currently only Docker is supported due to its ubiquity and large library of images, but there are plans to add support for Podman and WASM in the future.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're interested in checking it out, you can find the project on Github: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Backend: &lt;a href="https://github.com/runabol/tork"&gt;https://github.com/runabol/tork&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Web UI: &lt;a href="https://github.com/runabol/tork-web"&gt;https://github.com/runabol/tork-web&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>workflowengine</category>
      <category>go</category>
      <category>opensource</category>
      <category>distributedsystems</category>
    </item>
    <item>
      <title>41 Frontend Interview Questions - CSS</title>
      <dc:creator>Yan Levin</dc:creator>
      <pubDate>Fri, 25 Aug 2023 21:35:36 +0000</pubDate>
      <link>https://dev.to/m_midas/41-frontend-interview-questions-css-4imc</link>
      <guid>https://dev.to/m_midas/41-frontend-interview-questions-css-4imc</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Expertise in CSS and the ability to implement the necessary UI components for a business is an important skill for a Frontend developer, which sets you apart as a candidate for your dream job. This article covers 41 questions in a 'question: answer' format that I encountered during Frontend Developer job interviews. &lt;br&gt;
This article is the second part of a series on interview questions for frontend developers. If you haven't read the article on JavaScript interview questions yet, I recommend checking it out using the provided link - &lt;a href="https://dev.to/m_midas/52-frontend-interview-questions-javascript-59h6"&gt;52 Frontend Interview Questions - JavaScript&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  1. What are the values of the &lt;code&gt;display&lt;/code&gt; property and how do they work?
&lt;/h3&gt;

&lt;p&gt;The CSS property "display" determines how a specific HTML element should be displayed.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;display: none&lt;/code&gt; - The simplest value. The element is not displayed at all.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;display: block&lt;/code&gt; - Block elements are stacked vertically, one on top of the other. The block tries to expand to the full available width.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;display: inline&lt;/code&gt; - Elements are placed on the same line, sequentially. The width and height of the element are determined by its content and cannot be manually changed.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;display: inline-block&lt;/code&gt; - The element is inline, but its width and height can be changed.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;display: flex&lt;/code&gt; - flexbox usage. Recommend to check out the links.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;display: grid&lt;/code&gt; - grid usage. Recommend to check out the links as well.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There are other values, but they are rarely used.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/display"&gt;Learn more&lt;/a&gt;&lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox"&gt;Learn more&lt;/a&gt;&lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout"&gt;And even more&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  2. What is flexbox?
&lt;/h3&gt;

&lt;p&gt;Flexbox is a layout module that provides a flexible way to arrange and align elements within a container. It allows for easy manipulation of the size, position, and spacing of elements, making it ideal for creating responsive and dynamic layouts. With flexbox, you can easily create complex and multi-directional layouts without relying on floats or positioning hacks. It provides a powerful set of properties and values that enable you to control the flow and alignment of elements within a container.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox"&gt;Learn more&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  3. What is grid?
&lt;/h3&gt;

&lt;p&gt;Grid is a layout system that allows you to create complex, grid-based designs for web pages. CSS Grid Layout provides a two-dimensional grid structure, where you can define rows and columns to position and align elements within the grid.&lt;/p&gt;

&lt;p&gt;With Grid, you can divide your webpage into a grid of cells, specifying the size and alignment of each cell. This allows for precise control over the placement and arrangement of elements, making it easier to create responsive and flexible layouts.&lt;/p&gt;

&lt;p&gt;Key features of CSS Grid include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Grid Container&lt;/strong&gt;: The parent element that holds the grid items and defines the overall grid.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Grid Items&lt;/strong&gt;: The child elements placed within the grid container.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Grid Lines&lt;/strong&gt;: The horizontal and vertical lines that divide the grid into rows and columns.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Grid Tracks&lt;/strong&gt;: The spaces between grid lines where grid items are placed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Grid Areas&lt;/strong&gt;: Named areas within the grid used for placing multiple grid items.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;CSS Grid provides powerful features like &lt;code&gt;grid-template-columns&lt;/code&gt;, &lt;code&gt;grid-template-rows&lt;/code&gt;, &lt;code&gt;grid-gap&lt;/code&gt;, and &lt;code&gt;grid-template-areas&lt;/code&gt;, allowing you to control the size, positioning, and order of grid items. It offers great flexibility and control over the layout, making it a popular choice for modern web design.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout"&gt;Learn more&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  4. What are keyframes?
&lt;/h3&gt;

&lt;p&gt;Keyframes are used to define specific animation steps or states during an animation. They allow you to specify the intermediate styles or property values that an element should have at various points in time during the animation.&lt;/p&gt;

&lt;p&gt;Keyframes are defined using the @keyframes rule in CSS. Inside the @keyframes rule, you define the animation steps by setting the CSS properties and values at specific percentages or using keywords such as &lt;code&gt;from&lt;/code&gt; and &lt;code&gt;to&lt;/code&gt; which represent &lt;strong&gt;0%&lt;/strong&gt; and &lt;strong&gt;100%&lt;/strong&gt;, respectively.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@keyframes&lt;/span&gt; &lt;span class="n"&gt;slideIn&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nt"&gt;from&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;margin-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;250%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; 
    &lt;span class="nt"&gt;to&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nl"&gt;margin-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0%&lt;/span&gt;
       &lt;span class="n"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@keyframes"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  5. What is the &lt;code&gt;position&lt;/code&gt; property? What values does it accept and how does each value behave?
&lt;/h3&gt;

&lt;p&gt;The position property allows you to move an element from its normal static position. By default, elements are considered to have &lt;strong&gt;static&lt;/strong&gt; positioning. Here are some more most popular positioning. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Relative&lt;/strong&gt; positioning shifts the element relative to its normal position. To apply relative positioning, you need to specify the CSS property position: relative and the coordinates left/right/top/bottom.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;right&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Absolute&lt;/strong&gt; positioning causes the element to disappear from its original position and be repositioned. Other elements are positioned as if this element never existed. The coordinates top/bottom/left/right for the new position are calculated relative to the nearest positioned parent, which is a parent with a positioning other than static. If there is no such parent, the coordinates are calculated relative to the document.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;absolute&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;right&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fixed&lt;/strong&gt; positioning freezes the block in place, so when the page is scrolled, the fixed element remains in its position and does not scroll with the page.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;absolute&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;right&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sticky&lt;/strong&gt; positioning is similar to fixed positioning, but it is attached within a specific block rather than the entire document.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/position"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  6. How to create a custom checkbox?
&lt;/h3&gt;

&lt;p&gt;Before the checkbox, a label is created and attached to the input. Then the input is hidden, and the label is styled as needed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"first"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"checkbox"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"first"&lt;/span&gt; &lt;span class="na"&gt;checked&lt;/span&gt; &lt;span class="na"&gt;hidden&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;label&lt;/span&gt; &lt;span class="na"&gt;for=&lt;/span&gt;&lt;span class="s"&gt;"first"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Checkbox checked&lt;span class="nt"&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://www.w3schools.com/howto/howto_css_custom_checkbox.asp"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  7. How to center a div?
&lt;/h3&gt;

&lt;p&gt;There are several ways, but the simplest one is to make the parent element using &lt;code&gt;display: flex&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.parent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  8. What is the &lt;code&gt;transition&lt;/code&gt; property?
&lt;/h3&gt;

&lt;p&gt;Transition allows you to define a transitional state between two states of an element. Different states can be defined using pseudo-classes such as &lt;code&gt;:hover&lt;/code&gt; or &lt;code&gt;:active&lt;/code&gt;, or dynamically set using JavaScript.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transition"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  9. What is &lt;code&gt;box-sizing&lt;/code&gt;?
&lt;/h3&gt;

&lt;p&gt;The CSS property box-sizing determines how the total width and height of an element are calculated. When set to &lt;code&gt;border-box&lt;/code&gt;, the width and height properties include the content, padding, and borders, but do not include the margin.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  10. What are inline styles?
&lt;/h3&gt;

&lt;p&gt;This is inline styles that are written directly in HTML and they have the highest priority (excluding !important).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"color: yellow;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;This is p tag&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  11. What is the difference between &lt;code&gt;border&lt;/code&gt; and &lt;code&gt;outline&lt;/code&gt;?
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Outline does not affect the position of the element and its dimensions.&lt;/li&gt;
&lt;li&gt;Outline does not allow to set a border on a specific side of the element (only on all sides at once).&lt;/li&gt;
&lt;li&gt;Outline does not apply corner rounding set by the border-radius property.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/border"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/outline"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  12. What do you know about responsive web design?
&lt;/h3&gt;

&lt;p&gt;Responsive web design refers to the approach of designing and developing websites in a way that allows them to adapt and respond to various screen sizes and devices. It involves creating flexible layouts, using fluid grids, and employing media queries to ensure optimal viewing experiences across different devices and resolutions. This approach aims to provide users with a seamless and user-friendly browsing experience, regardless of the device they are using.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Responsive_Design"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  13. How does a browser process a web page?
&lt;/h3&gt;

&lt;p&gt;When a browser processes a web page, it goes through several steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Parsing HTML&lt;/strong&gt;. The received HTML document is used to form the &lt;strong&gt;DOM&lt;/strong&gt; (Document Object Model)&lt;/li&gt;
&lt;li&gt;Styles are loaded and recognized, forming the &lt;strong&gt;CSSOM&lt;/strong&gt; (CSS Object Model).&lt;/li&gt;
&lt;li&gt; Based on the DOM and CSSOM, a render tree is formed, which is a set of rendering objects (referred to as "renderer" or "render object" in Webkit and "frame" in Gecko). The render tree duplicates the structure of the DOM, but invisible elements (such as &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; or elements with &lt;code&gt;display:none;&lt;/code&gt;) are not included. Each text line is also represented as a separate renderer in the render tree. Each rendering object contains its corresponding DOM object (or text block) and the calculated style for that object. In simple terms, the render tree describes the visual representation of the DOM.&lt;/li&gt;
&lt;li&gt;The position on the page is calculated for each element in the render tree - this is called &lt;strong&gt;layout&lt;/strong&gt;. Browsers use a flow method, where in most cases, only one pass is needed to position all elements (more passes are required for tables).&lt;/li&gt;
&lt;li&gt;Finally, all of this is rendered in the browser - this is called &lt;strong&gt;painting&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/Performance/How_browsers_work"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  14. What is BEM (Block Element Modifier)?
&lt;/h3&gt;

&lt;p&gt;BEM (Block, Element, Modifier) is a component-based approach to web development. It is based on the principle of dividing the interface into independent blocks. It allows for easy and fast development of interfaces of any complexity and reusing existing code, avoiding "Copy-Paste".&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q0EA1J0W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3kw05dv21d9g87c1hy0q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q0EA1J0W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3kw05dv21d9g87c1hy0q.png" alt="BEM_example" width="663" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://en.bem.info/methodology/css/"&gt;Learn more&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  15. What is the difference between inline and block elements?
&lt;/h3&gt;

&lt;p&gt;Elements in HTML are also divided into block and inline elements. Block elements are elements that serve as building blocks for web pages. They are used to separate the content of a web page into logical blocks, such as menus, headers, content blocks, footer, etc. Block elements are written on a new line; a line break is automatically added before and after these elements in the browser.&lt;/p&gt;

&lt;p&gt;Block elements include &lt;code&gt;&amp;lt;address&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;aside&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;blockquote&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;dd&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;dl&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;dt&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;fieldset&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;figcaption&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;form&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;h1&amp;gt;-&amp;lt;h6&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;hr&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;noscript&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;ol&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;output&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;pre&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;table&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;tfoot&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;video&amp;gt;&lt;/code&gt;. All block elements have opening and closing tags.&lt;/p&gt;

&lt;p&gt;Inline elements mark parts of the content within elements. They only occupy a limited space defined by the tags, and the browser does not automatically add line breaks.&lt;/p&gt;

&lt;p&gt;Inline elements include &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;abbr&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;acronym&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;b&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;bdo&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;big&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;br&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;cite&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;code&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;dfn&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;i&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;input&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;kbd&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;label&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;map&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;object&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;q&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;samp&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;small&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;sub&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;sup&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;textarea&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;time&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;tt&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;var&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.w3schools.com/html/html_blocks.asp"&gt;Learn more&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  16. What is the difference between &lt;code&gt;margin&lt;/code&gt; and &lt;code&gt;padding&lt;/code&gt;?
&lt;/h3&gt;

&lt;p&gt;Margin - external margins.&lt;br&gt;
Padding - internal margins.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ufCuy1m1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hcyz7pp4lmy59v7j7tts.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ufCuy1m1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hcyz7pp4lmy59v7j7tts.png" alt="Margin and Padding" width="240" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin"&gt;Learn more&lt;/a&gt;&lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/padding"&gt;Learn more&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  17. What is the purpose of the &lt;code&gt;overflow&lt;/code&gt; property and when should it be used?
&lt;/h3&gt;

&lt;p&gt;The CSS property &lt;code&gt;overflow&lt;/code&gt; determines whether the content of an overflowing block element should be clipped, provide scroll bars, or simply be displayed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/overflow"&gt;Learn more&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  18. What are &lt;code&gt;vh&lt;/code&gt; and &lt;code&gt;vw&lt;/code&gt; units?
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;vh&lt;/code&gt; and &lt;code&gt;vw&lt;/code&gt; are relative units and represent:&lt;br&gt;
&lt;code&gt;vh&lt;/code&gt; - 1% of the browser window's height.&lt;br&gt;
&lt;code&gt;vw&lt;/code&gt; - 1% of the browser window's width.&lt;/p&gt;
&lt;h3&gt;
  
  
  19. How to change the appearance of a cursor?
&lt;/h3&gt;

&lt;p&gt;The CSS property &lt;code&gt;cursor&lt;/code&gt; is used to change the appearance of the cursor.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;pointer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/cursor"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  20. How to change the flexbox container's axis direction?
&lt;/h3&gt;

&lt;p&gt;The CSS property &lt;code&gt;flex-direction&lt;/code&gt; is used to change the direction of the flexbox container axis.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction"&gt;Learn more&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  21. What determines the size of an element?
&lt;/h3&gt;

&lt;p&gt;The size of an element is constructed from the width and height of its content, inner padding, border, and outer margin.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ufCuy1m1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hcyz7pp4lmy59v7j7tts.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ufCuy1m1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hcyz7pp4lmy59v7j7tts.png" alt="Element size" width="240" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  22. How to position one element relative to another?
&lt;/h3&gt;

&lt;p&gt;To control the positioning of a child element, set the position property to &lt;code&gt;relative&lt;/code&gt; and use top/right/bottom/left to adjust its placement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.element&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/position"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  23. What are the main properties of flexbox?
&lt;/h3&gt;

&lt;p&gt;The main properties of flexbox are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;display:&lt;/code&gt; Specifies the element as a flex container.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;flex-direction:&lt;/code&gt; Specifies the direction of the flex items (row, row-reverse, column, column-reverse).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;flex-wrap:&lt;/code&gt; Specifies whether the flex items should wrap or not (nowrap, wrap, wrap-reverse).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;justify-content:&lt;/code&gt; Specifies how the flex items are aligned along the main axis (flex-start, flex-end, center, space-between, space-around).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;align-items:&lt;/code&gt; Specifies how the flex items are aligned along the cross axis (flex-start, flex-end, center, baseline, stretch).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;align-content:&lt;/code&gt; Specifies how multiple lines of flex items are aligned along the cross axis when there is extra space (flex-start, flex-end, center, space-between, space-around, stretch).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;flex-grow:&lt;/code&gt; Specifies how much a flex item can grow relative to other items.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;flex-shrink:&lt;/code&gt; Specifies how much a flex item can shrink relative to other items.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;flex-basis:&lt;/code&gt; Specifies the initial size of a flex item before any remaining space is distributed.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;order:&lt;/code&gt; Specifies the order in which the flex items appear within their container.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These properties allow for flexible and responsive layouts by dynamically adjusting the size and position of flex items within a container.&lt;/p&gt;

&lt;h3&gt;
  
  
  24. How to remove the bullet point from a list?
&lt;/h3&gt;

&lt;p&gt;Set the &lt;code&gt;list-style-type&lt;/code&gt; property to &lt;strong&gt;none&lt;/strong&gt; for the corresponding list element. Here's an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;ul&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;list-style-type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  25. What do you know about selector specificity?
&lt;/h3&gt;

&lt;p&gt;Selector specificity determines the priority of selectors in a style sheet. The more specific a selector is, the higher its priority. Each selector has a weight:&lt;/p&gt;

&lt;p&gt;Element selector - &lt;strong&gt;1&lt;/strong&gt;&lt;br&gt;
Class selector - &lt;strong&gt;10&lt;/strong&gt;&lt;br&gt;
ID selector - &lt;strong&gt;100&lt;/strong&gt;&lt;br&gt;
Inline style - &lt;strong&gt;1000&lt;/strong&gt;&lt;br&gt;
!important - has the &lt;strong&gt;highest&lt;/strong&gt; weight.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity"&gt;Learn more&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  26. Which CSS styles are most performance-heavy for browsers?
&lt;/h3&gt;

&lt;p&gt;A large number of &lt;strong&gt;connected fonts, shadows, animations, and transparency&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  27. What are pseudo-classes and which ones do you know?
&lt;/h3&gt;

&lt;p&gt;Pseudo-classes describe characteristics of elements, such as dynamic states (e.g., a clicked link), language encoding (e.g., a paragraph in French), and more. They are not displayed in the source document and do not belong to the DOM tree. The most commonly used ones are &lt;code&gt;:hover&lt;/code&gt;, &lt;code&gt;:focus&lt;/code&gt;, &lt;code&gt;:checked&lt;/code&gt;, &lt;code&gt;:disabled&lt;/code&gt;, and others.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes"&gt;Lean more&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  28. How to rotate a block by 90 degrees?
&lt;/h3&gt;

&lt;p&gt;To rotate a block element by 90 degrees you can use the &lt;code&gt;transform&lt;/code&gt; property along with the &lt;code&gt;rotate&lt;/code&gt; function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.block&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;rotate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;90deg&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will rotate the block element clockwise by 90 degrees. You can adjust the angle by changing the value inside the &lt;code&gt;rotate&lt;/code&gt; function.&lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform"&gt;Learn more&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  29. What pseudo-elements do you know?
&lt;/h3&gt;

&lt;p&gt;A pseudo-element in CSS is a keyword added to a selector that allows styling a specific part of the selected element. For example, the pseudo-element &lt;code&gt;::first-line&lt;/code&gt; can be used to change the font of the first line of a paragraph.&lt;br&gt;
The most commonly used pseudo-elements are: &lt;code&gt;::after&lt;/code&gt;, &lt;code&gt;::before&lt;/code&gt;, &lt;code&gt;::placeholder&lt;/code&gt;, &lt;code&gt;::first-letter&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="nd"&gt;::first-line&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;text-transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;uppercase&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  30. What is &lt;code&gt;!important&lt;/code&gt; and how do you feel about it?
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;!important&lt;/code&gt; declaration is used to give a style rule the highest priority, overriding any other rules that conflict with it. When applied to a CSS property, &lt;code&gt;!important&lt;/code&gt; ensures that the specified value will be used, regardless of specificity or order of other rules.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;!important&lt;/code&gt; use is generally discouraged due to some potential drawbacks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Specificity issues: Using &lt;code&gt;!important&lt;/code&gt; can lead to specificity conflicts and make it difficult to maintain or override styles in the future.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Difficulty in debugging: When multiple stylesheets or rules use &lt;code&gt;!important&lt;/code&gt;, it becomes harder to diagnose and troubleshoot styling issues.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Inflexibility: It limits the flexibility and modularity of stylesheets, making it challenging to make changes or apply different styles to specific elements without modifying existing &lt;code&gt;!important&lt;/code&gt; rules.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Code readability and scalability: Overusing &lt;code&gt;!important&lt;/code&gt; can make the codebase less organized and harder to read, especially in larger projects.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In general, it's best to avoid using &lt;code&gt;!important&lt;/code&gt; unless absolutely necessary, and instead utilize proper specificity and cascading principles to achieve desired styling effects.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/important"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  31. What is the difference between &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;script async&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;script defer&amp;gt;&lt;/code&gt;?
&lt;/h3&gt;

&lt;p&gt;The browser loads and displays HTML gradually, especially noticeable with slow internet connections. The browser doesn't wait for the entire page to load before showing it; instead, it displays the portion that has been loaded.&lt;/p&gt;

&lt;p&gt;If the browser encounters a &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag, it is typically required by the standard to execute it first before displaying the remaining page content. This means that the loading happens synchronously from top to bottom.&lt;/p&gt;

&lt;p&gt;If the script is external, the browser won't display the content below it until the script has been executed.&lt;/p&gt;

&lt;p&gt;When using the &lt;code&gt;async&lt;/code&gt; and &lt;code&gt;defer&lt;/code&gt; attributes, the browser starts loading scripts asynchronously, without delaying the display of HTML.&lt;/p&gt;

&lt;p&gt;However, &lt;code&gt;defer&lt;/code&gt; is used when the order of script execution is important. Scripts will be loaded synchronously but sequentially. Another difference is that &lt;code&gt;defer&lt;/code&gt; will only execute after the entire HTML has been processed by the browser, whereas &lt;code&gt;async&lt;/code&gt; starts loading immediately, even before the HTML finishes loading.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://javascript.info/script-async-defer"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  32. How to increase the size of an element on hover without shifting neighboring elements?
&lt;/h3&gt;

&lt;p&gt;To increase the size of an element on hover without shifting neighboring elements, you can use &lt;code&gt;transform&lt;/code&gt; property along with the &lt;code&gt;scale&lt;/code&gt; function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.element&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;transition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;transform&lt;/span&gt; &lt;span class="m"&gt;0.3s&lt;/span&gt; &lt;span class="n"&gt;ease&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.element&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1.2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the &lt;code&gt;transition&lt;/code&gt; property adds a smooth transition effect to the transformation. When hovering over the element, the &lt;code&gt;transform: scale(1.2)&lt;/code&gt; rule scales the element by 20%, making it larger without affecting the layout or shifting neighboring elements.&lt;/p&gt;

&lt;p&gt;By using &lt;code&gt;transform: scale()&lt;/code&gt;, the element's size increases while maintaining its original position in the layout.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  33. What are media queries?
&lt;/h3&gt;

&lt;p&gt;Media queries are used in cases where different CSS styles need to be applied for different devices based on their display type (e.g., printer, monitor, or smartphone), as well as specific device characteristics (e.g., browser window width) or external environment conditions (e.g., ambient lighting). Given the vast number of internet-connected devices, media queries are a crucial tool for creating websites and applications that will function properly on all available devices used by your users.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="n"&gt;screen&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;768px&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_media_queries/Using_media_queries"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  34. For what data attributes are recommended to use?
&lt;/h3&gt;

&lt;p&gt;Data attributes are recommended to use when you want to store custom data within HTML elements. They should be used when there is a need to attach additional information to an element that is not specifically represented by an existing HTML attribute.&lt;/p&gt;

&lt;p&gt;Data attributes are prefixed with &lt;code&gt;data-&lt;/code&gt; and can have any name following it. It is recommended to follow a naming convention that is descriptive, meaningful, and avoids potential conflicts with existing or future standard HTML attributes. For example, if you want to store information about a specific product on an e-commerce website, you can use a data attribute like &lt;code&gt;data-product-id&lt;/code&gt; to store the unique identifier of the product.&lt;/p&gt;

&lt;p&gt;By using data attributes, you can easily access and manipulate this custom data. It provides a way to enhance the functionality and behavior of your website or application without modifying the standard HTML attributes or structure.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;article&lt;/span&gt;
  &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"some-article"&lt;/span&gt;
  &lt;span class="na"&gt;data-columns=&lt;/span&gt;&lt;span class="s"&gt;"4"&lt;/span&gt;
  &lt;span class="na"&gt;data-index-number=&lt;/span&gt;&lt;span class="s"&gt;"213124"&lt;/span&gt;
  &lt;span class="na"&gt;data-parent=&lt;/span&gt;&lt;span class="s"&gt;"wrapper"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  …
&lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes"&gt;Learn more&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  35. How to create an infinite animation?
&lt;/h3&gt;

&lt;p&gt;To create an infinite animation, you can use the &lt;code&gt;animation&lt;/code&gt; property and set the value of &lt;code&gt;animation-iteration-count&lt;/code&gt; to &lt;code&gt;infinite&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.element&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;myAnimation&lt;/span&gt; &lt;span class="m"&gt;2s&lt;/span&gt; &lt;span class="n"&gt;infinite&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;@keyframes&lt;/span&gt; &lt;span class="n"&gt;myAnimation&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;/* Define the animation keyframes */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animations/Using_CSS_animations"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  36. What is an attribute selector?
&lt;/h3&gt;

&lt;p&gt;Attribute selectors select elements based on the presence of an attribute or its value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"https://example.org"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;span&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;lang&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;'en-US'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  37. How to change styles for a button with the &lt;code&gt;disabled&lt;/code&gt; attribute?
&lt;/h3&gt;

&lt;p&gt;To select an element with the attribute "disabled" set, you need to use attribute selectors.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;disabled&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  38. How to change styles for a &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt; element that comes after an &lt;code&gt;&amp;lt;input&amp;gt;&lt;/code&gt; element?
&lt;/h3&gt;

&lt;p&gt;The adjacent selector is designed for this purpose. Adjacent elements on a web page are called "adjacent" when they immediately follow each other in the document's code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nt"&gt;span&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors/Combinators"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  39. Which selector can be used to apply a style to every element on a page?
&lt;/h3&gt;

&lt;p&gt;Sometimes, it is necessary to apply the same style to all elements on a web page, such as setting the font or text formatting. In such cases, a universal selector can be used, which matches any element on the web page.&lt;/p&gt;

&lt;p&gt;To denote the universal selector, the asterisk (*) symbol is used, and the syntax is as follows.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;box-sizing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;border-box&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Universal_selectors"&gt;Lean more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  40. What are CSS preprocessors, which ones do you know, and what are they used for?
&lt;/h3&gt;

&lt;p&gt;A preprocessor is a program that takes input code written in a preprocessor language and outputs CSS that can be given to our browser. Preprocessors simplify the process of styling if you know how to use them.&lt;/p&gt;

&lt;p&gt;There are several representatives of preprocessors, such as &lt;strong&gt;Sass / SCSS&lt;/strong&gt; (.sass, .scss), &lt;strong&gt;Less&lt;/strong&gt; (.less), and &lt;strong&gt;Stylus&lt;/strong&gt; (.stylus). More often, preprocessors add new capabilities to CSS:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nesting&lt;/li&gt;
&lt;li&gt;Mixins&lt;/li&gt;
&lt;li&gt;Additional functions&lt;/li&gt;
&lt;li&gt;Modularity&lt;/li&gt;
&lt;li&gt;Variables&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Glossary/CSS_preprocessor"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  41. What are mixins in preprocessors?
&lt;/h3&gt;

&lt;p&gt;A mixin is a function that takes arguments and applies rules dependent on these arguments to a given selector. Mixins allow you to create groups of CSS declarations that you will have to use multiple times on a website. You can even pass variables into mixins to make them more flexible.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://sass-lang.com/documentation/at-rules/mixin/"&gt;Learn more&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Preparing for these CSS questions, studying the topics covered, and reviewing relevant resources can improve your chances of successfully passing the interview. This post is the second part of a series of post on interview questions. The next one will be about React interview questions that I have faced.&lt;/p&gt;

&lt;p&gt;I look forward to your reactions and comments.&lt;br&gt;
Good luck in your interview!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>career</category>
      <category>frontend</category>
    </item>
    <item>
      <title>🐦 Inventing Issues to Solve Real Problems: My Dive into Jira Connector Development</title>
      <dc:creator>Adam Crockett</dc:creator>
      <pubDate>Fri, 25 Aug 2023 21:27:17 +0000</pubDate>
      <link>https://dev.to/adam_cyclones/inventing-issues-to-solve-real-problems-my-dive-into-jira-tool-development-3ol9</link>
      <guid>https://dev.to/adam_cyclones/inventing-issues-to-solve-real-problems-my-dive-into-jira-tool-development-3ol9</guid>
      <description>&lt;p&gt;Starting from scratch can be a puzzle, can't it? Even more of a head scratch-er if you only have some of the pieces! &lt;br&gt;
Here I am with a tool in the works ready to tackle Jira issues in an innovative way (more on that in earlier posts). But for this chat, let's sidestep those specifics. My aim? To guide you on tackling tasks from platforms like Jira, Assana, GitHub issues, and the like, even if you don’t have an actual company’s problems at hand.&lt;/p&gt;
&lt;h2&gt;
  
  
  Ready?
&lt;/h2&gt;

&lt;p&gt;Ive done all the pondering already so you don't have to, go setup a Jira &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VOtOjtiA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/16fbys93rrqybhkkctpz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VOtOjtiA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/16fbys93rrqybhkkctpz.png" alt="Setting up jira free plan" width="800" height="818"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go ahead and setup a free Jira for your org, mine is Amalgam (that’s the name of the tool I’m writing).&lt;/p&gt;

&lt;p&gt;Now then just select the basics when prompted.&lt;/p&gt;
&lt;h2&gt;
  
  
  Now what?
&lt;/h2&gt;

&lt;p&gt;I have a board, its empty, I need to populate it with junk so that my tool can solve problems that my real customers would face, I have no time for this... Oh ChatGPT, come here a sec!&lt;/p&gt;
&lt;h3&gt;
  
  
  Prompts
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User
I am writing a tool that needs to consume Jira issues, I need a fake project idea and a issue to raise, make sure its a bit silly and animal related.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;It gave me something complex so I said&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User
make it a todo list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Its very important to choose a ridiculous idea that is very narrow in scope such as a todo list, because these are our new test cases, we understand what a todo list is. we need to understand a tiny bit about what the fake company is so we can sense check. The plan is to use our new tool and test against this test case company and its issues.&lt;/p&gt;

&lt;p&gt;I suggest creating one bug and one feature or whatever you might need, you will need to enable those issue types.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TJHwisId--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b7le6z8a28q7fvin64ug.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TJHwisId--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b7le6z8a28q7fvin64ug.png" alt="Image description" width="800" height="525"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  A bug
&lt;/h3&gt;

&lt;p&gt;Ask ChatGPT to create your first bug. Be aware that it may mention attachments; such as customer complaint screenshots, if your tool is going to use images, you need to mock those, I suggest getting it to write that for you and then fake it to look real like mocking it into a Zendesk style UI.&lt;/p&gt;

&lt;h3&gt;
  
  
  A Feature
&lt;/h3&gt;

&lt;p&gt;It might mention a flowchart attachments this time, ask it to provide a serialized flow chart and ask it to suggest a way to generate the image - many things can be serialized you would be surprised.&lt;/p&gt;

&lt;p&gt;For every rich detail it gives you... it will present you with problems, you don`t have to solve them yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  The end
&lt;/h2&gt;

&lt;p&gt;I now have my Jira test cases, now I can go and write my Amalgam SaaS tool :D&lt;/p&gt;

</description>
      <category>devops</category>
      <category>bdd</category>
      <category>productivity</category>
      <category>ai</category>
    </item>
    <item>
      <title>Part 4 (a): Project: How to Build a Mini App with Vue.Js</title>
      <dc:creator>Makanju Emmanuel</dc:creator>
      <pubDate>Fri, 25 Aug 2023 21:01:24 +0000</pubDate>
      <link>https://dev.to/miracool/part-4-a-project-how-to-build-a-mini-app-with-vuejs-3nc2</link>
      <guid>https://dev.to/miracool/part-4-a-project-how-to-build-a-mini-app-with-vuejs-3nc2</guid>
      <description>&lt;p&gt;In this article, you will learn how to build a Todo app with Vue.js. If you have any issues getting started with vue fundamentals, please start from the first chapter of this &lt;a href="https://dev.to/miracool/vue-made-easy-introduction-1dec"&gt;series&lt;/a&gt;. Most of what you will be learning is based on the knowledge you have acquired.&lt;/p&gt;

&lt;p&gt;This is not a regular front-end-specific to-do app because all the features needed to help you get started on building projects will be available in this app. For example, it will feature: &lt;a href=""&gt;authentication&lt;/a&gt;, &lt;a href=""&gt;unit testing&lt;/a&gt;, &lt;a href="https://dev.to/miracool/a-comprehensive-guide-to-pinia-3bd1"&gt;pinia state management&lt;/a&gt;, &lt;a href=""&gt;api implementation&lt;/a&gt;, and the use of &lt;a href=""&gt;composables&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;There's a bit of modification that countered my initial plan of using Vue 2 and adding an upgrade to Vue 3. I have come to realize that using the latest tools from the Vue ecosystem will not only help beginners trying to learn the latest version of Vue but also intermediates who are looking to stay up-to-date with the community.&lt;/p&gt;

&lt;p&gt;So far, this project uses the latest versions of Pinia, Vue, and Tailwind CSS. Here is how you can get started:&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up the Project Boiler Plate:
&lt;/h2&gt;

&lt;h3&gt;
  
  
  create project
&lt;/h3&gt;

&lt;p&gt;To create a project, follow the step-by-step guide to setting up a Vue project in the &lt;a href="https://vuejs.org/guide/quick-start.html#creating-a-vue-application"&gt; documentation &lt;/a&gt;. Add Vitest for unit testing; this project does not support typescript, so there’s no need to add it. Add Pinia and Vue Router. Do ensure that you add all these options features.&lt;/p&gt;

&lt;h3&gt;
  
  
  Install Icon Libary and Axios
&lt;/h3&gt;

&lt;p&gt;Icons are important for representing some information while developing an application. Font Awesome is an icon library that is designed for this purpose. For quick installation, kindly follow the instructions on how to add this library to a Vue 2 or 3 app &lt;a href="https://fontawesome.com/docs/web/use-with/vue/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Axios is a well-known JavaScript library for making HTTP requests. It's frequently used in Vue.js projects to interact with APIs and retrieve data. Here's how to &lt;a href="https://www.npmjs.com/package/axios"&gt;install&lt;/a&gt; and configure Axios in your Vue project:&lt;/p&gt;

&lt;h3&gt;
  
  
  Install Tailwind Css:
&lt;/h3&gt;

&lt;p&gt;Tailwind CSS is a utility-first CSS framework that streamlines web development by providing a set of pre-designed, atomic-level utility classes. These classes can be directly applied to HTML elements to style and design them quickly without writing custom CSS. Tailwind CSS follows a "utility-first" philosophy, which means that instead of creating custom classes for each element, developers can compose styles by combining existing utility classes. &lt;a href="https://tailwindcss.com/docs/installation"&gt;Here is how you can also add it to the project&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is how your &lt;code&gt;package.json&lt;/code&gt; would look like when you have completed all installation.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Package.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dev-project&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;version&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0.0.0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;private&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;scripts&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dev&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vite&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;build&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vite build&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;preview&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vite preview&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vitest&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;lint&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;format&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;prettier --write src/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dependencies&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@fortawesome/fontawesome-svg-core&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^6.4.2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@fortawesome/free-brands-svg-icons&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^6.4.2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@fortawesome/free-regular-svg-icons&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^6.4.2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@fortawesome/free-solid-svg-icons&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^6.4.2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@fortawesome/vue-fontawesome&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^3.0.3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;axios&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^1.4.0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pinia&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^2.1.4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^3.3.4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vue-router&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^4.2.4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;devDependencies&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@rushstack/eslint-patch&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^1.3.2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@vitejs/plugin-vue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^4.2.3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@vue/eslint-config-prettier&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^8.0.0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@vue/test-utils&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^2.4.1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;autoprefixer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^10.4.15&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;eslint&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^8.45.0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;eslint-plugin-vue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^9.15.1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;jsdom&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^22.1.0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;postcss&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^8.4.28&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;prettier&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^3.0.0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;tailwindcss&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^3.3.3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vite&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^4.4.6&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vitest&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^0.33.0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Setting Up a tailwind.config.js File:
&lt;/h2&gt;

&lt;p&gt;One of the key features of Tailwind CSS is its ability to be customized through a configuration file called &lt;code&gt;tailwind.config.js&lt;/code&gt;. This file lets you modify various aspects of Tailwind's default behavior and extend its functionality. &lt;/p&gt;

&lt;p&gt;If you have followed the &lt;a href="https://tailwindcss.com/docs/installation"&gt;installation process here&lt;/a&gt;, A config file for Tailwind will be added to your root folder. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;Tailwind.config.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="cm"&gt;/** @type {import('tailwindcss').Config} */&lt;/span&gt;
&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./index.html&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./src/**/*.{vue,js,ts,jsx,tsx}&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;screens&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;sm&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;480px&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;md&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;768px&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;lg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;976px&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;xl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;1024&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;xxl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;1440px&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;primary&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#414066&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;solid-varaint&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#4C6640&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;light-variant&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#525168&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;fontFamily&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;popins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Poppins&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sans-serif&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;borderRadius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;2xl&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;1rem&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;4xl&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;2rem&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;autoprefixer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This configuration is how we have customized the  Tailwind CSS based on our project needs. Here's what each part of the configuration does:&lt;/p&gt;

&lt;p&gt;1.&lt;code&gt;content&lt;/code&gt; : Specifies the files that Tailwind should scan to find used classes. In this case, it's looking for HTML, Vue, JavaScript, and TypeScript files.&lt;/p&gt;

&lt;p&gt;2.&lt;code&gt;theme&lt;/code&gt; : This section lets you customize the default styles provided by Tailwind.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;screens&lt;/code&gt; :  Defines breakpoints for responsive design. We've specified screen sizes for different breakpoints like small (sm), medium (md), large (lg), extra-large (xl), and xxl.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;colors&lt;/code&gt; : Defines custom color names and their corresponding hexadecimal values. &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;fontFamily&lt;/code&gt; : Specifies a custom font family to be used in your project, in this case, 'Poppins' with a fallback of 'sans-serif'. However, for this font to work properly we must install or search and import it from &lt;a href="https://fonts.google.com/"&gt;google fonts&lt;/a&gt; into your main.css file. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;src/assets/main.css&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,800;1,300&amp;amp;family=Poppins:wght@400;500&amp;amp;display=swap&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./base.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;tailwind&lt;/span&gt; &lt;span class="nx"&gt;base&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;tailwind&lt;/span&gt; &lt;span class="nx"&gt;components&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;tailwind&lt;/span&gt; &lt;span class="nx"&gt;utilities&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;extend&lt;/code&gt; : Allows you to add or modify existing theme values. Here, you've added two additional border radius values.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3.&lt;code&gt;plugins&lt;/code&gt;: This is where you can include additional plugins for your Tailwind setup. The example includes the autoprefixer plugin, which adds vendor prefixes to CSS properties.&lt;/p&gt;

&lt;p&gt;Remember to run your build process after modifying the configuration to see the changes take effect in your project's styles.&lt;/p&gt;

&lt;h2&gt;
  
  
  Designing Views for Vue Routes:
&lt;/h2&gt;

&lt;p&gt;Each route corresponds to a specific &lt;code&gt;view/component&lt;/code&gt; in your application. In Vue, views are typically created as Vue Single File Components (.vue files) that include the template, script, and style sections. Here's how you can create views:&lt;/p&gt;

&lt;p&gt;1.Create a file named Login.vue in your &lt;code&gt;src/views/&lt;/code&gt;  directory. This file will contain the template, script, and style for your Login view. repeat the same approach to create your Register and Dashbaord view&lt;/p&gt;

&lt;p&gt;Login.vue&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Login&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/template&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;LoginView&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;components&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Register.vue&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Register&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/template&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;RegisterView&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;components&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dashboard.vue&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Dashboard&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/template&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;DashboardView&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;components&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After creating view pages, we will be responsible for configuring and registering the pages for routing within our application using the Vue Router library. We accomplish this in the following steps:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;src/router/index.js&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createRouter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;createWebHistory&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;vue-router&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Register&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../views/Register.vue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Login&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../views/Login.vue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Dashbaord&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../views/Dashboard.vue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;router&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;createRouter&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;history&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;createWebHistory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;BASE_URL&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="na"&gt;routes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;home&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Login&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/login&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;login&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Login&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/register&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;register&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Register&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/dashboard&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dashboard&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Dashbaord&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;router&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Here is an explanation of how the routing works:
&lt;/h3&gt;

&lt;p&gt;1.&lt;code&gt;Imports&lt;/code&gt; :&lt;/p&gt;

&lt;p&gt;The createRouter and createWebHistory functions are imported from the 'vue-router' package. These functions are used to create and configure the router instance.&lt;/p&gt;

&lt;p&gt;2.&lt;code&gt;Component Imports&lt;/code&gt; :&lt;/p&gt;

&lt;p&gt;Three Vue components (Register, Login, and Dashboard) are imported. These components will be used as views for different routes in the application.&lt;/p&gt;

&lt;p&gt;3.&lt;code&gt;Router Configuration&lt;/code&gt; :&lt;/p&gt;

&lt;p&gt;A router instance is created using the createRouter function. It takes an object with two properties: history and routes.&lt;/p&gt;

&lt;p&gt;The history property is set to use web history mode with the base URL obtained from import.meta.env.BASE_URL.&lt;/p&gt;

&lt;p&gt;The routes property is an array containing route objects. Each object defines a route with properties like path (URL path), name (route name), and component (associated Vue component).&lt;/p&gt;

&lt;p&gt;4.&lt;code&gt;Route Definitions&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;Four routes are defined:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;'/'&lt;/code&gt;: Represents the home page using the Login component.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;'/login'&lt;/code&gt;: Represents the login page using the Login component.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;'/register'&lt;/code&gt;: Represents the registration page using the Register component.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;'/dashboard'&lt;/code&gt;: Represents the dashboard page using the Dashboard component.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;5.&lt;code&gt;Export&lt;/code&gt; :&lt;/p&gt;

&lt;p&gt;The configured router instance is exported as the default export. This allows the router to be used throughout the application for navigation and rendering based on routes.&lt;/p&gt;

&lt;p&gt;In essence, this code establishes the routing structure for a Vue application. When a user accesses specific routes, the associated components will be displayed, creating a seamless and organized user experience.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>vue</category>
      <category>frontend</category>
    </item>
    <item>
      <title>React Custom Hook: useRenderCount</title>
      <dc:creator>Sergey Leschev</dc:creator>
      <pubDate>Fri, 25 Aug 2023 21:00:00 +0000</pubDate>
      <link>https://dev.to/sergeyleschev/react-custom-hook-userendercount-192p</link>
      <guid>https://dev.to/sergeyleschev/react-custom-hook-userendercount-192p</guid>
      <description>&lt;p&gt;In this article series, we embark on a journey through the realm of custom React hooks, discovering their immense potential for elevating your development projects. Our focus today is on the "useRenderCount" hook, one of the many carefully crafted hooks available in the collection of React custom hooks.&lt;/p&gt;

&lt;p&gt;Github: &lt;a href="https://github.com/sergeyleschev/react-custom-hooks"&gt;https://github.com/sergeyleschev/react-custom-hooks&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useRef&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;useRenderCount&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useRef&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The useRenderCount hook utilizes React's useEffect and useRef hooks to keep a count of renders. With each render, the count is incremented, providing you with real-time feedback on the component's render frequency.&lt;/p&gt;

&lt;p&gt;One of the major advantages of using &lt;strong&gt;useRenderCount&lt;/strong&gt; is its simplicity. By abstracting the logic into a reusable hook, you can easily integrate it into any component without cluttering your codebase. Additionally, it provides a clear and concise way to monitor render behavior, which can be crucial for performance optimization and debugging.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;useRenderCount&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./useRenderCount&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;useToggle&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../useToggle/useToggle&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;RenderCountComponent&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;toggle&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useToggle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;renderCount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useRenderCount&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;renderCount&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;toggle&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Toggle&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This versatile hook can be applied in various scenarios. For instance, when you're developing a complex component that exhibits unexpected rendering patterns, useRenderCount helps you pinpoint the problem by showing the exact number of renders. It is also handy for measuring the impact of certain optimizations or refactoring techniques, allowing you to assess their effectiveness.&lt;/p&gt;

&lt;p&gt;To get started, simply import the &lt;em&gt;useRenderCount&lt;/em&gt; hook and call it within your component. You can see its power in action by checking out the RenderCountComponent example above. By combining useRenderCount with other custom hooks like useToggle, you can build interactive components while keeping an eye on render counts.&lt;/p&gt;

&lt;p&gt;Full Version | React Custom Hooks:&lt;br&gt;
&lt;a href="https://dev.to/sergeyleschev/supercharge-your-react-projects-with-custom-hooks-pl4"&gt;https://dev.to/sergeyleschev/supercharge-your-react-projects-with-custom-hooks-pl4&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>react</category>
    </item>
    <item>
      <title>GPT Mental Health Chatbot💛 and Google Calendar API📆</title>
      <dc:creator>Abhishek</dc:creator>
      <pubDate>Fri, 25 Aug 2023 20:09:38 +0000</pubDate>
      <link>https://dev.to/lilshake/gpt-mental-health-chatbot-and-google-calendar-api-3d94</link>
      <guid>https://dev.to/lilshake/gpt-mental-health-chatbot-and-google-calendar-api-3d94</guid>
      <description>&lt;p&gt;Hi Everyone!&lt;br&gt;
I have been working on a GPT Chatbot that...&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Talks to you for a while and understands your feelings&lt;/li&gt;
&lt;li&gt;Asks you 10 questions to plan your day&lt;/li&gt;
&lt;li&gt;Uses Google Calendar API to Build a schedule for you.&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Motivation to do this
&lt;/h1&gt;

&lt;p&gt;When I was in high school and preparing for a college entrance I achieved high level consistency and my Google Calendar Reflected it. It was more like a diary.&lt;/p&gt;

&lt;p&gt;It looked like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rLSOCuaB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/asvh1mbsjmxzynx8wpat.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rLSOCuaB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/asvh1mbsjmxzynx8wpat.png" alt="Image description" width="800" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This honestly made me happy because I had some sort of a plan for my life and &lt;strong&gt;I could visually see how it turned out.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The color scheme was also predefined. Light blue and yellow was work, pink was sleep, orange was neutral events and dark blue was R&amp;amp;R.&lt;/p&gt;

&lt;p&gt;I want to share this amazing system that made me happy, made me more productive, and in general a much smarter person.&lt;/p&gt;

&lt;p&gt;Also, at the moment &lt;em&gt;I'm taking BZDs&lt;/em&gt;. &lt;strong&gt;Medications that make you feel "tranquillity"&lt;/strong&gt;. I want people to have that feeling without them meds.&lt;/p&gt;

&lt;h2&gt;
  
  
  React app + Firebase Functions Express Endpoint
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--39p8xMLA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ovqhkqwkbmqpk0goat0d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--39p8xMLA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ovqhkqwkbmqpk0goat0d.png" alt="Image description" width="800" height="198"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is where all the chats are combined and we get a response from the openAI api.&lt;/p&gt;

&lt;p&gt;It is trained to go like a therapy session.&lt;/p&gt;

&lt;h2&gt;
  
  
  Google Calendar API
&lt;/h2&gt;

&lt;p&gt;Okay getting the whole OAuth thing working was difficult and even now, my app is still in testing! But the GPT API can call functions and I made some sort of a function to add events to someone's calendar&lt;/p&gt;

&lt;h3&gt;
  
  
  Sample Chat response to Calendar
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--65GoYUqi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gljuxz5bdxzd5wqz9bvy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--65GoYUqi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gljuxz5bdxzd5wqz9bvy.png" alt="Image description" width="800" height="861"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--T0zKWkua--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/syvdv1o553wlae2lzyfk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--T0zKWkua--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/syvdv1o553wlae2lzyfk.png" alt="Image description" width="246" height="1302"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Please ignore the light time zone mismatch.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So lets talk about testers💛&lt;/p&gt;

&lt;h1&gt;
  
  
  Looking for Testers! Try tranqility out now!
&lt;/h1&gt;

&lt;p&gt;As of now if you go to &lt;a href="https://tranqility-ai.web.app/"&gt;https://tranqility-ai.web.app/&lt;/a&gt;  I don't think you'll be able to use it unless you are registered by me as a test user.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But with another account it did work without all this test user stuff, so just try it out, it'll barely take 20 seconds.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So, if anyone is interested in a light therapy session followed by day planning, &lt;strong&gt;comment your email address and I'll invite you&lt;/strong&gt;!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>mentalhealth</category>
      <category>firebase</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Set up Hot Reload for Typescript ESM projects</title>
      <dc:creator>Wagner Manganelli (aka manga)</dc:creator>
      <pubDate>Fri, 25 Aug 2023 19:38:24 +0000</pubDate>
      <link>https://dev.to/mangadev/set-up-hot-reload-for-typescript-esm-projects-42en</link>
      <guid>https://dev.to/mangadev/set-up-hot-reload-for-typescript-esm-projects-42en</guid>
      <description>&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;Are you moving your projects to use ES Modules but you are facing some unexpected issues? You are not alone in this fight. In this tutorial, you will learn how to set up &lt;a href="https://nodemon.io/"&gt;nodemon&lt;/a&gt; along with &lt;a href="https://typestrong.org/ts-node/docs/"&gt;ts-node&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Wait, why are we not using &lt;a href="https://www.npmjs.com/package/ts-node-dev"&gt;ts-node-dev&lt;/a&gt;? Currently, there are some issues related to TS ESM projects that are making its use harder. Check this &lt;a href="https://github.com/wclr/ts-node-dev/issues/314"&gt;issue&lt;/a&gt; for more details.&lt;/p&gt;




&lt;h2&gt;
  
  
  Hot-Reload?
&lt;/h2&gt;

&lt;p&gt;This technique is handy when you are developing locally. This will automatically watch changes over your source code and updates for you. So, you just have to make your code work and the hot-reloading will do the magic from behind the scenes. This will improve your code development process bringing more efficiency and velocity, as you will not have to restart every time your application.&lt;/p&gt;




&lt;h2&gt;
  
  
  Let's set it up 🔧
&lt;/h2&gt;




&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Node.js &amp;gt;= v18.12.0&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Initial steps
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir app-esm-hot-reload
cd app-esm-hot-reload
npm init -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Install dev dependencies
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install --save-dev typescript@5.1.6 ts-node@10.9.1 nodemon@3.0.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Initialize TypeScript
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  npx tsc --init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Configuration steps
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;package.json&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"module"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"build"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"tsc"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"dev"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"nodemon src/index.ts"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"start"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"node dist/index.js"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;tsconfig.json&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"target"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ESNext"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"module"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"NodeNext"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"moduleResolution"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"NodeNext"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"outDir"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dist"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"esModuleInterop"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"strict"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"skipLibCheck"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"ts-node"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"esm"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"exclude"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"node_modules"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./*.ts"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"__test__"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create index.ts
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir src
touch src/index.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Execute script
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Make changes to the index.ts or any other file&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your app should be reloaded automatically&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;That's it!&lt;/strong&gt; Now you can start coding without bothering with restarting your application at every change. 🍺&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  &lt;em&gt;P.S.&lt;/em&gt; you can refer to this &lt;a href="https://github.com/manganellidev/dev.to/tree/main/app-esm-hot-reload"&gt;template&lt;/a&gt;.
&lt;/h5&gt;




&lt;h3&gt;
  
  
  Useful links
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://nodemon.io/"&gt;nodemon&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://typestrong.org/ts-node/docs/"&gt;ts-node&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Tutorials that might interest you as well
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/mangadev/set-up-a-backend-nodejs-typescript-jest-using-es-modules-1530"&gt;Set up a Node.js project + TypeScript + Jest using ES Modules&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;I hope this tutorial improves your development process. &lt;/p&gt;

&lt;p&gt;Thank you for reading! Happy coding! 🥳&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>node</category>
      <category>esm</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Create your first Web-app using ChatGPT</title>
      <dc:creator>Lionel Tchami ♾️☁️</dc:creator>
      <pubDate>Fri, 25 Aug 2023 19:24:00 +0000</pubDate>
      <link>https://dev.to/softwaresennin/create-your-first-web-app-using-chatgpt-2174</link>
      <guid>https://dev.to/softwaresennin/create-your-first-web-app-using-chatgpt-2174</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Language translation is essential in our globalized world, bridging language gaps. Web apps are becoming more important for seamless communication due to the rising need for language translation services.&lt;/p&gt;

&lt;p&gt;This article discusses creating a web-based language translation application utilizing ChatGPT and Streamlit. ChatGPT, an advanced OpenAI language model, can generate natural-sounding text responses from inputs provided. On the other hand, Streamlit is a powerful open-source framework for fast, easy data science web application development.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL ; DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use Chatgpt to create a Translator Web-app&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H0xHL5Ga--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://media.tenor.com/9XQB0D9EdN4AAAAC/reaction-one-piece.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H0xHL5Ga--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://media.tenor.com/9XQB0D9EdN4AAAAC/reaction-one-piece.gif" alt="here" width="498" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Here we go....&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  I. Starting ChatGPT and Streamlit
&lt;/h2&gt;

&lt;p&gt;Before building our language translation web application, we must set up our development environment and install the necessary packages. This section explains how to configure and install OpenAI with Streamlit.&lt;/p&gt;

&lt;p&gt;ChatGPT's language model was created by OpenAI, which powers our web-based translation tool. To use OpenAI's resources, we will need to get an API key from the website. With the API key, we can install OpenAI using pip in our command prompt or terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;openai
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we need to setup &lt;a href="https://docs.streamlit.io/library/get-started"&gt;Streamlit&lt;/a&gt;, which is the framework we will be using to build our web app. We can also use &lt;em&gt;pip&lt;/em&gt; to install Streamlit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;streamlit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that OpenAI and Streamlit have been installed, we can now start building our translation web-based app.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For more information on ChatGPT, Streamlit, and the OpenAI API key acquisition procedure, check out my in-depth tutorial, &lt;strong&gt;Building a ChatGPT Web Application using Streamlit and OpenAI: A Step-by-Step Tutorial&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  II. Developing the Translation Web-App
&lt;/h2&gt;

&lt;p&gt;After installing the necessary packages, let us now see how to create the user interface for our language translation web-based application. Please follow this full guide:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Name a new file app.py in your favourite Python editor. Please copy the code snippets into your file and save changes.&lt;/li&gt;
&lt;li&gt;Import the necessary packages to start coding:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Importing required packages  
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;streamlit&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;st&lt;/span&gt;  
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;openai&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;We will use ChatGPT model engine &lt;code&gt;text-davinci-003&lt;/code&gt;. This model can mimic human responses and even translate across languages. This model requires registration and an OpenAI &lt;code&gt;api_key&lt;/code&gt;, as explained in step (V.5) of this article. Now, add the following two lines to your script:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Set the model engine and your OpenAI API key  &lt;/span&gt;
model_engine &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"text-davinci-003"&lt;/span&gt;  
openai.api_key &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"your_secret_key"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Next we will create the &lt;code&gt;translate_tex&lt;/code&gt; function which will take care of the &lt;strong&gt;translation&lt;/strong&gt; process. This function will take whatever the user selects as &lt;strong&gt;target language&lt;/strong&gt; and &lt;strong&gt;text input&lt;/strong&gt; and return the &lt;strong&gt;translated text&lt;/strong&gt;.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Define a function to handle the translation process  
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;translate_text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;target_language&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;  
&lt;span class="c1"&gt;# Define the prompt for the ChatGPT model  
&lt;/span&gt;&lt;span class="n"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"Translate '&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;' to &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;target_language&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;  

&lt;span class="c1"&gt;# Generate the translated text using ChatGPT  
&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Completion&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;  
&lt;span class="n"&gt;engine&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;model_engine&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
&lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
&lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
&lt;span class="n"&gt;stop&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
&lt;span class="n"&gt;temperature&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
&lt;span class="p"&gt;)&lt;/span&gt;  

&lt;span class="c1"&gt;# Extract the translated text from the response  
&lt;/span&gt;&lt;span class="n"&gt;translated_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  

&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;translated_text&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Now to bring it all together, we will create the &lt;code&gt;main()&lt;/code&gt; function that will call the needed functions to create our language web-based translation app. Let us setup this app, so the user will be able to translate text into &lt;code&gt;Arabic, English, Spanish, French, German, Japanese, Russian, Korean, Chinese, Yoruba&lt;/code&gt; :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Define the main function that sets up the Streamlit UI and handles the translation process  
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;  
&lt;span class="c1"&gt;# Set up the Streamlit UI  
&lt;/span&gt;&lt;span class="n"&gt;st&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sidebar&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'Language Translation App'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  
&lt;span class="n"&gt;st&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sidebar&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'Enter text to translate and select the target language:'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  

&lt;span class="c1"&gt;# Create a text input for the user to enter the text to be translated  
&lt;/span&gt;&lt;span class="n"&gt;text_input&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;st&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text_input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'Enter text to translate'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  

&lt;span class="c1"&gt;# Create a selectbox for the user to select the target language  
&lt;/span&gt;&lt;span class="n"&gt;target_language&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;st&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;selectbox&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'Select language'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'Arabic'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'English'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'Spanish'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'French'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'German'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'Japanese'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'Russian'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'Korean'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'Chinese'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'Yoruba'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;  

&lt;span class="c1"&gt;# Create a button that the user can click to initiate the translation process  
&lt;/span&gt;&lt;span class="n"&gt;translate_button&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;st&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'Translate'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  

&lt;span class="c1"&gt;# Create a placeholder where the translated text will be displayed  
&lt;/span&gt;&lt;span class="n"&gt;translated_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;st&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;empty&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  

&lt;span class="c1"&gt;# Handle the translation process when the user clicks the translate button  
&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;translate_button&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  
&lt;span class="n"&gt;translated_text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'Translating...'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  
&lt;span class="n"&gt;translated_text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;translate_text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text_input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;target_language&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Now for our last step, we need to call the main function that we created
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Call the main function  
&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;'__main__'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  
&lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All done, now go ahead and save the file. We can give any name to our python file. I will call it &lt;code&gt;Translator_GPT.py&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We can now run our translator app in our terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;streamlit&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="n"&gt;Translator_GPT&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you run this command, a webpage in your default web browser will open where we will see our web-app.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1adMbcvs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/dezp6utan/image/upload/v1692582897/blogging/2023-08-20_19h54_26.png.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1adMbcvs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/dezp6utan/image/upload/v1692582897/blogging/2023-08-20_19h54_26.png.png" alt="here" width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please go ahead and test the app for yourself. This is what it will look like. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BDYKp_HP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/v2/resize:fit:4800/format:webp/1%2Aqw4tQfsDGS6GZ-wJIcMGPA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BDYKp_HP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/v2/resize:fit:4800/format:webp/1%2Aqw4tQfsDGS6GZ-wJIcMGPA.png" alt="image" width="800" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  III. Making our Web-app to the World
&lt;/h2&gt;

&lt;p&gt;To make our app public, there are 3 easy ways. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://streamlit.io/"&gt;Streamlit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://huggingface.co/"&gt;Hugging Face&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.heroku.com/"&gt;Heroku&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We will look at how to make our available to everyone, using streamlit&lt;/p&gt;

&lt;h4&gt;
  
  
  III.1 Before Deploying to the Cloud…
&lt;/h4&gt;

&lt;p&gt;We are now ready to deploy our translation app to the rest of the world. Before doing that, we need to do some house cleaning.&lt;/p&gt;

&lt;h4&gt;
  
  
  III.2 Install git
&lt;/h4&gt;

&lt;p&gt;We need to install &lt;a href="https://github.com/git-guides/install-git"&gt;Git&lt;/a&gt;, our Version Control Tool which will allow us to run git commands on the terminal to upload our app.&lt;/p&gt;

&lt;h4&gt;
  
  
  III.3 Add a ‘requirements.text’ file
&lt;/h4&gt;

&lt;p&gt;The cloud platform will need to know the python packages to install before they can start your app. We will specify that in our &lt;code&gt;requirements.txt&lt;/code&gt;file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;streamlit  
pandas
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  III.4 Deploy your App to Streamlit Cloud
&lt;/h3&gt;

&lt;p&gt;We will be using Streamlit to make our website public&lt;/p&gt;

&lt;h4&gt;
  
  
  III.4.1 Set up a GitHub Account
&lt;/h4&gt;

&lt;p&gt;First, create a GitHub account here: &lt;a href="https://github.com/"&gt;Click here&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  III.4.2 Create a New GitHub Repository
&lt;/h4&gt;

&lt;p&gt;In the upper-right corner of any page, use the drop-down &lt;code&gt;+&lt;/code&gt; menu, and select &lt;code&gt;New repository&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tPyra7S8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/v2/resize:fit:624/format:webp/1%2A2TDZMiGkMocZJV7UDrXiRA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tPyra7S8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/v2/resize:fit:624/format:webp/1%2A2TDZMiGkMocZJV7UDrXiRA.png" alt="github" width="312" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Give the repo name you want &lt;code&gt;repository name&lt;/code&gt;, -&amp;gt; click on &lt;code&gt;Create repository&lt;/code&gt;. For now, no need to change any parameters, we will go with the default parameters.&lt;/p&gt;

&lt;h4&gt;
  
  
  III.4.3 Upload Files to your GitHub Repository
&lt;/h4&gt;

&lt;p&gt;Now click on ‘uploading an existing file’.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lYcR38lu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/dezp6utan/image/upload/v1692582232/blogging/2023-08-20_19h38_13.png.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lYcR38lu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/dezp6utan/image/upload/v1692582232/blogging/2023-08-20_19h38_13.png.png" alt="tre" width="800" height="179"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select your &lt;code&gt;app.py&lt;/code&gt; and &lt;code&gt;requirements.txt&lt;/code&gt; files inside the following page.&lt;/p&gt;

&lt;h4&gt;
  
  
  III.4.4 Set up a Streamlit Cloud Account
&lt;/h4&gt;

&lt;p&gt;First we need to create a streamlit account. To do create a Streamlit cloud account here: &lt;a href="https://streamlit.io/cloud"&gt;Click&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  III.4.5 Create a New App and Link your GitHub Account
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You will see a prominently visible "&lt;strong&gt;New app&lt;/strong&gt;" button after logging in, which is self-explanatory once you see it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Also, you will get a prompt asking you to "&lt;strong&gt;Connect to GitHub&lt;/strong&gt;". Click on it and log into your previously created GitHub account to continue.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--l1u1LAbS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/dezp6utan/image/upload/v1692582400/blogging/2023-08-20_19h45_48.png.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--l1u1LAbS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/dezp6utan/image/upload/v1692582400/blogging/2023-08-20_19h45_48.png.png" alt="here" width="800" height="318"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  III.4.6 Deploy your App
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;On the next screen, search for the &lt;strong&gt;GitHub repository&lt;/strong&gt; that you just created. Type the repo name in the area -&amp;gt; &lt;code&gt;Repository&lt;/code&gt;, which is specifically for this purpose.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the field -&amp;gt; &lt;code&gt;Main file path&lt;/code&gt; change to &lt;code&gt;app.py&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click the 'Deploy!' button.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ghnAfVgG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/dezp6utan/image/upload/v1692584962/blogging/2023-08-20_20h25_10.png.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ghnAfVgG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/dezp6utan/image/upload/v1692584962/blogging/2023-08-20_20h25_10.png.png" alt="go" width="800" height="643"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  III.4.7 Your Public App is Now Live on Streamlit Cloud!
&lt;/h4&gt;

&lt;p&gt;After waiting for some time, your app will appear. Congrats! Here’s mine: &lt;a href="https://share.streamlit.io/apotitech/translatorGPT/main/TranslatorGPT.py"&gt;https://share.streamlit.io/apotitech/translatorGPT/main/TranslatorGPT.py&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--L0YfV6ue--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/dezp6utan/image/upload/v1692587663/blogging/2023-08-20_21h13_25.png.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--L0YfV6ue--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/dezp6utan/image/upload/v1692587663/blogging/2023-08-20_21h13_25.png.png" alt="site" width="800" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Congratulations!!!!!! You have created your very first app.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xlIxvCmU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://media.tenor.com/wRTcYdEJVhEAAAAC/success-benny-cerra.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xlIxvCmU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://media.tenor.com/wRTcYdEJVhEAAAAC/success-benny-cerra.gif" alt="yay" width="498" height="258"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Great job creating your very first app. Please go ahead and share your new app to others and let them test your app. &lt;/p&gt;

&lt;p&gt;With that said ----------------&amp;gt; &lt;strong&gt;Happy Building!!&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Thank you for taking the time to read this! If you like the article, please clap (up to 50 times!) and connect with me on &lt;a href="https://www.linkedin.com/in/apotitech-b79097210/"&gt;LinkedIn&lt;/a&gt; , &lt;a href="https://dev.to/softwaresennin"&gt;dev.to&lt;/a&gt; and &lt;a href="https://medium.com/@softwaresennin"&gt;Medium&lt;/a&gt; to remain up to speed on my future articles. 😅&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>tutorial</category>
      <category>openai</category>
      <category>beginners</category>
      <category>python</category>
    </item>
    <item>
      <title>Killing the Create React App - CRA to Vite migration guide (Javascript)</title>
      <dc:creator>Navdeep Mishra</dc:creator>
      <pubDate>Fri, 25 Aug 2023 19:13:57 +0000</pubDate>
      <link>https://dev.to/navdeepm20/killing-the-create-react-app-cra-to-vite-migration-guide-javascript-1f5</link>
      <guid>https://dev.to/navdeepm20/killing-the-create-react-app-cra-to-vite-migration-guide-javascript-1f5</guid>
      <description>&lt;p&gt;Create React App (CRA) is a popular tool for creating React applications. It provides a quick and easy way to get started with React, but it can be limiting in terms of features and flexibility. Vite is a newer build tool that offers a number of advantages over CRA, including faster development times, smaller bundle sizes, and more customization options.&lt;/p&gt;

&lt;p&gt;Here are some of the reasons why you might want to migrate from CRA to Vite:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Faster development times: Vite uses native ES modules and has a built-in dev server that can hot reload your changes in real time. This can save you a lot of time when you're developing your application.&lt;/li&gt;
&lt;li&gt;Smaller bundle sizes: Vite uses modern build tools to optimize your code, which can result in smaller bundle sizes. This can improve the performance of your application and make it easier to deploy to production.&lt;/li&gt;
&lt;li&gt;More customization options: Vite has a simpler configuration than CRA, which gives you more control over how your application is built. This can be helpful if you need to customize your build process for specific needs.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Of course, there are also some potential drawbacks to migrating to Vite:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Less community support: Vite is not as widely used as CRA, so there is less community support available. This can make it more difficult to find help with problems you might encounter when using Vite.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Overall, the benefits of migrating from CRA to Vite outweigh the drawbacks. If you're looking for a faster, more customizable, and more performant build tool for your React applications, then Vite is a great option.&lt;/p&gt;

&lt;p&gt;Let's now quickly see how we can do that. 😎&lt;/p&gt;

&lt;p&gt;If you already have an app running on Create React App or CRA with JS template then follow the below steps to migrate safely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;em&gt;I am using &lt;code&gt;Yarn&lt;/code&gt; here for package management. If you are using &lt;code&gt;npm&lt;/code&gt; or &lt;code&gt;pnpm&lt;/code&gt; then use commands according to your package manager.&lt;/em&gt; 😎&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt;&lt;br&gt;
We have to install first vite in our project. 🔥&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add -D vite @vitejs/plugin-react
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt;&lt;br&gt;
Uninstall the react-script (CRA) from your project. 😆&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn remove react-scripts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt;&lt;br&gt;
Let's modify our &lt;code&gt;package.json&lt;/code&gt; scripts. 😮&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"scripts": {
  "dev": "vite",
  "build": "vite build",
  "serve": "vite preview"
},
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt;&lt;br&gt;
Create the &lt;code&gt;vite.config.json&lt;/code&gt; in your root directory of the project 😯&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch vite.config.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 5:&lt;/strong&gt;&lt;br&gt;
Copy paste the content mentioned below in your &lt;code&gt;vite.config.js&lt;/code&gt; 🤔&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig(() =&amp;gt; {
  return {
    build: {
      outDir: 'build',
    },
    plugins: [react()],
  };
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 6:&lt;/strong&gt;&lt;br&gt;
Now one of the crucial step is to rename all the existing files from js to jsx. Vite not supports js file containing any jsx syntax like '&amp;lt; or &amp;gt;' aka angular brackets but if you think any file is by mistake renamed then revert back that file to .js extension. 😆😆😆😆😆&lt;/p&gt;

&lt;p&gt;To do that we have a smart command. Thanks to this &lt;a href="https://gist.github.com/parties/90cdf35f9a3d05bea6df76dc83a69641"&gt;Github Conversation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;if using git then run this command in your root directory in bash terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;find ./src -type f -name '*.js' -not -name '*.jsx' -not -name '*.ejs' -exec bash -c 'grep -l "&amp;lt;/" $0' {} \; -exec bash -c 'git mv "$0" "${0%.js}.jsx"' {} \;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;if not using git then run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# finds all *.js files that have either `&amp;lt;/` or `/&amp;gt;` tags in them and renames them to *.jsx
find ./src -type f -name '*.js' -not -name '*.jsx' -not -name '*.ejs' -exec bash -c 'grep -l -E "&amp;lt;/|/&amp;gt;" "$0"' {} \; -exec bash -c 'mv "$0" "${0%.js}.jsx"' {} \;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 6:&lt;/strong&gt;&lt;br&gt;
After renaming, move the &lt;code&gt;index.html&lt;/code&gt; from &lt;code&gt;public&lt;/code&gt; folder to your root directory. 🙃&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mv public/index.html .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 7:&lt;/strong&gt;&lt;br&gt;
Afterward, remove all %PUBLIC_URL% occurrences in the index.html file like mention below. You can use global search &lt;code&gt;ctrl+shift+s&lt;/code&gt; in vs code to find and replace it. 🫡&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- &amp;lt;link rel="icon" href="%PUBLIC_URL%/favicon.ico" /&amp;gt;
+ &amp;lt;link rel="icon" href="/favicon.ico" /&amp;gt;

&amp;lt;!-- do this for all occurrences  --&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 8:&lt;/strong&gt;&lt;br&gt;
Last, link the src/index.js file in your moved index.html file like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;body&amp;gt;
  &amp;lt;div id="root"&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;script type="module" src="/src/index.jsx"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's all for normal project using CRA. We'll see few bonus tips ass well. 😉&lt;/p&gt;

&lt;p&gt;Now run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now open your browser and type &lt;code&gt;localhost:5173&lt;/code&gt; you'll see your project running. 😎&lt;/p&gt;

&lt;p&gt;That's all for a project running on CRA. &lt;/p&gt;

&lt;p&gt;Now Let's see some bonus tips.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;If you are using **svg's&lt;/strong&gt; as React Component you have to install &lt;code&gt;svgr&lt;/code&gt;. Run**
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add vite-plugin-svgr
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now modify your &lt;code&gt;vite.config.js&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import svgr from 'vite-plugin-svgr';

export default defineConfig(() =&amp;gt; {
  return {
    build: {
      outDir: 'build',
    },
    plugins: [
      react(),
      // svgr options: https://react-svgr.com/docs/options/
      svgr({ svgrOptions: { icon: true } }),
    ],
  };
});

// which allows you to import SVGs as React components
// import { ReactComponent as MyIcon } from './my-icon.svg';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;If you want to use the path alias, then modify your &lt;code&gt;vite.config.js&lt;/code&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import path from 'path';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import svgr from 'vite-plugin-svgr';

export default defineConfig(() =&amp;gt; {
  return {
    resolve: {
      alias: {
        '~': path.resolve(__dirname, './src'),
      },
    },
    build: {
      outDir: 'build',
    },
    plugins: [react()],
  };
});

// which allows you to import from folders under the /src folder
// import Button from '~/components/Button';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;If you want to open browser on server start, add the following code in your &lt;code&gt;vite.config.js&lt;/code&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig(() =&amp;gt; {
  return {
    server: {
      open: true,
    },
    build: {
      outDir: 'build',
    },
    plugins: [react()],
  };
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;If you face error for your env variables saying process is undefined or anything similar then remove the &lt;strong&gt;REACT_APP&lt;/strong&gt; prefix from them and instead write &lt;code&gt;VITE&lt;/code&gt; as prefix and instead of using &lt;code&gt;process.env&lt;/code&gt; use &lt;code&gt;import.meta.env.[VARIABLE_NAME]&lt;/code&gt; For more info on vite env variable and modes &lt;a href="https://vitejs.dev/guide/env-and-mode.html"&gt;Check Here&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;i.e -&lt;/p&gt;

&lt;p&gt;&lt;code&gt;.env&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;REACT_APP_TEST=true
//to
VITE_TEST=true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use in this way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//from 
process.env.REACT_APP_TEST=true
//to
import.meta.env.VITE_TEST=true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;If you are using emotion, update your &lt;code&gt;vite.config.js&lt;/code&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig(() =&amp;gt; {
  return {
    build: {
      outDir: 'build',
    },
    plugins: [
      react({
        jsxImportSource: '@emotion/react',
        babel: {
          plugins: ['@emotion/babel-plugin'],
        },
      }),
    ],
  };
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's all for this guide. 😉 If you face any issue or have any updates please comment below. &lt;strong&gt;For more content please Share, Like and Follow.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Thankyou 😎&lt;/p&gt;

</description>
      <category>react</category>
      <category>vite</category>
      <category>createreactapp</category>
      <category>webdev</category>
    </item>
    <item>
      <title>🎯 Overcoming Impostor Syndrome in the World of Web Development 💻</title>
      <dc:creator>Mohsindev369</dc:creator>
      <pubDate>Fri, 25 Aug 2023 19:10:39 +0000</pubDate>
      <link>https://dev.to/mohsindev369/overcoming-impostor-syndrome-in-the-world-of-web-development-45pp</link>
      <guid>https://dev.to/mohsindev369/overcoming-impostor-syndrome-in-the-world-of-web-development-45pp</guid>
      <description>&lt;p&gt;Hey There 👋&lt;/p&gt;

&lt;p&gt;Today, I wanted to talk about something that many of us in the web development community have likely experienced at some point in our careers: Impostor Syndrome. 🤔&lt;/p&gt;

&lt;p&gt;Impostor Syndrome is that nagging feeling of self-doubt and inadequacy, even in the face of accomplishments and evidence of competence. It's that voice in our heads that whispers, "Do I really belong here?" or "Am I just lucky, or do I actually know what I'm doing?" Trust me, you're not alone if you've ever had these thoughts. 🙋‍♂️🙋‍♀️&lt;/p&gt;

&lt;p&gt;In the fast-paced and ever-evolving world of web development, it's easy to feel like you're falling behind or that you're not as skilled as your peers. But here's the truth: You've come a long way, and you deserve to be where you are! 🚀&lt;/p&gt;

&lt;p&gt;Here are a few strategies I've found helpful in combating Impostor &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Acknowledge Your Achievements:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Take a moment to reflect on your journey. Remember the projects you've successfully delivered, the complex code you've tackled, and the problems you've solved. These accomplishments are proof of your skills and dedication.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Embrace Continuous Learning:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Web development is all about growth. Instead of fixating on what you don't know, focus on what you're learning. Every challenge you overcome adds to your expertise.&lt;/p&gt;

&lt;p&gt;Talk About It: Don't be afraid to open up to your colleagues or mentors about how you're feeling. You'll likely find that they've experienced similar thoughts and can provide valuable perspective.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Celebrate Progress:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Break down your larger goals into smaller milestones. Celebrate each achievement along the way. It's a great way to remind yourself of your capabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Remember You're Not Alone:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Impostor Syndrome is more common than you think. Many successful developers have dealt with it too. It's a sign that you care about your work and want to do your best.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Practice Self-Compassion:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Treat yourself with kindness. Remember that making mistakes is a natural part of learning and growing. Don't be too hard on yourself.&lt;/p&gt;

&lt;p&gt;Let's turn Impostor Syndrome into Impostor Strength! 🦸‍♂️🦸‍♀️ Remember, every challenge you face and overcome is a step forward in your journey. You belong in this field, and your unique skills contribute to the vibrant web development community.&lt;/p&gt;

&lt;p&gt;Have you experienced Impostor Syndrome? How do you overcome it? Let's start a conversation and support each other in the comments below! 👇&lt;/p&gt;

&lt;h1&gt;
  
  
  WebDevelopment #ImpostorSyndrome #TechCommunity #PersonalGrowth
&lt;/h1&gt;

</description>
    </item>
    <item>
      <title>Using the event bus pattern in Android with Kotlin</title>
      <dc:creator>Tristan Elliott</dc:creator>
      <pubDate>Fri, 25 Aug 2023 19:03:45 +0000</pubDate>
      <link>https://dev.to/theplebdev/handling-complex-state-logic-in-android-authentication-2mff</link>
      <guid>https://dev.to/theplebdev/handling-complex-state-logic-in-android-authentication-2mff</guid>
      <description>&lt;h3&gt;
  
  
  Table of contents
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Event bus patter&lt;/li&gt;
&lt;li&gt;SharedFlow&lt;/li&gt;
&lt;li&gt;Extending the event bus pattern&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  The code
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/thePlebDev/Clicker"&gt;GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Introduction &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Recently I have had to deal with some relatively complex state logic for a login system and this was how I dealt with it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Event bus pattern &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;So in nerd talk we can describe the Event bus pattern as &lt;a href="https://medium.com/elixirlabs/event-bus-implementation-s-d2854a9fafd5"&gt;this&lt;/a&gt;: &lt;code&gt;Event-driven architecture pattern is a distributed asynchronous architecture pattern to create highly scalable reactive applications. The pattern suits for every level application stack from small to complex ones. The main idea is delivering and processing events asynchronously.&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Which basically means we can have an event producer object and event subscriber objects that wait and listen for the event producer to produce events. The subscribers can then consume and respond to those events. The classic mental model is down below:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SGjZw2j3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1sg4begqwexwwiptrc9a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SGjZw2j3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1sg4begqwexwwiptrc9a.png" alt="Event bus pattern" width="800" height="689"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  SharedFlow &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Now if you are unfamiliar with what a SharedFlow is, just know that it is a &lt;a href="https://developer.android.com/kotlin/flow/stateflow-and-sharedflow"&gt;hot flow&lt;/a&gt;. Which means, that when the terminal operator &lt;code&gt;collect{}&lt;/code&gt; is called it will always be active. &lt;/li&gt;
&lt;li&gt;However, we are going to use a specialized version of a SharedFlow called the &lt;a href="https://developer.android.com/kotlin/flow/stateflow-and-sharedflow#stateflow"&gt;StateFlow&lt;/a&gt; for our event bus:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class DataStoreViewModel(): ViewModel() {
private val _oAuthUserToken:MutableStateFlow&amp;lt;String?&amp;gt; = MutableStateFlow(null)

init{
  viewModelScope.launch{
     _oAuthUserToken.collect{ token -&amp;gt;
        token?.let{oAuthToken -&amp;gt;
     // make request now that the oAuthToken is not null
    }
}
  }
}

fun setOAuthToken(token:String){
   _oAuthUserToken.tryEmit(token)

}
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;In the code block above we are &lt;code&gt;registering a subscriber&lt;/code&gt; when calling &lt;code&gt;_oAuthUserToken.collect{}&lt;/code&gt;. Meaning that it will always be active as long as the scope it is calling is active. if &lt;code&gt;viewModelScope&lt;/code&gt; is destroyed then so is the subscriber.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Extending the event bus pattern &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Now there are going to be times when your authentication process has multiple steps and each step relies on the previous one. Also, at anytime, one of those steps can fail meaning that the steps that relied on that one also fail. So how do we model this problem? We extend the event bus pattern like so:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;data class MainBusState(
    val oAuthToken:String? = null,
    val authUser:ValidatedUser? = null,
)

private val authenticatedUserFlow = combine(
        flow =MutableStateFlow&amp;lt;String?&amp;gt;(null),
        flow2 =MutableStateFlow&amp;lt;ValidatedUser?&amp;gt;(null)
    ){
        oAuthToken,validatedUser -&amp;gt;
        MainBusState(oAuthToken,validatedUser)

    }.stateIn(viewModelScope, SharingStarted.Lazily,
        MainBusState(oAuthToken = null, authUser = null)
    )
private val mutableAuthenticatedUserFlow = MutableStateFlow(authenticatedUserFlow.value)



private fun collectAuthenticatedUserFlow() =viewModelScope.launch {
        mutableAuthenticatedUserFlow.collect{mainState -&amp;gt;
            mainState.oAuthToken?.let{notNullToken -&amp;gt;
                validateOAuthToken(notNullToken)
            }
            mainState.authUser?.let {user -&amp;gt;
                _uiState.value = _uiState.value.copy(
                    clientId = user.clientId,
                    userId = user.userId
                )
            }
        }
    }

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The above code can be broken down into 4 steps:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1) model your main state&lt;/strong&gt;&lt;br&gt;
  &lt;strong&gt;2) combine your flows&lt;/strong&gt;&lt;br&gt;
  &lt;strong&gt;3) register the subscribers&lt;/strong&gt;&lt;br&gt;
  &lt;strong&gt;4) emit to the flow&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  1) Model your main state
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;data class MainBusState(
    val oAuthToken:String? = null,
    val authUser:ValidatedUser? = null,
)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;each value in the MainBusState represents a step inside of the authentication process. With the code you can tell that my app needs an oAuth Authentication token and it needs to validate the user. The validated user step can not happen if there is no oAuth Authentication token&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2) Combine your flows
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private val authenticatedUserFlow = combine(
        flow =MutableStateFlow&amp;lt;String?&amp;gt;(null),
        flow2 =MutableStateFlow&amp;lt;ValidatedUser?&amp;gt;(null)
    ){
        oAuthToken,validatedUser -&amp;gt;
        MainBusState(oAuthToken,validatedUser)

    }.stateIn(viewModelScope, SharingStarted.Lazily,
        MainBusState(oAuthToken = null, authUser = null)
    )

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This is done so we can take multiple flows and combined them into one object. This makes it much easier and more readable, we simply have to subscribe to a single flow. The &lt;code&gt;stateIn()&lt;/code&gt; is just us turning the cold flow produced by &lt;code&gt;combine()&lt;/code&gt; into a hot flow&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3) register the subscribers
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private fun collectAuthenticatedUserFlow() =viewModelScope.launch {
        mutableAuthenticatedUserFlow.collect{mainState -&amp;gt;
            mainState.oAuthToken?.let{notNullToken -&amp;gt;
                validateOAuthToken(notNullToken)
            }
            mainState.authUser?.let {user -&amp;gt;
                _uiState.value = _uiState.value.copy(
                    clientId = user.clientId,
                    userId = user.userId
                }
            }
        }
    }

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;When this function is run, it will last as long as the viewModelScope and it registers 2 subscribers. One subscriber is listening to the oAuthToken and the other to the authUser. Both of which have their respective functions to run when they are not null.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4) Emit to the flow
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; mutableAuthenticatedUserFlow.tryEmit(
                    mutableAuthenticatedUserFlow.value.copy(
                        oAuthToken = newTokenStrin
                    )
                )

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Then to update the value to our mutableAuthenticatedUserFlow we simple call tryEmit() with the updated values of our MainBusState. The new emitted value will be given to our mutableAuthenticatedUserFlow and the values that are updated will given to their respective listeners.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Thank you for taking the time out of your day to read this blog post of mine. If you have any questions or concerns please comment below or reach out to me on &lt;a href="https://twitter.com/AndroidTristan"&gt;Twitter&lt;/a&gt;. &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>mobile</category>
      <category>android</category>
      <category>kotlin</category>
      <category>tristan</category>
    </item>
  </channel>
</rss>
